当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Controller_Front::throwExceptions方法代码示例

本文整理汇总了PHP中Zend_Controller_Front::throwExceptions方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Controller_Front::throwExceptions方法的具体用法?PHP Zend_Controller_Front::throwExceptions怎么用?PHP Zend_Controller_Front::throwExceptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Controller_Front的用法示例。


在下文中一共展示了Zend_Controller_Front::throwExceptions方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _initErrorReporting

 private function _initErrorReporting()
 {
     Zend_SetupInit::initErrorReporting();
     // set the test environment parameters
     if (('local' | 'development') === Zend_SetupInit::$_env) {
         $this->_front->throwExceptions(true);
     }
 }
开发者ID:baphled,项目名称:boodah,代码行数:8,代码来源:Initializer.php

示例2: _initPlugins

 /**
  * init plugins
  * @return void
  */
 protected function _initPlugins()
 {
     # only embed the debugging plugin if application status is development or testing
     if ($this->applicationStatus == "development") {
         # embed the ZFDebug Plugin/console
         $debug = new ZFDebug_Controller_Plugin_Debug(array('jquery_path' => '', 'plugins' => array('Variables', 'File' => array('basePath' => APPLICATION_PATH), 'Memory', 'Time', 'Html', 'Exception')));
         $this->frontController->registerPlugin($debug);
     }
     # init error handler
     $this->frontController->throwExceptions(false);
     $errorhandler = new Zend_Controller_Plugin_ErrorHandler();
     $errorhandler->setErrorHandler(array('module' => 'cms', 'controller' => 'error', 'action' => 'error'));
     $this->frontController->registerPlugin($errorhandler);
     # gadget plugin
     $gadgetPlugin = new FansubCMS_Controller_Plugin_Gadget();
     $this->frontController->registerPlugin($gadgetPlugin);
     # not-logged-in-so-go-to-login plugin
     $aclPlugin = new FansubCMS_Controller_Plugin_Acl(Zend_Auth::getInstance()->setStorage(new FansubCMS_Auth_Storage_DoctrineSession()));
     $this->frontController->registerPlugin($aclPlugin);
     # check if install or update is needed
     $installPlugin = new FansubCMS_Controller_Plugin_InstallCheck();
     $this->frontController->registerPlugin($installPlugin);
     # the navigation plugin
     $navPlugin = new FansubCMS_Controller_Plugin_Navigation();
     $this->frontController->registerPlugin($navPlugin);
 }
开发者ID:KasaiDot,项目名称:FansubCMS,代码行数:30,代码来源:Bootstrap.php

示例3: setDebugMode

 /**
  * Show debug info (to supress in prod)
  */
 public function setDebugMode()
 {
     if ($this->config->general->env != 'PROD') {
         if ($this->config->general->env != 'CMD' && is_object($this->frontController)) {
             $this->frontController->throwExceptions(true);
         }
         $this->debug = true;
     }
 }
开发者ID:Cryde,项目名称:sydney-core,代码行数:12,代码来源:Bootstrapper.php

示例4: __construct

 /**
  * Constructor
  *
  * Initialize environment, root path, and configuration.
  * 
  * @param  string $env 
  * @param  string|null $root 
  * @return void
  */
 public function __construct($env, $root = null)
 {
     $this->_setEnv($env);
     if (null === $root) {
         $root = realpath(dirname(__FILE__) . '/../');
     }
     $this->_root = $root;
     $this->initPhpConfig();
     $this->_front = Zend_Controller_Front::getInstance();
     // set the test environment parameters
     if ($env == 'test') {
         // Enable all errors so we'll know when something goes wrong.
         error_reporting(E_ALL | E_STRICT);
         ini_set('display_startup_errors', 1);
         ini_set('display_errors', 1);
         $this->_front->throwExceptions(true);
     }
 }
开发者ID:stm555,项目名称:proof-of-concepts,代码行数:27,代码来源:Initializer.php

示例5: _route

 /**
  * Same route function in Zend_Controller_Front::dispatch().
  * It updates the request with routes and sends a message to
  * Zend_Controller_Front. This is processed in dispatch().
  * 
  * @param Zend_Controller_Request_Abstract $request
  */
 private function _route(Zend_Controller_Request_Abstract $request)
 {
     try {
         $this->_router->route($request);
     } catch (Exception $e) {
         if ($this->_front->throwExceptions()) {
             throw $e;
         }
     }
 }
开发者ID:riteshsahu1981,项目名称:Weadvance,代码行数:17,代码来源:App.php

示例6: __construct

 /**
  * Constructor
  *
  * Initialize environment, root path, and configuration.
  *
  * @param  string $env
  * @param  string|null $root
  * @return void
  */
 public function __construct($env, $root = null)
 {
     $this->_setEnv($env);
     if (null === $root) {
         $root = realpath(dirname(__FILE__) . '/../');
     }
     $this->_root = $root;
     $this->initPhpConfig();
     $this->_front = Zend_Controller_Front::getInstance();
     date_default_timezone_set('UTC');
     // set the test environment parameters
     if (true || $env == 'test') {
         // Enable all errors so we'll know when something goes wrong.
         error_reporting(E_ALL | E_STRICT);
         ini_set('display_startup_errors', 1);
         ini_set('display_errors', 1);
         $this->_front->throwExceptions(true);
     }
     $configFile = dirname(__FILE__) . '/config.xml';
     require_once 'Zend/Config/Xml.php';
     self::$_config = new Zend_Config_Xml($configFile, $this->_env);
     require_once 'Zend/Registry.php';
     Zend_Registry::set('Config', self::$_config);
 }
