문제

I'm using CodeIgniter2 + Sparks + PhpActiveRecord, I installed following this tutorial : http://heybigname.com/2011/07/28/codeigniter-2-sparks-php-activerecord-part-1-installation/

with MySql works perfectly, but with PostgreSql doesn't works.

I get the next error:

Fatal error: Uncaught exception 'ActiveRecord\DatabaseException' with message 'ActiveRecord\PostgreAdapter not found!' in C:\xampp\htdocs\part1\sparks\php-activerecord\0.0.1\vendor\php-activerecord\lib\Connection.php:127 Stack trace: #0 C:\xampp\htdocs\part1\sparks\php-activerecord\0.0.1\vendor\php-activerecord\lib\Connection.php(98): ActiveRecord\Connection::load_adapter_class('postgre') #1 C:\xampp\htdocs\part1\sparks\php-activerecord\0.0.1\vendor\php-activerecord\lib\ConnectionManager.php(33): ActiveRecord\Connection::instance('postgre://postg...') #2 C:\xampp\htdocs\part1\sparks\php-activerecord\0.0.1\vendor\php-activerecord\lib\Table.php(103): ActiveRecord\ConnectionManager::get_connection(NULL) #3 C:\xampp\htdocs\part1\sparks\php-activerecord\0.0.1\vendor\php-activerecord\lib\Table.php(80): ActiveRecord\Table->reestablish_connection(false) #4 C:\xampp\htdocs\part1\sparks\php-activerecord\0.0.1\vendor\php-activerecord\lib\Table.php(61): ActiveRecord\Table->__construct('User') #5 C:\xampp\htdocs\part1\sparks\php-activ in C:\xampp\htdocs\part1\sparks\php-activerecord\0.0.1\vendor\php-activerecord\lib\Connection.php on line 127

where "Postgre" adapter is search in Php-ActiveRecord folder, but here is called "Pgsql", and when configure in CodeIgniter, must be use "Postgre".

How can pass the real driver, for Php-Activerecord, works?

grettings.

도움이 되었습니까?

해결책

The adapter for PostgreSQL isn't finished yet, so PHP ActiveRecord probably won't work with it.

http://www.phpactiverecord.org/docs/ActiveRecord/PgsqlAdapter

다른 팁

There are some minor errors to make codeigniter + PHP-ActiveRecord work with PostgreSQL. I created a post (in Portuguese) explaining what I did for everything to work properly. If this was the best solution I do not know, but it is working. Look at my post and give your opinion

http://www.fernandovalente.com.br/wordpress/2012/10/12/codeigniter2-sparks-php-activerecord-com-postgresql/

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top