当前位置: 首页>>代码示例>>PHP>>正文


PHP Request::createFromGlobals方法代码示例

本文整理汇总了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);
}
开发者ID:margery,项目名称:thelia,代码行数:30,代码来源:index_dev.php

示例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>
开发者ID:GuiminZHOU,项目名称:thelia,代码行数:31,代码来源:end.php


注:本文中的Thelia\Core\HttpFoundation\Request::createFromGlobals方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。