My app is working from the web side of things.
I'd like to get the CLI working so that I can run unit tests and the such
Here's what I have for a test script:
$pthRoot = dirname(__FILE__);
define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/..'));
define('APPLICATION_ENV', 'development');
define('SERVER_ROLE', 'development');
set_include_path(implode(PATH_SEPARATOR, array(
realpath(APPLICATION_PATH . '/../library') . PATH_SEPARATOR . realpath($pthRoot . '/../controllers')
. PATH_SEPARATOR . get_include_path()
)));
date_default_timezone_set('America/Toronto');
require_once('Zend/Loader/Autoloader.php');
$autoloader = Zend_Loader_Autoloader::getInstance();
require '../bootstrap.php';
require_once 'Zend/Application.php';
$application = new Zend_Application(
APPLICATION_ENV,
APPLICATION_PATH . '/configs/application.ini'
);
$_SERVER['SERVER_ROLE'] = 'development';
$bootstrap = $application->getBootstrap();
$bootstrap->runScript();
$db = Zend_Registry::get('db');
$sql = "select * from settings";
print_r($db->fetchAll($sql));
Unfortunately, I get an error at the get('db') line.
PHP Fatal error: Uncaught exception 'Zend_Db_Adapter_Exception' with message 'The mysql driver is not currently installed'
According to phpinfo from the command line, the mysql driver is running. What am I missing?
Thanks in advance.