Welcome Guest, Not a member yet? Register   Sign In
PHP-ActiveRecord in Codeigniter 2.1.3
#6

[eluser]yoast[/eluser]
I found this post to be of help.

http://machuga.tumblr.com/post/457127865...-0-reactor

Unfortunately, it is a little outdated at the moment. The class autoloader does not work anymore, as multiple classes are merged in a single file. I therefore had to add the following rules to the beginning of the function activerecord_lib_autoload in the ActiveRecord.php file:

Code:
$replace = array(
  "ActiveRecord\RecordNotFound"             =>"ActiveRecord\Exceptions",
  "ActiveRecord\DatabaseException"          =>"ActiveRecord\Exceptions",
  "ActiveRecord\UndefinedPropertyException" =>"ActiveRecord\Exceptions",
);
if (isset($replace[$class_name])) $class_name = $replace[$class_name];

It probably could be handled more elegantly, but this did the trick for me.


Messages In This Thread
PHP-ActiveRecord in Codeigniter 2.1.3 - by El Forum - 11-12-2012, 11:58 PM
PHP-ActiveRecord in Codeigniter 2.1.3 - by El Forum - 11-13-2012, 12:25 AM
PHP-ActiveRecord in Codeigniter 2.1.3 - by El Forum - 11-13-2012, 06:23 AM
PHP-ActiveRecord in Codeigniter 2.1.3 - by El Forum - 11-13-2012, 03:06 PM
PHP-ActiveRecord in Codeigniter 2.1.3 - by El Forum - 11-13-2012, 08:43 PM
PHP-ActiveRecord in Codeigniter 2.1.3 - by El Forum - 11-21-2012, 05:04 AM
PHP-ActiveRecord in Codeigniter 2.1.3 - by El Forum - 11-21-2012, 05:16 AM
PHP-ActiveRecord in Codeigniter 2.1.3 - by El Forum - 11-28-2012, 10:46 AM
PHP-ActiveRecord in Codeigniter 2.1.3 - by El Forum - 11-28-2012, 10:48 AM



Theme © iAndrew 2016 - Forum software by © MyBB