ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
Twig_Profiler_Dumper_Base Class Reference
+ Inheritance diagram for Twig_Profiler_Dumper_Base:
+ Collaboration diagram for Twig_Profiler_Dumper_Base:

Public Member Functions

 dump (Twig_Profiler_Profile $profile)
 

Protected Member Functions

 formatTemplate (Twig_Profiler_Profile $profile, $prefix)
 
 formatNonTemplate (Twig_Profiler_Profile $profile, $prefix)
 
 formatTime (Twig_Profiler_Profile $profile, $percent)
 

Private Member Functions

 dumpProfile (Twig_Profiler_Profile $profile, $prefix='', $sibling=false)
 

Private Attributes

 $root
 

Detailed Description

Author
Fabien Potencier fabie.nosp@m.n@sy.nosp@m.mfony.nosp@m..com

Definition at line 15 of file Base.php.

Member Function Documentation

◆ dump()

Twig_Profiler_Dumper_Base::dump ( Twig_Profiler_Profile  $profile)

Reimplemented in Twig_Profiler_Dumper_Html.

Definition at line 19 of file Base.php.

20 {
21 return $this->dumpProfile($profile);
22 }
dumpProfile(Twig_Profiler_Profile $profile, $prefix='', $sibling=false)
Definition: Base.php:30

References dumpProfile().

+ Here is the call graph for this function:

◆ dumpProfile()

Twig_Profiler_Dumper_Base::dumpProfile ( Twig_Profiler_Profile  $profile,
  $prefix = '',
  $sibling = false 
)
private

Definition at line 30 of file Base.php.

31 {
32 if ($profile->isRoot()) {
33 $this->root = $profile->getDuration();
34 $start = $profile->getName();
35 } else {
36 if ($profile->isTemplate()) {
37 $start = $this->formatTemplate($profile, $prefix);
38 } else {
39 $start = $this->formatNonTemplate($profile, $prefix);
40 }
41 $prefix .= $sibling ? '│ ' : ' ';
42 }
43
44 $percent = $this->root ? $profile->getDuration() / $this->root * 100 : 0;
45
46 if ($profile->getDuration() * 1000 < 1) {
47 $str = $start."\n";
48 } else {
49 $str = sprintf("%s %s\n", $start, $this->formatTime($profile, $percent));
50 }
51
52 $nCount = count($profile->getProfiles());
53 foreach ($profile as $i => $p) {
54 $str .= $this->dumpProfile($p, $prefix, $i + 1 !== $nCount);
55 }
56
57 return $str;
58 }
sprintf('%.4f', $callTime)
formatTime(Twig_Profiler_Profile $profile, $percent)
formatTemplate(Twig_Profiler_Profile $profile, $prefix)
formatNonTemplate(Twig_Profiler_Profile $profile, $prefix)
getDuration()
Returns the duration in microseconds.
Definition: Profile.php:89
$i
Definition: disco.tpl.php:19

References $i, dumpProfile(), formatNonTemplate(), formatTemplate(), formatTime(), Twig_Profiler_Profile\getDuration(), Twig_Profiler_Profile\getName(), Twig_Profiler_Profile\getProfiles(), Twig_Profiler_Profile\isRoot(), Twig_Profiler_Profile\isTemplate(), and sprintf.

Referenced by dump(), and dumpProfile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ formatNonTemplate()

Twig_Profiler_Dumper_Base::formatNonTemplate ( Twig_Profiler_Profile  $profile,
  $prefix 
)
abstractprotected

Reimplemented in Twig_Profiler_Dumper_Html, and Twig_Profiler_Dumper_Text.

Referenced by dumpProfile().

+ Here is the caller graph for this function:

◆ formatTemplate()

Twig_Profiler_Dumper_Base::formatTemplate ( Twig_Profiler_Profile  $profile,
  $prefix 
)
abstractprotected

Reimplemented in Twig_Profiler_Dumper_Html, and Twig_Profiler_Dumper_Text.

Referenced by dumpProfile().

+ Here is the caller graph for this function:

◆ formatTime()

Twig_Profiler_Dumper_Base::formatTime ( Twig_Profiler_Profile  $profile,
  $percent 
)
abstractprotected

Reimplemented in Twig_Profiler_Dumper_Html, and Twig_Profiler_Dumper_Text.

Referenced by dumpProfile().

+ Here is the caller graph for this function:

Field Documentation

◆ $root

Twig_Profiler_Dumper_Base::$root
private

Definition at line 17 of file Base.php.


The documentation for this class was generated from the following file: