• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP wfLogProfilingData函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中wfLogProfilingData函数的典型用法代码示例。如果您正苦于以下问题:PHP wfLogProfilingData函数的具体用法?PHP wfLogProfilingData怎么用?PHP wfLogProfilingData使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: wfForbidden

function wfForbidden()
{
    header('HTTP/1.0 403 Forbidden');
    print "<html><body>\n<h1>Access denied</h1>\n<p>You need to log in to access files on this server</p>\n</body></html>";
    wfLogProfilingData();
    exit;
}
开发者ID:puring0815,项目名称:OpenKore,代码行数:7,代码来源:img_auth.php


示例2: __destruct

 public function __destruct()
 {
     // Return to real wiki db, so profiling data is preserved
     MediaWikiTestCase::teardownTestDB();
     // Log profiling data, e.g. in the database or UDP
     wfLogProfilingData();
 }
开发者ID:MediaWiki-stable,项目名称:1.26.1,代码行数:7,代码来源:bootstrap.php


示例3: execute

 function execute()
 {
     if (!file_exists('results')) {
         mkdir('results');
     }
     if (!is_dir('results')) {
         echo "Unable to create 'results' directory\n";
         exit(1);
     }
     $overallStart = microtime(true);
     $reportInterval = 1000;
     for ($i = 1; true; $i++) {
         $t = -microtime(true);
         try {
             self::$currentTest = new PPFuzzTest($this);
             self::$currentTest->execute();
             $passed = 'passed';
         } catch (MWException $e) {
             $testReport = self::$currentTest->getReport();
             $exceptionReport = $e->getText();
             $hash = md5($testReport);
             file_put_contents("results/ppft-{$hash}.in", serialize(self::$currentTest));
             file_put_contents("results/ppft-{$hash}.fail", "Input:\n{$testReport}\n\nException report:\n{$exceptionReport}\n");
             print "Test {$hash} failed\n";
             $passed = 'failed';
         }
         $t += microtime(true);
         if ($this->verbose) {
             printf("Test {$passed} in %.3f seconds\n", $t);
             print self::$currentTest->getReport();
         }
         $reportMetric = (microtime(true) - $overallStart) / $i * $reportInterval;
         if ($reportMetric > 25) {
             if (substr($reportInterval, 0, 1) === '1') {
                 $reportInterval /= 2;
             } else {
                 $reportInterval /= 5;
             }
         } elseif ($reportMetric < 4) {
             if (substr($reportInterval, 0, 1) === '1') {
                 $reportInterval *= 5;
             } else {
                 $reportInterval *= 2;
             }
         }
         if ($i % $reportInterval == 0) {
             print "{$i} tests done\n";
             /*
             				$testReport = self::$currentTest->getReport();
             				$filename = 'results/ppft-' . md5( $testReport ) . '.pass';
             				file_put_contents( $filename, "Input:\n$testReport\n" );*/
         }
     }
     wfLogProfilingData();
 }
开发者ID:rocLv,项目名称:conference,代码行数:55,代码来源:preprocessorFuzzTest.php


示例4: execute

 public function execute()
 {
     wfProfileIn(__METHOD__);
     //run the download:
     Http::doSessionIdDownload($this->getOption('sid'), $this->getOption('usk'));
     // close up shop:
     // Execute any deferred updates
     wfDoUpdates();
     // Log what the user did, for book-keeping purposes.
     wfLogProfilingData();
     // Shut down the database before exit
     wfGetLBFactory()->shutdown();
     wfProfileOut(__METHOD__);
 }
开发者ID:rocLv,项目名称:conference,代码行数:14,代码来源:httpSessionDownload.php


示例5: run

 public function run(array $argv, $exit = true)
 {
     wfProfileIn(__METHOD__);
     $ret = parent::run($argv, false);
     wfProfileOut(__METHOD__);
     // Return to real wiki db, so profiling data is preserved
     MediaWikiTestCase::teardownTestDB();
     // Log profiling data, e.g. in the database or UDP
     wfLogProfilingData();
     if ($exit) {
         exit($ret);
     } else {
         return $ret;
     }
 }
开发者ID:biribogos,项目名称:wikihow-src,代码行数:15,代码来源:MediaWikiPHPUnitCommand.php


示例6: wfForbidden

