X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Ftwig%2Ftwig%2Flib%2FTwig%2FExtension%2FProfiler.php;fp=vendor%2Ftwig%2Ftwig%2Flib%2FTwig%2FExtension%2FProfiler.php;h=1d874ef8e840ece78da3ea2e56c83f0b93a30cf3;hp=0000000000000000000000000000000000000000;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad diff --git a/vendor/twig/twig/lib/Twig/Extension/Profiler.php b/vendor/twig/twig/lib/Twig/Extension/Profiler.php new file mode 100644 index 000000000..1d874ef8e --- /dev/null +++ b/vendor/twig/twig/lib/Twig/Extension/Profiler.php @@ -0,0 +1,46 @@ +actives[] = $profile; + } + + public function enter(Twig_Profiler_Profile $profile) + { + $this->actives[0]->addProfile($profile); + array_unshift($this->actives, $profile); + } + + public function leave(Twig_Profiler_Profile $profile) + { + $profile->leave(); + array_shift($this->actives); + + if (1 === count($this->actives)) { + $this->actives[0]->leave(); + } + } + + public function getNodeVisitors() + { + return array(new Twig_Profiler_NodeVisitor_Profiler(get_class($this))); + } + + public function getName() + { + return 'profiler'; + } +}