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


PHP Profiler::applyConfig方法代码示例

本文整理汇总了PHP中Magento\Framework\Profiler::applyConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP Profiler::applyConfig方法的具体用法?PHP Profiler::applyConfig怎么用?PHP Profiler::applyConfig使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Magento\Framework\Profiler的用法示例。


在下文中一共展示了Profiler::applyConfig方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: error_reporting

 * @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */
/**
 * Environment initialization
 */
error_reporting(E_ALL);
#ini_set('display_errors', 1);
umask(0);
/* PHP version validation */
if (version_compare(phpversion(), '5.4.11', '<') === true) {
    if (PHP_SAPI == 'cli') {
        echo 'Magento supports PHP 5.4.11 or newer. Please read http://www.magento.com/install.';
    } else {
        echo <<<HTML
<div style="font:12px/1.35em arial, helvetica, sans-serif;">
    <div style="margin:0 0 25px 0; border-bottom:1px solid #ccc;">
        <h3 style="margin:0;font-size:1.7em;font-weight:normal;text-transform:none;text-align:left;color:#2f2f2f;">
        Whoops, it looks like you have an invalid PHP version.</h3>
    </div>
    <p>Magento supports PHP 5.4.11 or newer.
</div>
HTML;
    }
    exit(1);
}
require_once __DIR__ . '/autoload.php';
require_once BP . '/app/functions.php';
if (!empty($_SERVER['MAGE_PROFILER'])) {
    \Magento\Framework\Profiler::applyConfig($_SERVER['MAGE_PROFILER'], BP, !empty($_REQUEST['isAjax']));
}
date_default_timezone_set(\Magento\Framework\Stdlib\DateTime\TimezoneInterface::DEFAULT_TIMEZONE);
开发者ID:buskamuza,项目名称:magento2-skeleton,代码行数:31,代码来源:bootstrap.php

示例2: testApplyConfigWithDrivers

 /**
  * @dataProvider applyConfigDataProvider
  * @param array $config
  * @param array $expectedDrivers
  */
 public function testApplyConfigWithDrivers(array $config, array $expectedDrivers)
 {
     \Magento\Framework\Profiler::applyConfig($config, '');
     $this->assertAttributeEquals($expectedDrivers, '_drivers', 'Magento\\Framework\\Profiler');
 }
开发者ID:aiesh,项目名称:magento2,代码行数:10,代码来源:ProfilerTest.php

示例3:

<?php

if (PHP_SAPI != 'cli') {
    $_SERVER['MAGE_PROFILER_STAT'] = new \Magento\Framework\Profiler\Driver\Standard\Stat();
    \Magento\Framework\Profiler::applyConfig(['drivers' => [['output' => 'Mirasvit\\Profiler\\Model\\Driver\\Output\\Html', 'stat' => $_SERVER['MAGE_PROFILER_STAT']]]], BP, false);
}
\Magento\Framework\Component\ComponentRegistrar::register(\Magento\Framework\Component\ComponentRegistrar::MODULE, 'Mirasvit_Profiler', __DIR__);
开发者ID:mirasvit,项目名称:module-profiler,代码行数:7,代码来源:registration.php

示例4: error_reporting

/**
 * Copyright © 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
/**
 * Environment initialization
 */
error_reporting(E_ALL);
#ini_set('display_errors', 1);
umask(0);
/* PHP version validation */
if (version_compare(phpversion(), '5.5.0', '<') === true) {
    if (PHP_SAPI == 'cli') {
        echo 'Magento supports PHP 5.5.0 or later. ' . 'Please read http://devdocs.magento.com/guides/v1.0/install-gde/system-requirements.html';
    } else {
        echo <<<HTML
<div style="font:12px/1.35em arial, helvetica, sans-serif;">
    <p>Magento supports PHP 5.5.0 or later. Please read
    <a target="_blank" href="http://devdocs.magento.com/guides/v1.0/install-gde/system-requirements.html">
    Magento System Requirements</a>.
</div>
HTML;
    }
    exit(1);
}
require_once __DIR__ . '/autoload.php';
require_once BP . '/app/functions.php';
if (!empty($_SERVER['MAGE_PROFILER']) && isset($_SERVER['HTTP_ACCEPT']) && strpos($_SERVER['HTTP_ACCEPT'], 'text/html') !== false) {
    \Magento\Framework\Profiler::applyConfig($_SERVER['MAGE_PROFILER'], BP, !empty($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest');
}
date_default_timezone_set('UTC');
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:31,代码来源:bootstrap.php

示例5: testApplyConfig

 public function testApplyConfig()
 {
     $mockDriver = $this->getMock('Magento\\Framework\\Profiler\\DriverInterface');
     $driverConfig = ['type' => 'foo'];
     $mockDriverFactory = $this->getMockBuilder('Magento\\Framework\\Profiler\\Driver\\Factory')->disableOriginalConstructor()->getMock();
     $config = ['drivers' => [$driverConfig], 'driverFactory' => $mockDriverFactory, 'tagFilters' => ['tagName' => 'tagValue']];
     $mockDriverFactory->expects($this->once())->method('create')->with($driverConfig)->will($this->returnValue($mockDriver));
     \Magento\Framework\Profiler::applyConfig($config, '');
     $this->assertAttributeEquals([$mockDriver], '_drivers', 'Magento\\Framework\\Profiler');
     $this->assertAttributeEquals(['tagName' => ['tagValue']], '_tagFilters', 'Magento\\Framework\\Profiler');
     $this->assertAttributeEquals(true, '_enabled', 'Magento\\Framework\\Profiler');
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:12,代码来源:ProfilerTest.php


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