當前位置: 首頁>>代碼示例>>PHP>>正文


PHP sfFilter類代碼示例

本文整理匯總了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;未經允許,請勿轉載。