Hi everyone

I am trying to write command-line accessible scripts that have access to my
Zend Framework model classes.
Some of these model classes make database calls. The end goal is to invoke a
CRON job, which will record user data at regular intervals

I have followed the advice present in many other posts:

1. Created a minimal bootstrap (cli2.php)
2. Got the include path correct
3. Call the model class after the bootstrap code, in the same file
4. Invoke, at the command line, php cli2.php

I have been stuck at the stage where the model class needs to fetch rows
from the database, and I get the following error message:
Fatal error: Uncaught exception 'Zend_Db_Adapter_Exception' with message
'The mysql driver is not currently installed' in
/Users/ak/Zend/workspaces/DefaultWorkspace/testingProject/library/Zend/Db/Adapte
r/Pdo/Abstract.php:116
Stack trace:
#0
/Users/ak/Zend/workspaces/DefaultWorkspace/testingProject/library/Zend/Db/Adapter/Abstract.php(417):
Zend_Db_Adapter_Pdo_Abstract->_connect()
#1
/Users/ak/Zend/workspaces/DefaultWorkspace/testingProject/library/Zend/Db/Adapter/Pdo/Abstract.php(230):
Zend_Db_Adapter_Abstract->query('SELECT * ?     ...', Array)
#2
/Users/ak/Zend/workspaces/DefaultWorkspace/testingProject/library/Zend/Db/Adapter/Abstract.php(663):
Zend_Db_Adapter_Pdo_Abstract->query('SELECT * ?     ...', Array)
#3
/Users/ak/Zend/workspaces/DefaultWorkspace/testingProject/application/default/models/User.php(57):
Zend_Db_Adapter_Abstract->fetchRow('SELECT * ?     ...', Array)
#4
/Users/ak/Zend/workspaces/DefaultWorkspace/testingProject/application/cli2.php(64):
User->load()
#5 {main}
  thrown in
/Users/ak/Zend/workspaces/DefaultWorkspace/testingProject/library/Zend/Db/Adapter/Pdo/Abstract.php
on line 116

Now, instantiating the User object and calling its load method work from the
Framework web front end. Can anybody please tell me what I'm doing wrong, in
that it believes the PDO_MySql driver isn't load
ed?
  
I have also considered using wget against an obscure controller/action path,
but I feel that this isn't acceptable for security reasons (as the
originating address can be spoofed). I would like a simple script that can
be invoked directly from php.

Any help would be highly appreciated

Thanks!
-- 
View this message in context: 
http://www.nabble.com/Accessing-Zend-Framework-from-the-Command-Line-tp22210030p22210030.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to