Love Fuel?
Donate
About
Forums
Discussions
Login
FuelPHP Forums
Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
General
Asset::find_file in a command line php oil
remi
June 2016
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 ?
Harro
June 2016
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.
remi
June 2016
OK great. But I don't find where can i do that ?
Harro
June 2016
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.
remi
June 2016
OK thanks !
Add a Comment
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Apply for Membership
Categories
All Discussions
5,088
General
↳ General
3,364
↳ Job Board
13
↳ Installation & Setup
214
Packages
↳ Oil
213
↳ Orm
700
↳ Auth
260
Development
↳ Tips and Tutorials
126
↳ Code share
145
↳ Applications
52
In this Discussion
Harro
June 2016
remi
June 2016