Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Database type not defined in configuration
  • I just downloaded the latest core files from the Develop branch (1.0-138), and on a project that was working with v1.0 I'm getting an error: Fuel\Core\Fuel_Exception [ Error ]: Database type not defined in configuration Here's the trace: COREPATH/classes/database/connection.php @ line 64
    59        $config = \Config::get("db.{$name}");
    60            }
    62            if ( ! isset($config['type']))
    63            {
    64                throw new \Fuel_Exception("Database type not defined in {$name} configuration");
    65            }
    67            // Set the driver class name
    68            $driver = 'Fuel\\Core\\Database_'.ucfirst($config['type']).'_Connection';

    I believe the difference between version 1.0 and 138 is occurring in core/classes/config.php in the function get(). At line 144, the v1.0 code would see that static::$items[$parts[0]]$parts[1]] was set and return that value. In the -138 code, that value is null.
     public static function get($item, $default = null)
      if (isset(static::$items[$item]))
       return static::$items[$item];
      if (strpos($item, '.') !== false)
       $parts = explode('.', $item);
       switch (count($parts))
        case 2:
         if (isset(static::$items[$parts[0]][$parts[1]]))    // Line 144
          return static::$items[$parts[0]][$parts[1]];  

    Can anyone shed some light on what might have changed? Perhaps I missed a change in how to configure the database between v1.0 and the new develop branch. Thanks,

Howdy, Stranger!

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