简体   繁体   English

PostgreSql的CodeIgniter2 + Sparks + Php-ActiveRecord问题

[英]CodeIgniter2 + Sparks + Php-ActiveRecord troubles with PostgreSql

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/ 我使用的是CodeIgniter2 + Sparks + PhpActiveRecord,我按照此教程进行了安装: http ://heybigname.com/2011/07/28/codeigniter-2-sparks-php-activerecord-part-1-installation/

with MySql works perfectly, but with PostgreSql doesn't works. 使用MySql可以完美地工作,但是使用PostgreSql则不能工作。

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". 其中,在Php-ActiveRecord文件夹中搜索“ Postgre”适配器,但此处称为“ Pgsql”,在CodeIgniter中进行配置时,必须使用“ Postgre”。

How can pass the real driver, for Php-Activerecord, works? 对于Php-Activerecord,如何传递真正的驱动程序?

grettings. grettings。

There are some minor errors to make codeigniter + PHP-ActiveRecord work with PostgreSQL. 使Codeigniter + PHP-ActiveRecord与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/ http://www.fernandovalente.com.br/wordpress/2012/10/12/codeigniter2-sparks-php-activerecord-com-postgresql/

The adapter for PostgreSQL isn't finished yet, so PHP ActiveRecord probably won't work with it. PostgreSQL的适配器尚未完成,因此PHP ActiveRecord可能无法使用它。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM