MediaWiki  master
SectionProfileCallback.php
Go to the documentation of this file.
1 <?php
20 use Wikimedia\ScopedCallback;
21 
28 class SectionProfileCallback extends ScopedCallback {
30  protected $profiler;
32  protected $section;
33 
39  parent::__construct( null );
40  $this->profiler = $profiler;
41  $this->section = $section;
42  }
43 
44  public function __destruct() {
45  $this->profiler->profileOutInternal( $this->section );
46  }
47 }
SectionProfileCallback\$profiler
SectionProfiler $profiler
Definition: SectionProfileCallback.php:30
SectionProfileCallback\__construct
__construct(SectionProfiler $profiler, $section)
Definition: SectionProfileCallback.php:38
SectionProfileCallback\$section
string $section
Definition: SectionProfileCallback.php:32
SectionProfileCallback
Subclass ScopedCallback to avoid call_user_func_array(), which is slow.
Definition: SectionProfileCallback.php:28
SectionProfiler
Arbitrary section name based PHP profiling.
Definition: SectionProfiler.php:30
SectionProfileCallback\__destruct
__destruct()
Definition: SectionProfileCallback.php:44