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

[eluser]tomexsans[/eluser]
Hello newbie here, just asking if the PHP-ActiveRecord can still be integrated with codeigniter 2.1.3 without tweaking the core code i.e the core loader, i have a version 2.0.3 using php-ActiveRecord , when i upgraded it, all hell broke loose, so i search and found out that their were changes to codeigniter that 'broke' or alter php-activerecord,

here are some of the links i read

http://ellislab.com/forums/viewthread/199778/
http://ellislab.com/forums/viewthread/195777/P10/
http://ellislab.com/forums/viewthread/198107/\

But this is so 2009. thanks is this fixed already.
#2

[eluser]tomexsans[/eluser]
Anyway i found a loader from this site

http://getsparks.org/static/install/MY_Loader.php.txt

hope this will help, will post Results
#3

[eluser]tomexsans[/eluser]
BUMP,

still no ansewers ?? :'(
#4

[eluser]TWP Marketing[/eluser]
I assume that you already know that CI 2.1.3 supports, natively, a (modified) version of PHP's Active Record class.
The user guide http://ellislab.com/codeigniter/user-gui...ecord.html has a good explanation of CI's version of Active Record.

I have NOT tried to add separate libraries for Active Record. I find that the modified version included in the framework does everything I need. I can't advise you on how to edit your library to work with CI 2.1.3, but I would advise trying the built-in Active Record, rather than attempt to integrate an outside library.
#5

[eluser]Aken[/eluser]
[quote author="TWP Marketing" date="1352844383"]I assume that you already know that CI 2.1.3 supports, natively, a (modified) version of PHP's Active Record class.[/quote]
CI's active record query builder is completely different from PHP ActiveRecord, which is an ORM.
#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.
#7

[eluser]Unknown[/eluser]
[quote author="tomexsans" date="1352789922"]Hello newbie here, just asking if the PHP-ActiveRecord can still be integrated with codeigniter 2.1.3 without tweaking the core code i.e the core loader, i have a version 2.0.3 using php-ActiveRecord , when i upgraded it, all hell broke loose, so i search and found out that their were changes to codeigniter that 'broke' or alter php-activerecord,

here are some of the links i read

http://ellislab.com/forums/viewthread/199778/
http://ellislab.com/forums/viewthread/195777/P10/
http://ellislab.com/forums/viewthread/198107/\

But this is so 2009. thanks is this fixed already.[/quote]
#8

[eluser]tomexsans[/eluser]
[quote author="TWP Marketing" date="1352844383"]I assume that you already know that CI 2.1.3 supports, natively, a (modified) version of PHP's Active Record class.
The user guide http://ellislab.com/codeigniter/user-gui...ecord.html has a good explanation of CI's version of Active Record.

I have NOT tried to add separate libraries for Active Record. I find that the modified version included in the framework does everything I need. I can't advise you on how to edit your library to work with CI 2.1.3, but I would advise trying the built-in Active Record, rather than attempt to integrate an outside library.[/quote]


Sorry built in Active record is not ORM I'm looking forward to use PHP-ActiveRecord or the Doctrine ORM
#9

[eluser]tomexsans[/eluser]
[quote author="yoast" date="1353499451"]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.[/quote]



Thank you, this is the nearest answer so far, i tried the loader on my link on second post and it worked just wating to stumble on any bugs




Theme © iAndrew 2016 - Forum software by © MyBB