• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP sfFilter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了sfFilter类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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.
  *
  * 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->getContext()->getLogger()->info('{sfController} dispatch request');
         }
         // reinitialize filters (needed for unit and functional tests)
         sfFilter::$filterCalled = array();
         // determine our module and action
         $request = $this->getContext()->getRequest();
         $moduleName = $request->getParameter('module');
         $actionName = $request->getParameter('action');
         // make the first request
         $this->forward($moduleName, $actionName);
     } catch (sfException $e) {
         if (sfConfig::get('sf_test')) {
             throw $e;
         }
         $e->printStackTrace();
     } catch (Exception $e) {
         if (sfConfig::get('sf_test')) {
             throw $e;
         }
         try {
             // wrap non symfony exceptions
             $sfException = new sfException();
             $sfException->printStackTrace($e);
         } catch (Exception $e) {
             header('HTTP/1.0 500 Internal Server Error');
         }
     }
 }
开发者ID:taryono,项目名称:school,代码行数:37,代码来源:sfFrontWebController.class.php


示例3: execute

 /**
  * @param sfFilter $filterChain
  */
 public function execute($filterChain)
 {
     if (sfJpMobile::isMobile()) {
         if ($this->isFirstCall()) {
             // UIDの取得
             $this->_canGetUid();
             // パラメータをシステム内で扱いやすいように変換
             $this->_paramConvert();
             // キャッシュ制御設定
             $this->_setCacheControl();
             // Content-Typeの設定
             $this->_setContentType();
         }
         $filterChain->execute();
         // 出力データの加工
         $this->_convertContent();
     } else {
         $filterChain->execute();
     }
 }
开发者ID:pontuyo,项目名称:takutomo-mixi-appli,代码行数:23,代码来源:sfJpMobileFilter.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

 /**
  * 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 (sfStopException $e) {
         // ignore, do nothing
     } catch (Exception $e) {
         // Throwing an exception here will break the exception handling
         // when process isolation of PHPUnit is activated.
         // This will only work when the configuration "convertErrorsToExceptions"
         // is enabled.
         trigger_error(sprintf('wrapped controller exception [%s]: %s', get_class($e), $e->getMessage()));
     }
 }
开发者ID:nvidela,项目名称:kimkelen,代码行数:29,代码来源:sfPHPUnit2FrontWebController.class.php


示例6: 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


示例7: dispatch

 public function dispatch()
 {
     try {
         if (sfConfig::get('sf_logging_enabled')) {
             $this->getContext()->getLogger()->info('{sfController} dispatch request');
         }
         sfFilter::$filterCalled = array();
         $request = $this->getContext()->getRequest();
         $moduleName = $request->getParameter('module');
         $actionName = $request->getParameter('action');
         $this->forward($moduleName, $actionName);
     } catch (sfException $e) {
         if (sfConfig::get('sf_test')) {
             throw $e;
         }
         $e->printStackTrace();
     } catch (Exception $e) {
         if (sfConfig::get('sf_test')) {
             throw $e;
         }
         try {
             $sfException = new sfException($e->getMessage());
             $sfException->printStackTrace($e);
         } catch (Exception $e) {
             header('HTTP/1.0 500 Internal Server Error');
         }
     }
 }
开发者ID:kotow,项目名称:work,代码行数:28,代码来源:config_core_compile.yml.php


示例8: __doRequest

 /**
  * Dispatches a soap request via a sfTestBrowser to the tested application.
  *
  * @see SoapClient::__doRequest()
  */
 public function __doRequest($request, $location, $action, $version)
 {
     $this->lastRequest = strval($request);
     $GLOBALS['HTTP_RAW_POST_DATA'] = $this->lastRequest;
     $this->browser->setHttpHeader('soapaction', strval($action));
     sfFilter::$filterCalled = array();
     $this->lastResponse = strval($this->browser->post('/')->getResponse()->getContent());
     return $this->lastResponse;
 }
开发者ID:nvieirafelipe,项目名称:graviola-project,代码行数:14,代码来源:ckTestSoapClient.class.php


示例9: initialize

 public function initialize($context, $parameters = array())
 {
     parent::initialize($context, $parameters);
     $this->db = Doctrine_Manager::connection();
     $this->request = $context->getRequest();
     $this->response = $context->getResponse();
 }
开发者ID:silky,项目名称:littlesis,代码行数:7,代码来源:LsApiRequestFilter.class.php


示例10: initialize

 /**
  * Initializes this Filter.
  *
  * @param sfContext The current application context
  * @param array   An associative array of initialization parameters
  *
  * @return bool true, if initialization completes successfully, otherwise false
  *
  * @throws <b>sfInitializationException</b> If an error occurs while initializing this Filter
  */
 public function initialize($context, $parameters = array())
 {
     parent::initialize($context, $parameters);
     $this->cacheManager = $context->getViewCacheManager();
     $this->request = $context->getRequest();
     $this->response = $context->getResponse();
 }
开发者ID:Daniel-Marynicz,项目名称:symfony1-legacy,代码行数:17,代码来源:sfCacheFilter.class.php


示例11: initialize

 /**
  * Initializes this Filter.
  *
  * @param sfContext $context    The current application context
  * @param array     $parameters An associative array of initialization parameters
  *
  * @return boolean true
  */
 public function initialize($context, $parameters = array())
 {
     $this->request = $context->getRequest();
     $this->response = $context->getResponse();
     $this->user = $context->getUser();
     return parent::initialize($context, $parameters);
 }
开发者ID:theolymp,项目名称:diem,代码行数:15,代码来源:dmFilter.php


示例12: isFirstCall

 public function isFirstCall()
 {
     return parent::isFirstCall();
 }
开发者ID:sensorsix,项目名称:app,代码行数:4,代码来源:sfFilterTest.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP sfFilterChain类代码示例发布时间:2022-05-23
下一篇:
PHP sfFilesystem类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap