EllisLab text mark
Advanced Search
     
PHP-ActiveRecord in Codeigniter 2.1.3
Posted: 13 November 2012 02:58 AM   [ Ignore ]
Joined: 2012-11-08
6 posts

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.

tomexsans
Summer Student

2012-11-13 (0 votes) by tomexsans

Anyway i found a loader from this site

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

hope this will help, will post Results

 
Posted: 13 November 2012 03:25 AM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Joined: 2012-11-08
6 posts

Anyway i found a loader from this site

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

hope this will help, will post Results

 
Posted: 13 November 2012 09:23 AM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Joined: 2012-11-08
6 posts

BUMP,

still no ansewers ?? :’(

 
Posted: 13 November 2012 06:06 PM   [ Ignore ]   [ # 3 ]   [ Rating: 0 ]
Joined: 2008-12-19
612 posts

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-guide/database/active_record.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.

 Signature 

CI 2.1.3, Linux, LAMP. We also like Gold and Silver…
Blame the hammer, it is obviously the guilty party…
User Guide? Nobody told me there was a User Guide!

 
Posted: 13 November 2012 11:43 PM   [ Ignore ]   [ # 4 ]   [ Rating: 0 ]
Avatar
Joined: 2007-11-28
2435 posts
TWP Marketing - 13 November 2012 06:06 PM

I assume that you already know that CI 2.1.3 supports, natively, a (modified) version of PHP’s Active Record class.

CI’s active record query builder is completely different from PHP ActiveRecord, which is an ORM.

 
Posted: 21 November 2012 08:04 AM   [ Ignore ]   [ # 5 ]   [ Rating: 1 ]
Joined: 2011-01-31
17 posts

I found this post to be of help.

http://machuga.tumblr.com/post/4571278653/revised-php-activerecord-codeigniter-2-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:

$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.

 
Posted: 21 November 2012 08:16 AM   [ Ignore ]   [ # 6 ]   [ Rating: 0 ]
Joined: 2012-11-21
1 posts

tomexsans - 13 November 2012 02:58 AM

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.

 
Posted: 28 November 2012 01:46 PM   [ Ignore ]   [ # 7 ]   [ Rating: 0 ]
Joined: 2012-11-08
6 posts
TWP Marketing - 13 November 2012 06:06 PM

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-guide/database/active_record.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.


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

 
Posted: 28 November 2012 01:48 PM   [ Ignore ]   [ # 8 ]   [ Rating: 0 ]
Joined: 2012-11-08
6 posts
yoast - 21 November 2012 08:04 AM

I found this post to be of help.

http://machuga.tumblr.com/post/4571278653/revised-php-activerecord-codeigniter-2-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:

$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.

 

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