⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.103
Server IP:
45.79.8.107
Server:
Linux localhost 5.15.0-161-generic #171-Ubuntu SMP Sat Oct 11 08:17:01 UTC 2025 x86_64
Server Software:
nginx/1.18.0
PHP Version:
8.1.2-1ubuntu2.22
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
php
/
Twig
/
Profiler
/
NodeVisitor
/
View File Name :
ProfilerNodeVisitor.php
*/ final class ProfilerNodeVisitor implements NodeVisitorInterface { private $extensionName; private $varName; public function __construct(string $extensionName) { $this->extensionName = $extensionName; $this->varName = sprintf('__internal_%s', hash(\PHP_VERSION_ID < 80100 ? 'sha256' : 'xxh128', $extensionName)); } public function enterNode(Node $node, Environment $env): Node { return $node; } public function leaveNode(Node $node, Environment $env): ?Node { if ($node instanceof ModuleNode) { $node->setNode('display_start', new Node([new EnterProfileNode($this->extensionName, Profile::TEMPLATE, $node->getTemplateName(), $this->varName), $node->getNode('display_start')])); $node->setNode('display_end', new Node([new LeaveProfileNode($this->varName), $node->getNode('display_end')])); } elseif ($node instanceof BlockNode) { $node->setNode('body', new BodyNode([ new EnterProfileNode($this->extensionName, Profile::BLOCK, $node->getAttribute('name'), $this->varName), $node->getNode('body'), new LeaveProfileNode($this->varName), ])); } elseif ($node instanceof MacroNode) { $node->setNode('body', new BodyNode([ new EnterProfileNode($this->extensionName, Profile::MACRO, $node->getAttribute('name'), $this->varName), $node->getNode('body'), new LeaveProfileNode($this->varName), ])); } return $node; } public function getPriority(): int { return 0; } }