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


PHP Profiler::setInstance方法代码示例

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


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

示例1: wfSetupDump

 function wfSetupDump()
 {
     global $wgProfileToDatabase, $wgProfileSampleRate;
     // Override disabled profiling in maintenance scripts
     Profiler::setInstance(new Profiler());
     $wgProfileToDatabase = false;
     $wgProfileSampleRate = 1;
 }
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:8,代码来源:dumpHTML.php

示例2: execute

 public function execute()
 {
     Profiler::setInstance(new ProfilerSimpleText(array()));
     // clear
     $backend = FileBackendGroup::singleton()->get($this->getOption('b1'));
     $this->doPerfTest($backend);
     if ($this->getOption('b2')) {
         $backend = FileBackendGroup::singleton()->get($this->getOption('b2'));
         $this->doPerfTest($backend);
     }
     Profiler::instance()->setTemplated(true);
     // NOTE: as of MW1.21, $profiler->logData() is called implicitly by doMaintenance.php.
 }
开发者ID:Tarendai,项目名称:spring-website,代码行数:13,代码来源:fileOpPerfTest.php

示例3: finalSetup

 /**
  * Handle some last-minute setup here.
  */
 public function finalSetup()
 {
     global $wgCommandLineMode, $wgShowSQLErrors, $wgServer;
     global $wgDBadminuser, $wgDBadminpassword;
     global $wgDBuser, $wgDBpassword, $wgDBservers, $wgLBFactoryConf;
     # Turn off output buffering again, it might have been turned on in the settings files
     if (ob_get_level()) {
         ob_end_flush();
     }
     # Same with these
     $wgCommandLineMode = true;
     # Override $wgServer
     if ($this->hasOption('server')) {
         $wgServer = $this->getOption('server', $wgServer);
     }
     # If these were passed, use them
     if ($this->mDbUser) {
         $wgDBadminuser = $this->mDbUser;
     }
     if ($this->mDbPass) {
         $wgDBadminpassword = $this->mDbPass;
     }
     if ($this->getDbType() == self::DB_ADMIN && isset($wgDBadminuser)) {
         $wgDBuser = $wgDBadminuser;
         $wgDBpassword = $wgDBadminpassword;
         if ($wgDBservers) {
             /**
              * @var $wgDBservers array
              */
             foreach ($wgDBservers as $i => $server) {
                 $wgDBservers[$i]['user'] = $wgDBuser;
                 $wgDBservers[$i]['password'] = $wgDBpassword;
             }
         }
         if (isset($wgLBFactoryConf['serverTemplate'])) {
             $wgLBFactoryConf['serverTemplate']['user'] = $wgDBuser;
             $wgLBFactoryConf['serverTemplate']['password'] = $wgDBpassword;
         }
         LBFactory::destroyInstance();
     }
     $this->afterFinalSetup();
     $wgShowSQLErrors = true;
     // @codingStandardsIgnoreStart Allow error supppression. wfSuppressWarnings()
     // is not avaiable.
     @set_time_limit(0);
     // @codingStandardsIgnoreStart
     $this->adjustMemoryLimit();
     // Per-script profiling; useful for debugging
     $forcedProfiler = $this->getOption('profiler');
     if ($forcedProfiler === 'text') {
         Profiler::setInstance(new ProfilerSimpleText(array()));
         Profiler::instance()->setTemplated(true);
     } elseif ($forcedProfiler === 'trace') {
         Profiler::setInstance(new ProfilerSimpleTrace(array()));
         Profiler::instance()->setTemplated(true);
     }
 }
开发者ID:whysasse,项目名称:kmwiki,代码行数:60,代码来源:Maintenance.php


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