开发者ID:ajbrown,项目名称:bitnotion,代码行数:33,代码来源:Initializer.php

示例7: init

 /**
  * Initialises the application
  *
  */
 public function init()
 {
     $__start = getmicrotime();
     if (isset($this->config['log_file'])) {
         $writer = new Zend_Log_Writer_Stream($this->config['log_file']);
         $this->logger = new Zend_Log($writer);
         if (isset($this->config['log_format'])) {
             $formatter = new Zend_Log_Formatter_Simple($this->config['log_format']);
             $writer->setFormatter($formatter);
         }
         // If not in debug mode, hide debug log messages
         if (!ifset($this->config, 'debug', false)) {
             $this->logger->addFilter(Zend_Log::NOTICE);
         }
     }
     $this->recordStat('za::initlog', getmicrotime() - $__start);
     $__start = getmicrotime();
     $mailServer = $this->getConfig('smtp_server');
     if (mb_strlen($mailServer)) {
         ini_set('SMTP', $mailServer);
     }
     // Create a new view object.
     $view = new CompositeView();
     Zend_Registry::set(self::$ZEND_VIEW, $view);
     /* @var Zend_Controller_Front $controller */
     $this->frontController = Zend_Controller_Front::getInstance();
     $this->frontController->setDispatcher(new InjectingDispatcher());
     $this->frontController->addControllerDirectory($this->getConfig('controller_dir', 'controllers'), 'default');
     $modules = ifset($this->config, 'modules', array());
     foreach ($modules as $module) {
         if (is_dir(APP_DIR . '/modules/' . $module)) {
             $this->frontController->addControllerDirectory('modules/' . $module, $module);
         }
     }
     $this->recordStat('za::initmodules', getmicrotime() - $__start);
     $__start = getmicrotime();
     $this->frontController->throwExceptions(ifset($this->config, 'debug', false) ? true : false);
     if (isset($this->config['route_config']) && php_sapi_name() != 'cli') {
         $router = $this->frontController->getRouter();
         /* @var $router Zend_Controller_Router_Rewrite */
         $config = new Zend_Config_Ini($this->config['route_config'], 'routes');
         $router->addConfig($config, 'routes');
     }
     Zend_Controller_Action_HelperBroker::removeHelper('viewRenderer');
     $this->frontController->setParam('noViewRenderer', true);
     /**
      * Set the session
      */
     $session_name = str_replace(' ', '_', $this->config['name']);
     Zend_Session::start(array('name' => $session_name));
     $this->injector->addAutoProperty('log', $this->logger);
     $__start = getmicrotime();
     // $services = $this->loadDefaultServices();
     $this->injector->addServiceDirectory(NOVEMBER_APP_DIR . '/services');
     // $this->injector->loadServices($this->config['services']);
     $this->recordStat('za::initdefaultservices', getmicrotime() - $__start);
     $__start = getmicrotime();
     //
     //        foreach ($services as $defaultService) {
     //            $this->injector->inject($defaultService);
     //        }
     //
     $this->recordStat('za::initinjectdefaultservices', getmicrotime() - $__start);
     $__start = getmicrotime();
     // Load extensions
     $this->loadExtensions();
     $this->injector->addServiceDirectory(ifset($this->config, 'services_dir', APP_DIR . '/services'));
     $this->recordStat('za::initloadext', getmicrotime() - $__start);
     $__start = getmicrotime();
     $this->injector->loadServices($this->config['services']);
     $this->recordStat('za::initloadservices', getmicrotime() - $__start);
     $__start = getmicrotime();
     // We know that there's definitely going to be an AuthService,
     // so we can now go and load the user if there was one in
     // the session.
     $auth = $this->injector->getService('AuthService');
     if (isset($this->getSession()->CURRENT_USER_TICKET) && mb_strlen($this->getSession()->CURRENT_USER_TICKET)) {
         $auth->validateTicket($this->getSession()->CURRENT_USER_NAME, $this->getSession()->CURRENT_USER_TICKET);
     }
     $this->recordStat('za::initvalidateauth', getmicrotime() - $__start);
 }
开发者ID:nyeholt,项目名称:relapse,代码行数:85,代码来源:NovemberApplication.php

示例8: setBootstrap

 public function setBootstrap($bootstrap)
 {
     $this->bootstrap = $bootstrap;
     $this->front = $this->bootstrap->getBootstrap()->getResource('frontcontroller');
     $this->front->throwExceptions(true)->returnResponse(false);
 }
开发者ID:kansey,项目名称:yii2albom,代码行数:6,代码来源:ZF1.php

示例9: setBootstrap

 public function setBootstrap($bootstrap)
 {
     $this->bootstrap = $bootstrap;
     $this->front = $this->bootstrap->getBootstrap()->getContainer()->frontcontroller;
     $this->front->throwExceptions(false)->returnResponse(false);
 }
开发者ID:itillawarra,项目名称:cmfive,代码行数:6,代码来源:SocialEngine.php


注:本文中的Zend_Controller_Front::throwExceptions方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。