Linux srv25.usacloudserver.us 5.14.0-570.39.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Sep 4 05:08:52 EDT 2025 x86_64
LiteSpeed
Server IP : 23.137.84.82 & Your IP : 216.73.216.127
Domains :
Cant Read [ /etc/named.conf ]
User : epicgamerzoneco
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
opt /
cpguard /
app /
vendor /
twig /
twig /
src /
Extension /
Delete
Unzip
Name
Size
Permission
Date
Action
AbstractExtension.php
1.33
KB
-rw-r--r--
2025-05-08 04:26
AttributeExtension.php
6.56
KB
-rw-r--r--
2025-05-08 04:26
CoreExtension.php
71.5
KB
-rw-r--r--
2025-05-08 04:26
DebugExtension.php
1.59
KB
-rw-r--r--
2024-09-27 07:26
EscaperExtension.php
6.82
KB
-rw-r--r--
2025-05-08 04:26
ExtensionInterface.php
1.92
KB
-rw-r--r--
2025-05-08 04:26
GlobalsInterface.php
470
B
-rw-r--r--
2024-09-27 07:26
LastModifiedExtensionInterface.php
613
B
-rw-r--r--
2025-05-08 04:26
OptimizerExtension.php
539
B
-rw-r--r--
2024-09-27 07:26
ProfilerExtension.php
1.02
KB
-rw-r--r--
2024-09-27 07:26
RuntimeExtensionInterface.php
326
B
-rw-r--r--
2024-09-27 07:26
SandboxExtension.php
4.47
KB
-rw-r--r--
2025-05-08 04:26
StagingExtension.php
2.42
KB
-rw-r--r--
2024-09-27 07:26
StringLoaderExtension.php
1.01
KB
-rw-r--r--
2024-09-27 07:26
YieldNotReadyExtension.php
588
B
-rw-r--r--
2024-09-27 07:26
Save
Rename
<?php /* * This file is part of Twig. * * (c) Fabien Potencier * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Twig\Extension; use Twig\Attribute\AsTwigFilter; use Twig\Attribute\AsTwigFunction; use Twig\Attribute\AsTwigTest; use Twig\Environment; use Twig\TwigFilter; use Twig\TwigFunction; use Twig\TwigTest; /** * Define Twig filters, functions, and tests with PHP attributes. * * @author Jérôme Tamarelle <jerome@tamarelle.net> */ final class AttributeExtension extends AbstractExtension { private array $filters; private array $functions; private array $tests; /** * Use a runtime class using PHP attributes to define filters, functions, and tests. * * @param class-string $class */ public function __construct(private string $class) { } /** * @return class-string */ public function getClass(): string { return $this->class; } public function getFilters(): array { if (!isset($this->filters)) { $this->initFromAttributes(); } return $this->filters; } public function getFunctions(): array { if (!isset($this->functions)) { $this->initFromAttributes(); } return $this->functions; } public function getTests(): array { if (!isset($this->tests)) { $this->initFromAttributes(); } return $this->tests; } public function getLastModified(): int { return max( filemtime(__FILE__), is_file($filename = (new \ReflectionClass($this->getClass()))->getFileName()) ? filemtime($filename) : 0, ); } private function initFromAttributes(): void { $filters = $functions = $tests = []; $reflectionClass = new \ReflectionClass($this->getClass()); foreach ($reflectionClass->getMethods() as $method) { foreach ($method->getAttributes(AsTwigFilter::class) as $reflectionAttribute) { /** @var AsTwigFilter $attribute */ $attribute = $reflectionAttribute->newInstance(); $callable = new TwigFilter($attribute->name, [$reflectionClass->name, $method->getName()], [ 'needs_context' => $attribute->needsContext ?? false, 'needs_environment' => $attribute->needsEnvironment ?? $this->needsEnvironment($method), 'needs_charset' => $attribute->needsCharset ?? false, 'is_variadic' => $method->isVariadic(), 'is_safe' => $attribute->isSafe, 'is_safe_callback' => $attribute->isSafeCallback, 'pre_escape' => $attribute->preEscape, 'preserves_safety' => $attribute->preservesSafety, 'deprecation_info' => $attribute->deprecationInfo, ]); if ($callable->getMinimalNumberOfRequiredArguments() > $method->getNumberOfParameters()) { throw new \LogicException(sprintf('"%s::%s()" needs at least %d arguments to be used AsTwigFilter, but only %d defined.', $reflectionClass->getName(), $method->getName(), $callable->getMinimalNumberOfRequiredArguments(), $method->getNumberOfParameters())); } $filters[$attribute->name] = $callable; } foreach ($method->getAttributes(AsTwigFunction::class) as $reflectionAttribute) { /** @var AsTwigFunction $attribute */ $attribute = $reflectionAttribute->newInstance(); $callable = new TwigFunction($attribute->name, [$reflectionClass->name, $method->getName()], [ 'needs_context' => $attribute->needsContext ?? false, 'needs_environment' => $attribute->needsEnvironment ?? $this->needsEnvironment($method), 'needs_charset' => $attribute->needsCharset ?? false, 'is_variadic' => $method->isVariadic(), 'is_safe' => $attribute->isSafe, 'is_safe_callback' => $attribute->isSafeCallback, 'deprecation_info' => $attribute->deprecationInfo, ]); if ($callable->getMinimalNumberOfRequiredArguments() > $method->getNumberOfParameters()) { throw new \LogicException(sprintf('"%s::%s()" needs at least %d arguments to be used AsTwigFunction, but only %d defined.', $reflectionClass->getName(), $method->getName(), $callable->getMinimalNumberOfRequiredArguments(), $method->getNumberOfParameters())); } $functions[$attribute->name] = $callable; } foreach ($method->getAttributes(AsTwigTest::class) as $reflectionAttribute) { /** @var AsTwigTest $attribute */ $attribute = $reflectionAttribute->newInstance(); $callable = new TwigTest($attribute->name, [$reflectionClass->name, $method->getName()], [ 'needs_context' => $attribute->needsContext ?? false, 'needs_environment' => $attribute->needsEnvironment ?? $this->needsEnvironment($method), 'needs_charset' => $attribute->needsCharset ?? false, 'is_variadic' => $method->isVariadic(), 'deprecation_info' => $attribute->deprecationInfo, ]); if ($callable->getMinimalNumberOfRequiredArguments() > $method->getNumberOfParameters()) { throw new \LogicException(sprintf('"%s::%s()" needs at least %d arguments to be used AsTwigTest, but only %d defined.', $reflectionClass->getName(), $method->getName(), $callable->getMinimalNumberOfRequiredArguments(), $method->getNumberOfParameters())); } $tests[$attribute->name] = $callable; } } // Assign all at the end to avoid inconsistent state in case of exception $this->filters = array_values($filters); $this->functions = array_values($functions); $this->tests = array_values($tests); } /** * Detect if the first argument of the method is the environment. */ private function needsEnvironment(\ReflectionFunctionAbstract $function): bool { if (!$parameters = $function->getParameters()) { return false; } return $parameters[0]->getType() instanceof \ReflectionNamedType && Environment::class === $parameters[0]->getType()->getName() && !$parameters[0]->isVariadic(); } }