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


PHP sfException::createFromException方法代码示例

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


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

示例1: dispatch

 /**
  * Dispatches a request.
  *
  * This will determine which module and action to use by request parameters specified by the user.
  */
 public function dispatch()
 {
     try {
         // reinitialize filters (needed for unit and functional tests)
         sfFilter::$filterCalled = array();
         // determine our module and action
         $request = $this->context->getRequest();
         $moduleName = $request->getParameter('module');
         $actionName = $request->getParameter('action');
         if (empty($moduleName) || empty($actionName)) {
             throw new sfError404Exception(sprintf('Empty module and/or action after parsing the URL "%s" (%s/%s).', $request->getPathInfo(), $moduleName, $actionName));
         }
         // make the first request
         $this->forward($moduleName, $actionName);
     } catch (sfError404Exception $e) {
         if (!sfConfig::get('sf_web_debug')) {
             $this->forward('dmFront', 'error404');
         } else {
             $e->printStackTrace();
         }
     } catch (sfException $e) {
         $e->printStackTrace();
     } catch (Exception $e) {
         sfException::createFromException($e)->printStackTrace();
     }
 }
开发者ID:theolymp,项目名称:diem,代码行数:31,代码来源:dmFrontWebController.php

示例2: dispatch

 /**
  * Dispatches a request.
  *
  * @param string $moduleName  A module name
  * @param string $actionName  An action name
  * @param array  $parameters  An associative array of parameters to be set
  */
 public function dispatch($moduleName, $actionName, $parameters = array())
 {
     try {
         // set parameters
         $this->context->getRequest()->getParameterHolder()->add($parameters);
         // make the first request
         $this->forward($moduleName, $actionName);
     } catch (sfException $e) {
         $e->printStackTrace();
     } catch (Exception $e) {
         sfException::createFromException($e)->printStackTrace();
     }
 }
开发者ID:WIZARDISHUNGRY,项目名称:symfony,代码行数:20,代码来源:sfConsoleController.class.php

示例3: initialize

 /**
  * Initializes the current sfContext instance.
  *
  * @param sfApplicationConfiguration $configuration  An sfApplicationConfiguration instance
  */
 public function initialize(sfApplicationConfiguration $configuration)
 {
     $this->configuration = $configuration;
     $this->dispatcher = $configuration->getEventDispatcher();
     try {
         $this->loadFactories();
     } catch (sfException $e) {
         $e->printStackTrace();
     } catch (Exception $e) {
         sfException::createFromException($e)->printStackTrace();
     }
     $this->dispatcher->connect('template.filter_parameters', array($this, 'filterTemplateParameters'));
     // register our shutdown function
     register_shutdown_function(array($this, 'shutdown'));
 }
开发者ID:WIZARDISHUNGRY,项目名称:symfony,代码行数:20,代码来源:sfContext.class.php

示例4: dispatch

 /**
  * Dispatches a request.
  *
  * This will determine which module and action to use by request parameters specified by the user.
  */
 public function dispatch()
 {
     try {
         if (sfConfig::get('sf_logging_enabled')) {
             $this->dispatcher->notify(new sfEvent($this, 'application.log', array('Dispatch request')));
         }
         // reinitialize filters (needed for unit and functional tests)
         sfFilter::$filterCalled = array();
         // determine our module and action
         $request = $this->context->getRequest();
         $moduleName = $request->getParameter('module');
         $actionName = $request->getParameter('action');
         if (empty($moduleName) || empty($actionName)) {
             throw new sfError404Exception(sprintf('Empty module and/or action after parsing the URL "%s" (%s/%s).', $request->getPathInfo(), $moduleName, $actionName));
         }
         // make the first request
         $this->forward($moduleName, $actionName);
     } catch (sfException $e) {
         $e->printStackTrace();
     } catch (Exception $e) {
         sfException::createFromException($e)->printStackTrace();
     }
 }
开发者ID:ajith24,项目名称:ajithworld,代码行数:28,代码来源:sfFrontWebController.class.php

示例5: dispatch

 public function dispatch()
 {
     try {
         sfFilter::$filterCalled = array();
         $request = $this->context->getRequest();
         $moduleName = $request->getParameter('module');
         $actionName = $request->getParameter('action');
         if (empty($moduleName) || empty($actionName)) {
             throw new sfError404Exception(sprintf('Empty module and/or action after parsing the URL "%s" (%s/%s).', $request->getPathInfo(), $moduleName, $actionName));
         }
         $this->forward($moduleName, $actionName);
     } catch (sfException $e) {
         $e->printStackTrace();
     } catch (Exception $e) {
         sfException::createFromException($e)->printStackTrace();
     }
 }
开发者ID:seven07ve,项目名称:vendorepuestos,代码行数:17,代码来源:config_core_compile.yml.php

示例6: loadClass

 /**
  * Tries to load a class that has been specified in autoload.yml.
  *
  * @param  string  $class  A class name.
  *
  * @return boolean Returns true if the class has been loaded
  */
 public function loadClass($class)
 {
     $class = strtolower($class);
     // class already exists
     if (class_exists($class, false) || interface_exists($class, false)) {
         return true;
     }
     // we have a class path, let's include it
     if (isset($this->classes[$class])) {
         try {
             require $this->classes[$class];
         } catch (sfException $e) {
             $e->printStackTrace();
         } catch (Exception $e) {
             sfException::createFromException($e)->printStackTrace();
         }
         return true;
     }
     // see if the file exists in the current module lib directory
     if (sfContext::hasInstance() && ($module = sfContext::getInstance()->getModuleName()) && isset($this->classes[$module . '/' . $class])) {
         try {
             require $this->classes[$module . '/' . $class];
         } catch (sfException $e) {
             $e->printStackTrace();
         } catch (Exception $e) {
             sfException::createFromException($e)->printStackTrace();
         }
         return true;
     }
     return false;
 }
开发者ID:seven07ve,项目名称:vendorepuestos,代码行数:38,代码来源:sfAutoload.class.php

示例7: autoload

 /**
  * Handles autoloading of classes.
  *
  * @param  string $class A class name.
  *
  * @return boolean Returns true if the class has been loaded
  */
 public function autoload($class)
 {
     $class = strtolower($class);
     // class already exists
     if (class_exists($class, false) || interface_exists($class, false)) {
         return true;
     }
     // we have a class path, let's include it
     if (isset($this->classes[$class])) {
         try {
             require $this->classes[$class];
         } catch (sfException $e) {
             $e->printStackTrace();
         } catch (Exception $e) {
             sfException::createFromException($e)->printStackTrace();
         }
         return true;
     }
     return false;
 }
开发者ID:sensorsix,项目名称:app,代码行数:27,代码来源:sfSimpleAutoload.class.php

示例8: saveNewChart

 protected function saveNewChart()
 {
     $chart = new Chart();
     $params = $this->parameters;
     $foreign = array('categories_list' => 'Categories', 'vehicles_list' => 'Vehicles');
     $chart->fromArray($this->parameters);
     foreach ($foreign as $field => $class) {
         if (isset($params[$field])) {
             $chart->link($class, $params[$field]);
         }
     }
     try {
         $chart->save();
     } catch (Exception $exc) {
         $sfe = new sfException();
         throw $sfe->createFromException($exc);
     }
     $this->chart = $chart;
     return $chart;
 }
开发者ID:rbolliger,项目名称:otokou,代码行数:20,代码来源:ChartBuilder.class.php


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