本文整理汇总了PHP中Thelia\Core\HttpFoundation\Request::createFromGlobals方法的典型用法代码示例。如果您正苦于以下问题:PHP Request::createFromGlobals方法的具体用法?PHP Request::createFromGlobals怎么用?PHP Request::createFromGlobals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Thelia\Core\HttpFoundation\Request
的用法示例。
在下文中一共展示了Request::createFromGlobals方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
<?php
/*************************************************************************************/
/* This file is part of the Thelia package. */
/* */
/* Copyright (c) OpenStudio */
/* email : dev@thelia.net */
/* web : http://www.thelia.net */
/* */
/* For the full copyright and license information, please view the LICENSE.txt */
/* file that was distributed with this source code. */
/*************************************************************************************/
use Thelia\Core\Thelia;
use Thelia\Core\HttpFoundation\Response;
use Thelia\Core\HttpFoundation\Request;
use Thelia\Core\HttpKernel\HttpCache\HttpCache;
//use Symfony\Component\DependencyInjection;
$env = 'dev';
require __DIR__ . '/../core/vendor/autoload.php';
// List of allowed IP
$trustedIp = array('::1', '127.0.0.1');
$request = Request::createFromGlobals();
$thelia = new Thelia("dev", true);
if (false === in_array($request->getClientIp(), $trustedIp)) {
$response = Response::create('Forbidden', 403)->send();
$thelia->terminate($request, $response);
} else {
$response = $thelia->handle($request)->prepare($request)->send();
$thelia->terminate($request, $response);
}
示例2:
\Thelia\Model\ConfigQuery::create()->filterByName('store_notification_emails')->update(array('Value' => $_POST['store_email']));
\Thelia\Model\ConfigQuery::create()->filterByName('store_name')->update(array('Value' => $_POST['store_name']));
\Thelia\Model\ConfigQuery::create()->filterByName('url_site')->update(array('Value' => $_POST['url_site']));
$lang = \Thelia\Model\LangQuery::create()->findOneByLocale(empty($_POST['shop_locale']) ? "en_US" : $_POST['shop_locale']);
if (null !== $lang) {
$lang->toggleDefault();
}
$secret = \Thelia\Tools\TokenProvider::generateToken();
\Thelia\Model\ConfigQuery::write('form.secret', $secret, 0, 0);
}
//clean up cache directories
$fs = new \Symfony\Component\Filesystem\Filesystem();
$fs->remove(THELIA_ROOT . '/cache/prod');
$fs->remove(THELIA_ROOT . '/cache/dev');
$fs->remove(THELIA_ROOT . '/cache/install');
$request = \Thelia\Core\HttpFoundation\Request::createFromGlobals();
$_SESSION['install']['step'] = $step;
// Retrieve the website url
$url = $_SERVER['PHP_SELF'];
$website_url = preg_replace("#/install/[a-z](.*)#", '', $url);
?>
<div class="well">
<p class="lead text-center">
<?php
echo $trans->trans('Thelia is now installed. Thank you !');
?>
</p>
<?php
$scriptHook = <<<SCRIPT
<script>