Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
v1.4 can no longer extend and replace Database_PDO_Connection
  • After upgrading to FuelPHP 1.4, my Database_PDO_Connection can no longer extend the core's. It throws a 

    Fuel\Core\FuelException [ Error ]: Database method Fuel\Core\Database_PDO_Connection::....

    Which means that it is loading the core's Database_PDO_Connection. 

    In my package I have the following in my bootstrap.php:
    Autoloader::add_core_namespace('Carl');

    Autoloader::add_classes(array(
    'Carl\\Database_Pdo_Connection'        => __DIR__.'/classes/database/pdo/connection.php',
    'Carl\\Database_Connection'               => __DIR__.'/classes/database/connection.php',
    ));

    My Database_Pdo_Connection has a:

    namespace Carl;

    class Database_PDO_Connection extends \Fuel\Core\Database_PDO_Connection


    Again, this was working fine in 1.3. Also, when I try to rename the path to something else like __DIR__.'/this/is/an/invalid_path.php' I don't receive an ErrorException of No such file or directory. Other classes are loaded properly and extends and replaces the core's.
  • HarroHarro
    Accepted Answer
    Nothing has changed in that area between 1.3 and 1.4.

    You don't have a database call somewhere before you package is loaded? Because that would cause the core alias to already be in place.
  • Wow, this is very weird. Suddenly found my old apps to not work as well.

    Tried changing my sessions.php config to use cookies instead of the database and got it to work again. Is there another way for Database_PDO_Connection to work even with sessions using the database instead of cookies?
  • I don't have any issues with database connections here whatsoever.

    When did you install 1.4? And what is in your app/config/db.php? If it's empty, check core/config/db.php, the initial master repo had a bug in which the example mysql config would overwrite the PDO config. If so, remove the mysqli part.

    That will cause a connection failure, but is not related to a class extension issue.

Howdy, Stranger!

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

In this Discussion