本文整理汇总了PHP中Patchwork\Utf8\Bootup::filterRequestInputs方法的典型用法代码示例。如果您正苦于以下问题:PHP Bootup::filterRequestInputs方法的具体用法?PHP Bootup::filterRequestInputs怎么用?PHP Bootup::filterRequestInputs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Patchwork\Utf8\Bootup
的用法示例。
在下文中一共展示了Bootup::filterRequestInputs方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initializeClasses
/**
* @inheritdoc
*/
public function initializeClasses(SymfonyRequest $symfonyRequest)
{
Utf8\Bootup::initAll();
// Enables the portability layer and configures PHP for UTF-8
Utf8\Bootup::filterRequestUri();
// Redirects to an UTF-8 encoded URL if it's not already the case
Utf8\Bootup::filterRequestInputs();
// Normalizes HTTP inputs to UTF-8 NFC
$file = $this->appPath->getCacheDir() . 'container.php';
$this->dumpContainer($symfonyRequest, $file);
require_once $file;
$this->container = new \ACP3ServiceContainer();
$this->container->set('core.environment.application_path', $this->appPath);
$this->container->set('core.http.symfony_request', $symfonyRequest);
}
示例2: __construct
/**
* Application constructor.
*
* @param object $loader The autoloader instance.
* @param array $config The custom configuration of the application.
* @param string $appPath The application absolute path.
* @param array $classesMap The custom classes map of the application.
*/
public function __construct($loader, array $config = [], $appPath = null, array $classesMap = [])
{
# Utilities
$this->utilities = new Utilities($this);
# Register start time
$this->utilities->registerStartTime();
# Store application path
$this->utilities->setApplicationPath($appPath);
# Store classes map
$this['class'] = $this->utilities->setClassesMap($classesMap);
# Call container constructor
parent::__construct($this->utilities->setConfiguration($config));
# Register core services providers
$this->register(new FilesystemServiceProvider());
$this->register(new FinderServiceProvider());
$this->register(new HttpServiceProvider());
$this->register(new LoggerServiceProvider());
$this->register(new MessagesServiceProvider());
$this->register(new RouterServiceProvider());
$this->register(new SupportServiceProvider());
$this->register(new TemplatingServiceProvider());
$this->register(new TriggersServiceProvider());
# Enables the portablity layer and configures PHP for UTF-8
Utf8Bootup::initAll();
# Redirects to an UTF-8 encoded URL if it's not already the case
Utf8Bootup::filterRequestUri();
# Normalizes HTTP inputs to UTF-8 NFC
Utf8Bootup::filterRequestInputs();
# Print errors in debug mode
if ($this['debug']) {
$whoops = new WhoopsRun();
$whoops->pushHandler(new WhoopsHandler());
$whoops->register();
} else {
ErrorHandler::register($this['phpLogger']);
}
# Only enable Kint in debug mode
\Kint::enabled($this['debug']);
}
示例3: with
// Emulate PHP 5.4 feature that allows us to create/use an object without a temporary.
// PHP 5.4: (new X)->y()
// PHP 5.3: with(new X)->y()
function with($x)
{
return $x;
}
// Use the patchwork/utf8 library to:
// 1) set all PHP defaults to UTF-8
// 2) create shims for missing mb_string functions such as mb_strlen()
// 3) check that requests are valid UTF-8
\Patchwork\Utf8\Bootup::initAll();
// Enables the portablity layer and configures PHP for UTF-8
\Patchwork\Utf8\Bootup::filterRequestUri();
// Redirects to an UTF-8 encoded URL if it's not already the case
\Patchwork\Utf8\Bootup::filterRequestInputs();
// Normalizes HTTP inputs to UTF-8 NFC
// Use the fisharebest/ext-calendar library to
// 1) provide shims for the PHP ext/calendar extension, such as JewishToJD()
// 2) provide calendar conversions for the Arabic and Persian calendars
\Fisharebest\ExtCalendar\Shim::create();
// Split the request protocol://host:port/path/to/script.php?var=value into parts
// WT_SERVER_NAME = protocol://host:port
// WT_SCRIPT_PATH = /path/to/ (begins and ends with /)
// WT_SCRIPT_NAME = script.php (already defined in the calling script)
$https = !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off';
define('WT_SERVER_NAME', ($https ? 'https://' : 'http://') . (empty($_SERVER['SERVER_NAME']) ? '' : $_SERVER['SERVER_NAME']) . (empty($_SERVER['SERVER_PORT']) || !$https && $_SERVER['SERVER_PORT'] == 80 || $https && $_SERVER['SERVER_PORT'] == 443 ? '' : ':' . $_SERVER['SERVER_PORT']));
// REDIRECT_URL should be set in the case of Apache following a RedirectRule
// SCRIPT_NAME should always be correct, but is not always present.
// PHP_SELF should always be present, but may have trailing path: /path/to/script.php/FOO/BAR
if (!empty($_SERVER['REDIRECT_URL'])) {