/**
 * Issue a standard HTTP 403 Forbidden header and a basic
 * error message, then end the script
 */
function wfForbidden()
{
    header('HTTP/1.0 403 Forbidden');
    header('Vary: Cookie');
    header('Content-Type: text/html; charset=utf-8');
    echo <<<ENDS
<html>
<body>
<h1>Access Denied</h1>
<p>You need to log in to access files on this server.</p>
</body>
</html>
ENDS;
    wfLogProfilingData();
    exit;
}
开发者ID:BackupTheBerlios,项目名称:shoutwiki-svn,代码行数:20,代码来源:img_auth.php


示例7: handle

 /**
  * Exception handler which simulates the appropriate catch() handling:
  *
  *   try {
  *       ...
  *   } catch ( MWException $e ) {
  *       $e->report();
  *   } catch ( Exception $e ) {
  *       echo $e->__toString();
  *   }
  */
 public static function handle($e)
 {
     global $wgFullyInitialised;
     self::report($e);
     // Final cleanup
     if ($wgFullyInitialised) {
         try {
             wfLogProfilingData();
             // uses $wgRequest, hence the $wgFullyInitialised condition
         } catch (Exception $e) {
         }
     }
     // Exit value should be nonzero for the benefit of shell jobs
     exit(1);
 }
开发者ID:yusufchang,项目名称:app,代码行数:26,代码来源:Exception.php


示例8: restInPeace

 /**
  * Ends this task peacefully
  */
 function restInPeace(&$loadBalancer)
 {
     wfLogProfilingData();
     $loadBalancer->closeAll();
     wfDebug("Request ended normally\n");
 }
开发者ID:puring0815,项目名称:OpenKore,代码行数:9,代码来源:Wiki.php


示例9: restInPeace

 /**
  * Ends this task peacefully
  */
 function restInPeace()
 {
     wfLogProfilingData();
     // Commit and close up!
     $factory = wfGetLBFactory();
     $factory->commitMasterChanges();
     $factory->shutdown();
     wfDebug("Request ended normally\n");
 }
开发者ID:GodelDesign,项目名称:Godel,代码行数:12,代码来源:Wiki.php


示例10: restInPeace

 /**
  * Ends this task peacefully
  * @param string $mode Use 'fast' to always skip job running
  */
 public function restInPeace($mode = 'fast')
 {
     $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
     // Assure deferred updates are not in the main transaction
     $lbFactory->commitMasterChanges(__METHOD__);
     // Loosen DB query expectations since the HTTP client is unblocked
     $trxProfiler = Profiler::instance()->getTransactionProfiler();
     $trxProfiler->resetExpectations();
     $trxProfiler->setExpectations($this->config->get('TrxProfilerLimits')['PostSend'], __METHOD__);
     // Do any deferred jobs
     DeferredUpdates::doUpdates('enqueue');
     DeferredUpdates::setImmediateMode(true);
     // Make sure any lazy jobs are pushed
     JobQueueGroup::pushLazyJobs();
     // Now that everything specific to this request is done,
     // try to occasionally run jobs (if enabled) from the queues
     if ($mode === 'normal') {
         $this->triggerJobs();
     }
     // Log profiling data, e.g. in the database or UDP
     wfLogProfilingData();
     // Commit and close up!
     $lbFactory->commitMasterChanges(__METHOD__);
     $lbFactory->shutdown(LBFactory::SHUTDOWN_NO_CHRONPROT);
     wfDebug("Request ended normally\n");
 }
开发者ID:paladox,项目名称:mediawiki,代码行数:30,代码来源:MediaWiki.php


示例11: restInPeace

 /**
  * Ends this task peacefully
  * @param string $mode Use 'fast' to always skip job running
  */
 public function restInPeace($mode = 'fast')
 {
     // Assure deferred updates are not in the main transaction
     wfGetLBFactory()->commitMasterChanges(__METHOD__);
     // Ignore things like master queries/connections on GET requests
     // as long as they are in deferred updates (which catch errors).
     Profiler::instance()->getTransactionProfiler()->resetExpectations();
     // Do any deferred jobs
     DeferredUpdates::doUpdates('enqueue');
     // Make sure any lazy jobs are pushed
     JobQueueGroup::pushLazyJobs();
     // Now that everything specific to this request is done,
     // try to occasionally run jobs (if enabled) from the queues
     if ($mode === 'normal') {
         $this->triggerJobs();
     }
     // Log profiling data, e.g. in the database or UDP
     wfLogProfilingData();
     // Commit and close up!
     $factory = wfGetLBFactory();
     $factory->commitMasterChanges(__METHOD__);
     $factory->shutdown(LBFactory::SHUTDOWN_NO_CHRONPROT);
     wfDebug("Request ended normally\n");
 }
