2009年5月26日星期二

[fw-db] Zend_Db_Table_Abstract strange behaviour under Windows

Dear All,

I make an logger module based on Zend_Log. This module has an
automatically delete function when the old log entry to be deleted.
This code (below) is the automatic delete. Under Linux (Gentoo Linux,
PostgreSQL 8.3) is working fine but under Windows XP (wampserver and
8.3 PostgreSQL) doesn't work. I got an exception.

Has anybody idea why?

I tryed to find what is the problem. I think the "->quoteInto()" part
is the cause.

Appreciate your help!

András

code:
$date = new Zend_Date();
$date->sub(
$this->logConfig->log_available_time,Zend_Date::DAY);
Zend_Db_Table_Abstract::setDefaultAdapter($this->makeDbLink());
//class to Messages table
$messagesTable = new SayCMS_Modules_Log_Table_Messages();
$where = $messagesTable->getAdapter()->quoteInto(
'timestamp < ?', $date->toString());
$messagesTable->delete($where);

Exception:
exception 'Zend_Db_Adapter_Exception' with message 'The pgsql driver
is not currently installed' in
F:\PRIVAT\PROJECTS\saycms_on_php\lib\Zend\Db\Adapter\Pdo\Abstract.php:116
Stack trace: #0
F:\PRIVAT\PROJECTS\saycms_on_php\lib\Zend\Db\Adapter\Abstract.php(767):
Zend_Db_Adapter_Pdo_Abstract->_connect() #1
F:\PRIVAT\PROJECTS\saycms_on_php\lib\Zend\Db\Adapter\Abstract.php(837):
Zend_Db_Adapter_Abstract->quote('2009.05.25. 8:5...', NULL) #2
F:\PRIVAT\PROJECTS\saycms_on_php\htdocs\SayCMS\Modules\Log\Log.php(90):
Zend_Db_Adapter_Abstract->quoteInto('timestamp < ?', '2009.05.25.
8:5...') #3 F:\PRIVAT\PROJECTS\saycms_on_php\htdocs\SayCMS\Modules\Log\Log.php(41):
SayCMS_Modules_Log_Log->cleanOldLogEntrys() #4
F:\PRIVAT\PROJECTS\saycms_on_php\htdocs\SayCMS\Modules\Core\Core.php(67):
SayCMS_Modules_Log_Log->__construct() #5
F:\PRIVAT\PROJECTS\saycms_on_php\htdocs\index.php(28):
SayCMS_Modules_Core_Core->__construct() #6 {main}

--
- -
-- Csanyi Andras -- http://sayusi.hu -- Sayusi Ando
-- "Bízzál Istenben és tartsd szárazon a puskaport!".-- Cromwell

没有评论: