Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Fuel 1.3 find_file bug
  • After upgrading to Fuel 1.3, I found out that my theme's info.php was returning duplicate values when being read by Fuel. I traced the problem back to config/file.php's find_file(). By readding the following code from 1.2.1 after line 123, I got it fixed: // absolute path requested?
    if ($this->file[0] === '/' or (isset($this->file[1]) and $this->file[1] === ':'))
    {
    // don't search further, load only the requested file
    return $paths;
    } Does anyone have a better solution or is this a legit bug? Thanks!
  • Can you be more specific? What did you expect to happen? What exactly happens? Where do the duplicate values come from? Do you have multiple 'info.php' files in your search path that get merged by the Config class?
  • You can recreate this by creating a theme: 1. Add theme.php to APPPATH/config folder with the following configuration
    <?php
    return array(
    'active' => 'app',
    'fallback' => 'app',
    'paths' => array(
    APPPATH.'themes',
    ),
    'view_ext' => '.php',
    'info_file_name' => 'info.php',
    'require_info_file' => true,
    'info_file_type' => 'php',
    'info_file_type' => 'php',
    ); 2. create APPPATH/themes/app/info.php with the following:
    <?php
    return array(
    'styles' => array(
    'style.css',
    'responsive.css',
    ),
    'scripts' => array(
    'plugins/bootstrap.min.js',
    ),
    ); 3. Insert this in the controller: $th = Theme::instance();
    echo '<pre>', print_r($th->get_info()), '</pre>'; which will print out the following: Array
    (
    [styles] => Array
    (
    [0] => style.css
    [1] => responsive.css
    [2] => style.css
    [3] => responsive.css
    ) [scripts] => Array
    (
    [0] => plugins/bootstrap.min.js
    [1] => plugins/bootstrap.min.js
    ) )
  • Found and fixed in 1.4/develop.
  • Awesome. Looking forward to the update. Thanks!
  • You can probably backport core/classes/config/file.php to your 1.3 install, I don't think there were any more changes in Config.

Howdy, Stranger!

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

In this Discussion