MediaWiki REL1_34
SectionProfileCallback.php
Go to the documentation of this file.
1<?php
21use Wikimedia\ScopedCallback;
22
29class SectionProfileCallback extends ScopedCallback {
31 protected $profiler;
33 protected $section;
34
40 parent::__construct( null );
41 $this->profiler = $profiler;
42 $this->section = $section;
43 }
44
45 function __destruct() {
46 $this->profiler->profileOutInternal( $this->section );
47 }
48}
Subclass ScopedCallback to avoid call_user_func_array(), which is slow.
__construct(SectionProfiler $profiler, $section)
Custom PHP profiler for parser/DB type section names that xhprof/xdebug can't handle.