When i put a try and catch block in my setupController function. I get this
error on my webpage:


Error parsing config/settings.ini on line 6 as well as 

Fatal error: Call to a member function dispatch() on a non-object in
/usr/local/lib/apps/Bootstrap.php on line 18

line 18 looks like this

$response = self::$front->dispatch();


public static function setupController()
    {
       try{
                // load the Zend Components
                Zend_Loader::registerAutoload();
                $date = new Zend_Date();

          // Output of the desired date
       echo $date->get();
                
                
                
                //add the setting declared in settings.ini
                $config = new Zend_Config_Ini('config/settings.ini', 
'development');
        Zend_Registry::set('config', $config);
                                
        //create an instance of the front controller 
                self::$front = Zend_Controller_Front::getInstance();
        self::$front->throwExceptions(true);
        self::$front->returnResponse(true);
            
                
                
                
                
                // Set the default controller directory:
                self::$front->setControllerDirectory(array('default' =>
$config->paths->data . '/controllers', 
                                                                                
                   'admin'   => $config->paths->data .
'/modules/admin/controllers'));         
                Zend_Layout::startMvc(array('layoutPath' => 
$config->paths->data .
'/views/layouts'));
                                                                        
                                
                // setup database connection variables
                $params = array(
                                'host'     => $config->database->hostname,
                                'username' => $config->database->username,
                                'password' => $config->database->password,
                                'dbname'   => $config->database->database);
                                
                $db = Zend_Db::factory($config->database->type, $params);
                Zend_Db_Table_Abstract::setDefaultAdapter($db);
                Zend_Registry::set('db', $db);
                
                
}
                catch(Exception $e) {
                 echo  $e->getMessage();
                
                }
                

                
    }

and settings.ini looks like this:

development]
>
> database.type          = pdo_mysql
> database.hostname   = mydomain.co.za
> database.username   = mydb007
> database.password   = mypass
> database.database   = mydb
>
> paths.data          = /usr/local/lib/apps
> paths.modules.admin = /usr/local/lib/apps/modules/admin 


is this a permission issue on Linux from my bootstrap file?




-----
dee
-- 
View this message in context: 
http://www.nabble.com/ZF-live-settings-tp20911516p20930232.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to