开发者ID:xiebinyi,项目名称:mediawiki,代码行数:28,代码来源:MediaWiki.php


示例12: restInPeace

 /**
  * Ends this task peacefully
  */
 public function restInPeace()
 {
     // Ignore things like master queries/connections on GET requests
     // as long as they are in deferred updates (which catch errors).
     Profiler::instance()->getTransactionProfiler()->resetExpectations();
     // Do any deferred jobs
     DeferredUpdates::doUpdates('commit');
     // Make sure any lazy jobs are pushed
     JobQueueGroup::pushLazyJobs();
     // Log profiling data, e.g. in the database or UDP
     wfLogProfilingData();
     // Commit and close up!
     $factory = wfGetLBFactory();
     $factory->commitMasterChanges();
     $factory->shutdown();
     wfDebug("Request ended normally\n");
 }
开发者ID:nanasess,项目名称:mediawiki,代码行数:20,代码来源:MediaWiki.php


示例13: wfExceptionHandler

/**
 * Exception handler which simulates the appropriate catch() handling:
 *
 *   try {
 *       ...
 *   } catch ( MWException $e ) {
 *       $e->report();
 *   } catch ( Exception $e ) {
 *       echo $e->__toString();
 *   }
 */
function wfExceptionHandler($e)
{
    global $wgFullyInitialised;
    wfReportException($e);
    // Final cleanup, similar to wfErrorExit()
    if ($wgFullyInitialised) {
        try {
            wfLogProfilingData();
            // uses $wgRequest, hence the $wgFullyInitialised condition
        } catch (Exception $e) {
        }
    }
    // Exit value should be nonzero for the benefit of shell jobs
    exit(1);
}
开发者ID:negabaro,项目名称:alfresco,代码行数:26,代码来源:Exception.php


示例14: wfAbruptExit

/**
 * Just like exit() but makes a note of it.
 * Commits open transactions except if the error parameter is set
 *
 * @deprecated Please return control to the caller or throw an exception
 */
function wfAbruptExit($error = false)
{
    static $called = false;
    if ($called) {
        exit(-1);
    }
    $called = true;
    $bt = wfDebugBacktrace();
    if ($bt) {
        for ($i = 0; $i < count($bt); $i++) {
            $file = isset($bt[$i]['file']) ? $bt[$i]['file'] : "unknown";
            $line = isset($bt[$i]['line']) ? $bt[$i]['line'] : "unknown";
            wfDebug("WARNING: Abrupt exit in {$file} at line {$line}\n");
        }
    } else {
        wfDebug("WARNING: Abrupt exit\n");
    }
    wfLogProfilingData();
    if (!$error) {
        wfGetLB()->closeAll();
    }
    exit(-1);
}
开发者ID:josephdye,项目名称:wikireader,代码行数:29,代码来源:GlobalFunctions.php


示例15: wfAbruptExit

/**
 * Just like exit() but makes a note of it.
 * Commits open transactions except if the error parameter is set
 *
 * @obsolete Please return control to the caller or throw an exception
 */
function wfAbruptExit($error = false)
{
    global $wgLoadBalancer;
    static $called = false;
    if ($called) {
        exit(-1);
    }
    $called = true;
    if (function_exists('debug_backtrace')) {
        // PHP >= 4.3
        $bt = debug_backtrace();
        for ($i = 0; $i < count($bt); $i++) {
            $file = isset($bt[$i]['file']) ? $bt[$i]['file'] : "unknown";
            $line = isset($bt[$i]['line']) ? $bt[$i]['line'] : "unknown";
            wfDebug("WARNING: Abrupt exit in {$file} at line {$line}\n");
        }
    } else {
        wfDebug('WARNING: Abrupt exit\\n');
    }
    wfLogProfilingData();
    if (!$error) {
        $wgLoadBalancer->closeAll();
    }
    exit(-1);
}
开发者ID:puring0815,项目名称:OpenKore,代码行数:31,代码来源:GlobalFunctions.php


