Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
oil tasks
  • I've a basic question regarding oil task command line shell.

    I realized that an oil task gives back the output only after everything is finished.
    I created a task that takes a lot of time to finish, and echo back the results during its run.

    But those echo never output anything during the shell is running. 
    They all output at once when it's finished. Is this how oil task is made? 
    I cannot do anything to make it echo back while it is running?

    Thanks in advance for your help. 
  • The framework does output buffering by default, but it should be switched off when in cli mode.

    You might have to check if output buffering isn't configured in your php.ini (by default a lot of distro's define a 4096 byte output buffer, effectively enabling buffering in cli mode too).

    And if it is, check of you can disable it at the beginning of your script (for example by using an ob_end_flush() call. Perhaps this check should be done by the framework, so if you have managed to solve it, please let us know.
  • Thank you Harro.

    I have other PHP frame working in the same server and its command line shell does return line by line output while it's running. It is strange how Fuel doesn't.

    For example, I am selecting all data from a table and do something to it one by one with foreach() and print_r() this result within this foreach(). Fuel returns all the print_r() output when the shell is finished.
  • I just want to add, 

    Adding ob_end_flush() to the top the function worked!
    I also found this change log written by you.


    It says output buffering is now disabled and we'll get output in real time.
    I do use the latest version. Is there a setting I'm missing?



  • HarroHarro
    Accepted Answer
    Ok, so although Fuel doesn't enable output buffering in CLI mode, something else does.

    I'd classify that as a bug, perhaps we should explicitly disable it instead of just not enable it. Could you create an issue for this at https://github.com/fuel/core/issues ?
  • I confirmed that the issue is fixed in 1.8/develop. 

    What about 1.7?
    I do use 1.7 but I wonder if the version I have is slightly dated.
  • HarroHarro
    Accepted Answer
    There's a 1.7.3 release in  the making (which will be the current 1.8/develop code).

    Since there is no active development in v1 anymore, in general 1.8/develop is the most stable version, as it contains all bugfixes.

Howdy, Stranger!

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

In this Discussion