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)

Definition at line 19 of file Base.php.

References dumpProfile(), formatNonTemplate(), formatTemplate(), and formatTime().

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

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

Referenced by dump().

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  }
formatTemplate(Twig_Profiler_Profile $profile, $prefix)
dumpProfile(Twig_Profiler_Profile $profile, $prefix='', $sibling=false)
Definition: Base.php:30
formatNonTemplate(Twig_Profiler_Profile $profile, $prefix)
$i
Definition: disco.tpl.php:19
getDuration()
Returns the duration in microseconds.
Definition: Profile.php:89
formatTime(Twig_Profiler_Profile $profile, $percent)
+ 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

Referenced by dump(), and dumpProfile().

+ Here is the caller graph for this function:

◆ formatTemplate()

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

Referenced by dump(), and dumpProfile().

+ Here is the caller graph for this function:

◆ formatTime()

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

Referenced by dump(), and 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: