Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Asset::find_file in a command line php oil
  • Hello,

    In a script, I test if a file exists with Asset::find_file.
    All is OK in my browser, but when this script is called in a command line with php oil, it returns always false, even when it should not.

    in the command line : 
    env FUEL_ENV=coc_development php oil r myclass:mymethod

    Could you help me ?
  • Asset by default looks for files relative to the DOCROOT constant, which is different for web requests and oil. If you need them to be the same, you need to change it in the oil script.
  • OK great. But I don't find where can i do that ?
  • HarroHarro
    Accepted Answer
    in the oil script: https://github.com/fuel/fuel/blob/1.8/master/oil#L30

    You probably need to add

        "public".DIRECTORY_SEPARATOR

    to it, assuming you have a standard setup with your index.php in ./public.

    See also http://fuelphp.com/docs/general/constants.html for a definition.
  • OK thanks !

Howdy, Stranger!

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

In this Discussion