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


PHP Input::initialize方法代碼示例

本文整理匯總了PHP中Contao\Input::initialize方法的典型用法代碼示例。如果您正苦於以下問題:PHP Input::initialize方法的具體用法?PHP Input::initialize怎麽用?PHP Input::initialize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Contao\Input的用法示例。


在下文中一共展示了Input::initialize方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testGetPost

 /**
  * Tests the getPost() method.
  *
  * @dataProvider postProvider
  */
 public function testGetPost($key, $input, $value, $expected)
 {
     $widget = $this->getMock('Contao\\Widget');
     $class = new \ReflectionClass('Contao\\Widget');
     $method = $class->getMethod('getPost');
     $method->setAccessible(true);
     $_POST[$input] = $value;
     Input::resetCache();
     Input::initialize();
     $this->assertEquals($expected, $method->invoke($widget, $key));
 }
開發者ID:eakcantey,項目名稱:core-bundle,代碼行數:16,代碼來源:WidgetTest.php

示例2: testGetPost

 /**
  * Tests the getPost() method.
  *
  * @param string $key
  * @param string $input
  * @param mixed  $value
  * @param string $expected
  *
  * @dataProvider postProvider
  */
 public function testGetPost($key, $input, $value, $expected)
 {
     // Prevent "undefined index" errors
     $errorReporting = error_reporting();
     error_reporting($errorReporting & ~E_NOTICE);
     $widget = $this->getMock('Contao\\Widget');
     $class = new \ReflectionClass('Contao\\Widget');
     $method = $class->getMethod('getPost');
     $method->setAccessible(true);
     $_POST[$input] = $value;
     Input::resetCache();
     Input::initialize();
     $this->assertEquals($expected, $method->invoke($widget, $key));
     // Restore the error reporting level
     error_reporting($errorReporting);
 }
開發者ID:contao,項目名稱:core-bundle,代碼行數:26,代碼來源:WidgetTest.php

示例3: initializeFramework

 /**
  * Initializes the framework.
  */
 private function initializeFramework()
 {
     // Set the error_reporting level
     error_reporting($this->errorLevel);
     $this->includeHelpers();
     // TODO: use Monolog to log errors
     $this->iniSet('error_log', $this->rootDir . '/system/logs/error.log');
     $this->includeBasicClasses();
     // Set the container
     System::setContainer($this->container);
     // Preload the configuration (see #5872)
     $this->config->preload();
     // Register the class loader
     ClassLoader::scanAndRegister();
     $this->initializeLegacySessionAccess();
     $this->setDefaultLanguage();
     // Fully load the configuration
     $this->config->initialize();
     $this->validateInstallation();
     Input::initialize();
     $this->setTimezone();
     // Set the mbstring encoding
     if (USE_MBSTRING && function_exists('mb_regex_encoding')) {
         mb_regex_encoding($this->config->get('characterSet'));
     }
     $this->triggerInitializeSystemHook();
     $this->handleRequestToken();
 }
開發者ID:jamesdevine,項目名稱:core-bundle,代碼行數:31,代碼來源:ContaoFramework.php

示例4: initializeFramework

 /**
  * Initializes the framework.
  */
 private function initializeFramework()
 {
     // Set the error_reporting level
     error_reporting($this->errorLevel);
     $this->includeHelpers();
     $this->includeBasicClasses();
     // Set the container
     System::setContainer($this->container);
     /** @var Config $config */
     $config = $this->getAdapter('Contao\\Config');
     // Preload the configuration (see #5872)
     $config->preload();
     // Register the class loader
     ClassLoader::scanAndRegister();
     $this->initializeLegacySessionAccess();
     $this->setDefaultLanguage();
     // Fully load the configuration
     $config->getInstance();
     $this->validateInstallation();
     Input::initialize();
     $this->setTimezone();
     $this->triggerInitializeSystemHook();
     $this->handleRequestToken();
 }
開發者ID:Mozan,項目名稱:core-bundle,代碼行數:27,代碼來源:ContaoFramework.php


注:本文中的Contao\Input::initialize方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。