当前位置: 首页>>代码示例>>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;未经允许,请勿转载。