errorController

Ciao Gianni,

passando un url del tipo :

sito.com/aaaa/ajakia

dovrebbe renindirizzarmi a -> ErrorController -> ErrorAction , vero?

come mai se provo mi da questo :

Fatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller specified (aaaa)' in F:\Programmi\Apache Software Foundation\Apache2.2\Common\libs\Zend\Controller\Dispatcher\Standard.php:193 Stack trace: #0 F:\Programmi\Apache Software Foundation\Apache2.2\Common\libs\Zend\Controller\Front.php(911): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #1 F:\Programmi\Apache Software Foundation\Apache2.2\htdocs\incomingsalento\index.php(78): Zend_Controller_Front->dispatch() #2 {main} thrown in F:\Programmi\Apache Software Foundation\Apache2.2\Common\libs\Zend\Controller\Dispatcher\Standard.php on line 193

???

:bye:

inviato 10 anni fa
Andrea Turso
Andrea Turso
96
X 0 X

riporta tutto il codice del file di bootstrap

risposto 10 anni fa
Gianni Tomasicchio
X 0 X
<?php
/*
 * Bootstrap File 
 * Salento Incoming Service
 */
define('SITE_NAME', 'main');
define('ROOT', 'F:/Programmi/Apache Software Foundation/Apache2.2/Common/');
//define('ROOT', '/home/trash/Common/');
define('BASE_URL', str_replace('index.php', '', $_SERVER['PHP_SELF']));
define('APP_DIR', ROOT . 'apps/sis_' . SITE_NAME . '/');
define('LIB_DIR', ROOT . 'libs/');
define('CONFIG_DIR', ROOT . 'configs/sis_' . SITE_NAME . '/xml/');
define('PLUGIN_DIR', APP_DIR . 'plugins/');
define('LANG_DIR', APP_DIR . 'languages/');
define('VIEW_DIR', APP_DIR . 'default/views/');
define('CONTROLLER_DIR', APP_DIR . 'default/controllers/');
set_include_path(ROOT . '/libs' . PATH_SEPARATOR . ROOT . 'apps/sis_' . SITE_NAME . PATH_SEPARATOR . ROOT .
    'apps/sis_' . SITE_NAME . '/default/models' . PATH_SEPARATOR . VIEW_DIR . PATH_SEPARATOR . get_include_path());

/*
 * Sis_Auth_Plugin
 * authorization plugin
 */
require_once PLUGIN_DIR . 'Auth.php';

/*
 * Sis_Acl
 * Zend_Acl extensions
 */
require_once PLUGIN_DIR . 'Acl.php';

/*
 * Escape_Tags
 * escape not allowed tags
 */
require_once PLUGIN_DIR . 'Escape.php';

/*
 * Zend_Loader 
 * Loads automatically all called classes
 */
require_once 'Zend/Loader.php';
Zend_Loader::registerAutoload();
try {
   $config = new Zend_Config_Xml(CONFIG_DIR . 'config.xml', 'main');
   $options = array(
            'host'     => $config->database->host,
            'username' => $config->database->username,
            'password' => $config->database->password,
            'dbname'   => $config->database->name
            );

   $db = Zend_Db::factory($config->database->type, $options);
   $db->getConnection();   
} catch (Zend_Congig_Xml_Exception $e) {
   die("<strong>Zend_Congig_Xml_Exception : </strong>" . $e->getMessage());
} catch (Zend_Db_Adapter_Exception $e) {
   die("<strong>Zend_Db_Adapter_Exception : </strong>" . $e->getMessage());
} catch (Zend_Exception $e) {
   die("<strong>Zend_Exception : </strong>" . $e->getMessage());
}

try {
   $lang = new Zend_Translate('gettext', LANG_DIR . '/it/it.mo', 'it');
   $auth = Zend_Auth::getInstance();
   $myAcl = new Sis_Acl($auth, $db);

   Zend_Registry::set('db', $db);
   Zend_Registry::set('lang', $lang);

   $controller = Zend_Controller_Front::getInstance();
   $controller ->setControllerDirectory(CONTROLLER_DIR)
              ->setRouter(new Zend_Controller_Router_Rewrite)
            ->registerPlugin(new Sis_Auth_Plugin($auth, $myAcl))
            ->setParam('acl', $myAcl)
            ->setParam('auth', $auth)
            ->setParam('noViewRenderer', false)
            ->dispatch();
                     
} catch (Zend_Controller_Front_Exception $e) {
   die("<strong>Zend_Controller_Front_Exception :</strong> " . $e->getMessage());
} catch (Zend_View_Exception $e) {
   die("<strong>Zend_View_Exception :</strong> " . $e->getMessage());
}
risposto 10 anni fa
Andrea Turso
Andrea Turso
96
X 0 X

prova a togliere il try-catch finale

 :bye:

risposto 10 anni fa
Gianni Tomasicchio
X 0 X
Effettua l'accesso o registrati per rispondere a questa domanda