示例16: wfForbidden

/**
 * Issue a standard HTTP 403 Forbidden header ($msg1-a message index, not a message) and an
 * error message ($msg2, also a message index), (both required) then end the script
 * subsequent arguments to $msg2 will be passed as parameters only for replacing in $msg2 
 */
function wfForbidden($msg1, $msg2)
{
    global $wgImgAuthDetails;
    $args = func_get_args();
    array_shift($args);
    array_shift($args);
    $MsgHdr = htmlspecialchars(wfMsg($msg1));
    $detailMsg = htmlspecialchars(wfMsg($wgImgAuthDetails ? $msg2 : 'badaccess-group0', $args));
    wfDebugLog('img_auth', "wfForbidden Hdr:" . wfMsgExt($msg1, array('language' => 'en')) . " Msg: " . wfMsgExt($msg2, array('language' => 'en'), $args));
    header('HTTP/1.0 403 Forbidden');
    header('Cache-Control: no-cache');
    header('Content-Type: text/html; charset=utf-8');
    echo <<<ENDS
<html>
<body>
<h1>{$MsgHdr}</h1>
<p>{$detailMsg}</p>
</body>
</html>
ENDS;
    wfLogProfilingData();
    exit;
}
开发者ID:rocLv,项目名称:conference,代码行数:28,代码来源:img_auth.php


示例17: restInPeace

 /**
  * Ends this task peacefully
  */
 public function restInPeace()
 {
     // Do any deferred jobs
     DeferredUpdates::doUpdates('commit');
     // Execute a job from the queue
     $this->doJobs();
     // Log profiling data, e.g. in the database or UDP
     wfLogProfilingData();
     // Commit and close up!
     $factory = wfGetLBFactory();
     $factory->commitMasterChanges();
     $factory->shutdown();
     wfDebug("Request ended normally\n");
 }
开发者ID:mangowi,项目名称:mediawiki,代码行数:17,代码来源:Wiki.php


示例18: wfPublicError

/**
 * Show a 403 error for use when the wiki is public
 */
function wfPublicError()
{
    header('HTTP/1.0 403 Forbidden');
    header('Content-Type: text/html; charset=utf-8');
    echo <<<ENDS
<html>
<body>
<h1>Access Denied</h1>
<p>The function of img_auth.php is to output files from a private wiki. This wiki
is configured as a public wiki. For optimal security, img_auth.php is disabled in 
this case.
</p>
</body>
</html>
ENDS;
    wfLogProfilingData();
    exit;
}
开发者ID:amjadtbssm,项目名称:website,代码行数:21,代码来源:img_auth.php


示例19: wfProfileOut

// OK, no valid thumbnail, time to get out the heavy machinery
wfProfileOut('thumb.php-start');
require_once 'Setup.php';
wfProfileIn('thumb.php-render');
$img = Image::newFromName($fileName);
try {
    if ($img) {
        if (!is_null($page)) {
            $img->selectPage($page);
        }
        $thumb = $img->renderThumb($width, false);
    } else {
        $thumb = false;
    }
} catch (Exception $ex) {
    // Tried to select a page on a non-paged file?
    $thumb = false;
}
if ($thumb && $thumb->path) {
    wfStreamFile($thumb->path);
} else {
    $badtitle = wfMsg('badtitle');
    $badtitletext = wfMsg('badtitletext');
    header('Cache-Control: no-cache');
    header('Content-Type: text/html; charset=utf-8');
    echo "<html><head>\n\t<title>{$badtitle}</title>\n\t<body>\n<h1>{$badtitle}</h1>\n<p>{$badtitletext}</p>\n</body></html>\n";
}
wfProfileOut('thumb.php-render');
wfProfileOut('thumb.php');
wfLogProfilingData();
开发者ID:negabaro,项目名称:alfresco,代码行数:30,代码来源:thumb.php


示例20: restInPeace

 /**
  * Ends this task peacefully
  */
 function restInPeace()
 {
     wfLogProfilingData();
     wfDebug("Request ended normally\n");
 }
开发者ID:amjadtbssm,项目名称:website,代码行数:8,代码来源:Wiki.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP wfLogWarning函数代码示例发布时间:2022-05-23
下一篇:
PHP wfLogDBError函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap