Search code examples
codeignitercomposer-phpphpactiverecord

Codeigniter - Sparks to composer, activerecord issues now


So I have just gone through a update going from CI 2.0.4 to 3.1.4 and ran into the issue with Sparks now being redundant I've had to move onto composer to get php active record working..

however I have had autoloading issues/ Solved by including the model directly into the controller ie: require_once(APPPATH.'models/User.php');

But now im getting the following error..

An uncaught Exception was encountered

Type: ActiveRecord\DatabaseException

Message: Empty connection string

Filename: /var/www/html/vendor/php-activerecord/php-activerecord/lib/Connection.php

Line Number: 105

btw to load the composer autoload I've put: config['composer_autoload'] = '../vendor/autoload.php'; as the vendor directory sits outside the application folder in its parents folder.

Any help would be greatly appreciated..


Solution

  • You can move the vendor directory to your public_html/www and try

    config['composer_autoload'] = FCPATH.'vendor/autoload.php';