Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Console Help
  • I noticed that the console sometimes exits if you get an error. For example if I test:
    >>> $test = Model   // gives a warning, can still use console
    
    >>> $test = Model_NotExistingModel::factory()  //critical php error, back to terminal
    
    Is there any way I can prevent php errors from terminating the oil console? //I know I can use tasks but I was wondering if I could enhance the oil console. Thank you!
  • Don't just say "error", provide it! You are missing ; on your line endings.
  • This is the error:
    ~/Webwork/riddle% php oil c
    Fuel 1.0.1 - PHP 5.3.5-1ubuntu7.2 (cli) (May  2 2011 23:15:18) [Linux]
    >>> $test = Model_ThisModelDoesNotExist::factory()
    PHP Fatal error:  Class 'Model_ThisModelDoesNotExist' not found in /home/sergiu/Webwork/riddle/fuel/packages/oil/classes/console.php(90) : eval()'d code on line 1
    Warning - file(/home/sergiu/Webwork/riddle/fuel/packages/oil/classes/console.php(90) : eval()'d code): failed to open stream: No such file or directory in COREPATH/classes/debug.php on line 240
    Warning - array_unshift() expects parameter 1 to be array, boolean given in COREPATH/classes/debug.php on line 241
    Warning - array_slice() expects parameter 1 to be array, boolean given in COREPATH/classes/debug.php on line 256
    Warning - Invalid argument supplied for foreach() in COREPATH/classes/debug.php on line 263
    Error - Class 'Model_ThisModelDoesNotExist' not found in PKGPATH/oil/classes/console.php(90) : eval()'d code on line 1
    ~/Webwork/riddle% 
    
    As you can see I am kicked out of the oil console after that error.
    >>> $test = Model_Domain::factory()
    >>> $test
    Model_Domain::__set_state(array(
       '_is_new' => true,
       '_frozen' => false,
       '_data' => 
       ...
    
    This works just well so I don't think not using ';' is the problem.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion