Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Configuration files with FuelPHP
  • Hi, everybody.

    We've got a problem using config files.
    With Kohana there was a mean to prioritize the call of config files : 
    - System config files had third priority
    - Modules config files had second priority
    - Apps files had first priority

    Is there a mean to do that with FuelPHP?
    Did somebody had the same issue or have somebody got any solution.

    Thank you.
  • The priority in FuelPHP is:
    - module config
    - app config
    - packages config
    - core config

    When you load a configuration file, it depends on your current context what is loaded. For example, module configs are only loaded if you are in a controller AND in a module context (i.e. you requested a module controller via the URI, or via an HMVC call).

    Configuration files are merged, so if all four locations have a config file with the same name, all four will be loaded, and merged in order of priority.

    As a Kohana module is more like a Fuel package, I'd say the order is the same.
  • It seems that we have a problem with Finder::search().
    In fact, this function all the time returns "null".
    It seems that Config::load() uses this function.

    Have you got an idea about what could be the problem?
  • No, not a clue. The Finder is in the core of the framework, it's used to locate all kinds of files, I;m pretty sure it's not a generic issue.

    What's your platform (OS, webserver), Which Fuel version? What works and what doesn't? What is the error you're getting?

    When you go on the commandline, and do "php oil -v", what happens?
  • I'm using Windows Seven with Wampserver (64 bits & PHP 5.4) 2.2E

    Apache 2.2.22 – Mysql 5.5.24 – PHP 5.4.3 XDebug  2.1.2  XDC 1.5  PhpMyadmin 3.4.10.1  SQLBuddy 1.3.3  webGrind 1.0

    The commandline you gave me doesn't work : Could not open input file: oil

    I'm using FuelPHP version 1.5. 

    Thank you.
  • How do you use it?

    The commandline shortcut ('oil') is a *nix script, that obviously doesn't work on Windows.

    So you'll have to go to the folder in which you have installed FuelPHP (the root of that installation in which you find the oil file), and start it with "php oil" (if php.exe is in your search path). You'll find this in the documentation.

    If php.exe is not in the path, you may have to put the full path in, like "C:\MAMP installation\bin\php.exe" or where-ever it is installed.
  • I went to "C:/wamp/bin/php/php5.4.3" and i did "php oil -v". 
    And i've got the error : Could not open input file: oil.


  • When using the oil file which is in System. I've got this error : 

    PHP Warning:  require(\bootstrap.php): failed to open stream: No such file or di
    rectory in C:\wamp\bin\php\php5.4.3\oil on line 52
    PHP Stack trace:
    PHP   1. {main}() C:\wamp\bin\php\php5.4.3\oil:0

    Warning: require(\bootstrap.php): failed to open stream: No such file or directo
    ry in C:\wamp\bin\php\php5.4.3\oil on line 52

    Call Stack:
        0.0187     235904   1. {main}() C:\wamp\bin\php\php5.4.3\oil:0

    PHP Fatal error:  require(): Failed opening required '\bootstrap.php' (include_p
    ath='.;C:\wamp\bin\php\php5.4.3\pear') in C:\wamp\bin\php\php5.4.3\oil on line 5
    2
    PHP Stack trace:
    PHP   1. {main}() C:\wamp\bin\php\php5.4.3\oil:0

    Fatal error: require(): Failed opening required '\bootstrap.php' (include_path='
    .;C:\wamp\bin\php\php5.4.3\pear') in C:\wamp\bin\php\php5.4.3\oil on line 52

    Call Stack:
        0.0187     235904   1. {main}() C:\wamp\bin\php\php5.4.3\oil:0
  • > I went to "C:/wamp/bin/php/php5.4.3" and i did "php oil -v". And i've got the error : Could not open input file: oil.

    Which is correct, the 'oil' file isn't there, it's in the root of your FuelPHP installation. So

    cd C:\whereever\your\files\are

    C:\wamp\bin\php\php5.4.3\php.exe oil -v

    Perhaps this can be of some assistance:

    http://thebizztech.com/2011/08/23/fuelphp-command-line-oil-with-windows-bat-file-help-and-xampp/
  • I found the solution. Oil is now working and Finder::search too. Thank you for your help.

    That was a problem about paths : APPPATH, COREPATH and PKGPATH. These ones were not well defined. I had to change them.
  • Which means you didn't use the standard installation?

    Note that these paths are also defined in your public/index.php, and in the phpunit files (in case you want to run unit tests).
  • I'm a trainee in the company. I don't really know if the company uses the standard installation. I just know that folders' hierarchy is not the same as defined in oil.php and public/index.php.

    I changed them and it works fine.
  • Ok, no problem. Just wanted to be complete in case someone else bumps into this thread.
  • I understand. 

Howdy, Stranger!

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

In this Discussion