/home/wamrmelissen/domains/emmelissen.nl/public_html/themes/emmelissen/html/error.html.twig
{% block breadcrumb %}
<li class="active breadcrumb-item" aria-current="page">{{ exception.getCode }}</li>
{% endblock %}
{% block content %}
<div class="row">
<div class="col-md-12 my-5">
<div class="d-flex flex-column py-5">
<div class="d-flex justify-content-center">
{% if exception.getCode %}
<h1 class="display-1">{{ exception.getCode }}</h1>
{% else %}
<h1 class="display-1">404</h1>
{% endif %}
</div>
<div class="d-flex flex-column justify-content-center text-center">
<span>{{ 'Whoops! Unable to find the page you are looking for'|trans }}.</span>
<span>{{ exception.getMessage }}</span>
<div class="mt-3">
<a class="btn btn-sm btn-primary" href="{{ '/' | link}}">{{ 'Go back to home'|trans }}</a>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
Arguments
"Unknown "link" filter in "error.html.twig" at line 26."
/home/wamrmelissen/domains/emmelissen.nl/public_html/vendor/twig/twig/src/ExpressionParser/Infix/FilterExpressionParser.php
*/
final class FilterExpressionParser extends AbstractExpressionParser implements InfixExpressionParserInterface, ExpressionParserDescriptionInterface
{
use ArgumentsTrait;
private $readyNodes = [];
public function parse(Parser $parser, AbstractExpression $expr, Token $token): AbstractExpression
{
$stream = $parser->getStream();
$token = $stream->expect(Token::NAME_TYPE);
$line = $token->getLine();
if (!$stream->test(Token::OPERATOR_TYPE, '(')) {
$arguments = new EmptyNode();
} else {
$arguments = $this->parseNamedArguments($parser);
}
$filter = $parser->getFilter($token->getValue(), $line);
$ready = true;
if (!isset($this->readyNodes[$class = $filter->getNodeClass()])) {
$this->readyNodes[$class] = (bool) (new \ReflectionClass($class))->getConstructor()->getAttributes(FirstClassTwigCallableReady::class);
}
if (!$ready = $this->readyNodes[$class]) {
trigger_deprecation('twig/twig', '3.12', 'Twig node "%s" is not marked as ready for passing a "TwigFilter" in the constructor instead of its name; please update your code and then add #[FirstClassTwigCallableReady] attribute to the constructor.', $class);
}
return new $class($expr, $ready ? $filter : new ConstantExpression($filter->getName(), $line), $arguments, $line);
}
public function getName(): string
{
return '|';
}
public function getDescription(): string
{
/home/wamrmelissen/domains/emmelissen.nl/public_html/vendor/twig/twig/src/Parser.php
}
return $this->expressionParser;
}
public function parseExpression(int $precedence = 0): AbstractExpression
{
$token = $this->getCurrentToken();
if ($token->test(Token::OPERATOR_TYPE) && $ep = $this->parsers->getByName(PrefixExpressionParserInterface::class, $token->getValue())) {
$this->getStream()->next();
$expr = $ep->parse($this, $token);
$this->checkPrecedenceDeprecations($ep, $expr);
} else {
$expr = $this->parsers->getByClass(LiteralExpressionParser::class)->parse($this, $token);
}
$token = $this->getCurrentToken();
while ($token->test(Token::OPERATOR_TYPE) && ($ep = $this->parsers->getByName(InfixExpressionParserInterface::class, $token->getValue())) && $ep->getPrecedence() >= $precedence) {
$this->getStream()->next();
$expr = $ep->parse($this, $expr, $token);
$this->checkPrecedenceDeprecations($ep, $expr);
$token = $this->getCurrentToken();
}
return $expr;
}
public function getParent(): ?Node
{
trigger_deprecation('twig/twig', '3.12', 'Method "%s()" is deprecated.', __METHOD__);
return $this->parent;
}
/**
* @return bool
*/
public function hasInheritance()
{
return $this->parent || 0 < \count($this->traits);
/home/wamrmelissen/domains/emmelissen.nl/public_html/vendor/twig/twig/src/Parser.php
}
}
/**
* @throws SyntaxError
*/
public function subparse($test, bool $dropNeedle = false): Node
{
$lineno = $this->getCurrentToken()->getLine();
$rv = [];
while (!$this->stream->isEOF()) {
switch (true) {
case $this->stream->getCurrent()->test(Token::TEXT_TYPE):
$token = $this->stream->next();
$rv[] = new TextNode($token->getValue(), $token->getLine());
break;
case $this->stream->getCurrent()->test(Token::VAR_START_TYPE):
$token = $this->stream->next();
$expr = $this->parseExpression();
$this->stream->expect(Token::VAR_END_TYPE);
$rv[] = new PrintNode($expr, $token->getLine());
break;
case $this->stream->getCurrent()->test(Token::BLOCK_START_TYPE):
$this->stream->next();
$token = $this->getCurrentToken();
if (!$token->test(Token::NAME_TYPE)) {
throw new SyntaxError('A block must start with a tag name.', $token->getLine(), $this->stream->getSourceContext());
}
if (null !== $test && $test($token)) {
if ($dropNeedle) {
$this->stream->next();
}
if (1 === \count($rv)) {
return $rv[0];
}
/home/wamrmelissen/domains/emmelissen.nl/public_html/vendor/twig/twig/src/TokenParser/BlockTokenParser.php
* {% block head %}
* <link rel="stylesheet" href="style.css" />
* <title>{% block title %}{% endblock %} - My Webpage</title>
* {% endblock %}
*
* @internal
*/
final class BlockTokenParser extends AbstractTokenParser
{
public function parse(Token $token): Node
{
$lineno = $token->getLine();
$stream = $this->parser->getStream();
$name = $stream->expect(Token::NAME_TYPE)->getValue();
$this->parser->setBlock($name, $block = new BlockNode($name, new EmptyNode(), $lineno));
$this->parser->pushLocalScope();
$this->parser->pushBlockStack($name);
if ($stream->nextIf(Token::BLOCK_END_TYPE)) {
$body = $this->parser->subparse([$this, 'decideBlockEnd'], true);
if ($token = $stream->nextIf(Token::NAME_TYPE)) {
$value = $token->getValue();
if ($value != $name) {
throw new SyntaxError(\sprintf('Expected endblock for block "%s" (but "%s" given).', $name, $value), $stream->getCurrent()->getLine(), $stream->getSourceContext());
}
}
} else {
$body = new Nodes([
new PrintNode($this->parser->parseExpression(), $lineno),
]);
}
$stream->expect(Token::BLOCK_END_TYPE);
$block->setNode('body', $body);
$this->parser->popBlockStack();
$this->parser->popLocalScope();
return new BlockReferenceNode($name, $lineno);
}
/home/wamrmelissen/domains/emmelissen.nl/public_html/vendor/twig/twig/src/Parser.php
if (!$subparser = $this->env->getTokenParser($token->getValue())) {
if (null !== $test) {
$e = new SyntaxError(\sprintf('Unexpected "%s" tag', $token->getValue()), $token->getLine(), $this->stream->getSourceContext());
$callable = (new ReflectionCallable(new TwigTest('decision', $test)))->getCallable();
if (\is_array($callable) && $callable[0] instanceof TokenParserInterface) {
$e->appendMessage(\sprintf(' (expecting closing tag for the "%s" tag defined near line %s).', $callable[0]->getTag(), $lineno));
}
} else {
$e = new SyntaxError(\sprintf('Unknown "%s" tag.', $token->getValue()), $token->getLine(), $this->stream->getSourceContext());
$e->addSuggestions($token->getValue(), array_keys($this->env->getTokenParsers()));
}
throw $e;
}
$this->stream->next();
$subparser->setParser($this);
$node = $subparser->parse($token);
if (!$node) {
trigger_deprecation('twig/twig', '3.12', 'Returning "null" from "%s" is deprecated and forbidden by "TokenParserInterface".', $subparser::class);
} else {
$node->setNodeTag($subparser->getTag());
$rv[] = $node;
}
break;
default:
throw new SyntaxError('The lexer or the parser ended up in an unsupported state.', $this->getCurrentToken()->getLine(), $this->stream->getSourceContext());
}
}
if (1 === \count($rv)) {
return $rv[0];
}
return new Nodes($rv, $lineno);
}
/home/wamrmelissen/domains/emmelissen.nl/public_html/vendor/twig/twig/src/Parser.php
unset($vars['stack'], $vars['env'], $vars['handlers'], $vars['visitors'], $vars['expressionParser'], $vars['reservedMacroNames'], $vars['lastEmbedIndex'], $vars['varNameSalt']);
$this->stack[] = $vars;
// node visitors
if (null === $this->visitors) {
$this->visitors = $this->env->getNodeVisitors();
}
$this->stream = $stream;
$this->parent = null;
$this->blocks = [];
$this->macros = [];
$this->traits = [];
$this->blockStack = [];
$this->importedSymbols = [[]];
$this->embeddedTemplates = [];
$this->expressionRefs = new \WeakMap();
try {
$body = $this->subparse($test, $dropNeedle);
if (null !== $this->parent && null === $body = $this->filterBodyNodes($body)) {
$body = new EmptyNode();
}
} catch (SyntaxError $e) {
if (!$e->getSourceContext()) {
$e->setSourceContext($this->stream->getSourceContext());
}
if (!$e->getTemplateLine()) {
$e->setTemplateLine($this->getCurrentToken()->getLine());
}
throw $e;
} finally {
$this->expressionRefs = null;
}
$node = new ModuleNode(
new BodyNode([$body]),
/home/wamrmelissen/domains/emmelissen.nl/public_html/vendor/twig/twig/src/Environment.php
/**
* @return void
*/
public function setParser(Parser $parser)
{
$this->parser = $parser;
}
/**
* Converts a token stream to a node tree.
*
* @throws SyntaxError When the token stream is syntactically or semantically wrong
*/
public function parse(TokenStream $stream): ModuleNode
{
if (null === $this->parser) {
$this->parser = new Parser($this);
}
return $this->parser->parse($stream);
}
/**
* @return void
*/
public function setCompiler(Compiler $compiler)
{
$this->compiler = $compiler;
}
/**
* Compiles a node and returns the PHP code.
*/
public function compile(Node $node): string
{
if (null === $this->compiler) {
$this->compiler = new Compiler($this);
}
return $this->compiler->compile($node)->getSource();
/home/wamrmelissen/domains/emmelissen.nl/public_html/vendor/twig/twig/src/Environment.php
* Compiles a node and returns the PHP code.
*/
public function compile(Node $node): string
{
if (null === $this->compiler) {
$this->compiler = new Compiler($this);
}
return $this->compiler->compile($node)->getSource();
}
/**
* Compiles a template source code.
*
* @throws SyntaxError When there was an error during tokenizing, parsing or compiling
*/
public function compileSource(Source $source): string
{
try {
return $this->compile($this->parse($this->tokenize($source)));
} catch (Error $e) {
$e->setSourceContext($source);
throw $e;
} catch (\Exception $e) {
throw new SyntaxError(\sprintf('An exception has been thrown during the compilation of a template ("%s").', $e->getMessage()), -1, $source, $e);
}
}
/**
* @return void
*/
public function setLoader(LoaderInterface $loader)
{
$this->loader = $loader;
}
public function getLoader(): LoaderInterface
{
return $this->loader;
}
/home/wamrmelissen/domains/emmelissen.nl/public_html/vendor/twig/twig/src/Environment.php
{
$mainCls = $cls;
if (null !== $index) {
$cls .= '___'.$index;
}
if (isset($this->loadedTemplates[$cls])) {
return $this->loadedTemplates[$cls];
}
if (!class_exists($cls, false)) {
$key = $this->cache->generateKey($name, $mainCls);
if (!$this->isAutoReload() || $this->isTemplateFresh($name, $this->cache->getTimestamp($key))) {
$this->cache->load($key);
}
if (!class_exists($cls, false)) {
$source = $this->getLoader()->getSourceContext($name);
$content = $this->compileSource($source);
if (!isset($this->hotCache[$name])) {
$this->cache->write($key, $content);
$this->cache->load($key);
}
if (!class_exists($mainCls, false)) {
/* Last line of defense if either $this->bcWriteCacheFile was used,
* $this->cache is implemented as a no-op or we have a race condition
* where the cache was cleared between the above calls to write to and load from
* the cache.
*/
eval('?>'.$content);
}
if (!class_exists($cls, false)) {
throw new RuntimeError(\sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source);
}
}
}
/home/wamrmelissen/domains/emmelissen.nl/public_html/vendor/twig/twig/src/Environment.php
* Loads a template.
*
* @param string|TemplateWrapper $name The template name
*
* @throws LoaderError When the template cannot be found
* @throws RuntimeError When a previously generated cache is corrupted
* @throws SyntaxError When an error occurred during compilation
*/
public function load($name): TemplateWrapper
{
if ($name instanceof TemplateWrapper) {
return $name;
}
if ($name instanceof Template) {
trigger_deprecation('twig/twig', '3.9', 'Passing a "%s" instance to "%s" is deprecated.', self::class, __METHOD__);
return $name;
}
return new TemplateWrapper($this, $this->loadTemplate($this->getTemplateClass($name), $name));
}
/**
* Loads a template internal representation.
*
* This method is for internal use only and should never be called
* directly.
*
* @param string $name The template name
* @param int|null $index The index if it is an embedded template
*
* @throws LoaderError When the template cannot be found
* @throws RuntimeError When a previously generated cache is corrupted
* @throws SyntaxError When an error occurred during compilation
*
* @internal
*/
public function loadTemplate(string $cls, string $name, ?int $index = null): Template
{
$mainCls = $cls;
/home/wamrmelissen/domains/emmelissen.nl/public_html/library/Box/AppClient.php
// @phpstan-ignore if.alwaysFalse (DEBUG is a runtime constant that may be true during debugging)
if (DEBUG) {
error_log($e->getMessage());
}
}
$e = new FOSSBilling\InformationException('Page :url not found', [':url' => $this->url], 404);
$this->di['logger']->setChannel('routing')->info($e->getMessage());
return $this->errorResponse($e, 404);
}
/**
* @param string $fileName
*/
#[Override]
public function render($fileName, $variableArray = [], $ext = 'html.twig'): string
{
try {
$template = $this->getTwig()->load(Path::changeExtension($fileName, $ext));
} catch (Twig\Error\LoaderError $e) {
$this->di['logger']->setChannel('routing')->info($e->getMessage());
throw new FOSSBilling\InformationException('Page not found', null, 404);
}
return $template->render($variableArray);
}
/**
* Get Twig environment for client area.
*/
protected function getTwig(): Twig\Environment
{
$twigFactory = $this->di['twig_factory'];
return $twigFactory->createClientEnvironment($this->debugBar);
}
}
/home/wamrmelissen/domains/emmelissen.nl/public_html/library/Box/App.php
return $this->request;
}
protected function getRequestPath(): string
{
return RequestFactory::getRoutePath($this->getRequest());
}
protected function normalizeResponse(mixed $result): Response
{
if ($result instanceof Response) {
return $result;
}
return new Response((string) ($result ?? ''));
}
public function renderResponse(string $fileName, array $variableArray = [], int $statusCode = 200, array $headers = []): Response
{
$response = new Response($this->render($fileName, $variableArray), $statusCode);
$response->headers->add($headers);
return $response;
}
public function errorResponse(Exception $e, ?int $statusCode = null, array $headers = []): Response
{
$statusCode ??= $e->getCode() > 0 ? $e->getCode() : 500;
return $this->renderResponse('error', ['exception' => $e], $statusCode, $headers);
}
public function abortWithResponse(Response $response): never
{
throw new HttpResponseException($response);
}
public function run(): Response
{
/** @var TimeDataCollector $timeCollector */
/home/wamrmelissen/domains/emmelissen.nl/public_html/library/Box/App.php
if ($result instanceof Response) {
return $result;
}
return new Response((string) ($result ?? ''));
}
public function renderResponse(string $fileName, array $variableArray = [], int $statusCode = 200, array $headers = []): Response
{
$response = new Response($this->render($fileName, $variableArray), $statusCode);
$response->headers->add($headers);
return $response;
}
public function errorResponse(Exception $e, ?int $statusCode = null, array $headers = []): Response
{
$statusCode ??= $e->getCode() > 0 ? $e->getCode() : 500;
return $this->renderResponse('error', ['exception' => $e], $statusCode, $headers);
}
public function abortWithResponse(Response $response): never
{
throw new HttpResponseException($response);
}
public function run(): Response
{
/** @var TimeDataCollector $timeCollector */
$timeCollector = $this->debugBar->getCollector('time');
try {
$timeCollector->startMeasure('registerModule', 'Registering module routes');
$this->registerModule();
$timeCollector->stopMeasure('registerModule');
$timeCollector->startMeasure('init', 'Initializing the app');
$this->init();
$timeCollector->stopMeasure('init');
/home/wamrmelissen/domains/emmelissen.nl/public_html/library/Box/AppClient.php
try {
$content = $this->render($tpl, ['post' => $this->getRequest()->request->all()], $ext);
if ("{$tpl}.{$ext}" === 'mod_page_sitemap.xml') {
return new Response($content, 200, ['Content-Type' => 'application/xml']);
}
return new Response($content);
} catch (Exception $e) {
// @phpstan-ignore if.alwaysFalse (DEBUG is a runtime constant that may be true during debugging)
if (DEBUG) {
error_log($e->getMessage());
}
}
$e = new FOSSBilling\InformationException('Page :url not found', [':url' => $this->url], 404);
$this->di['logger']->setChannel('routing')->info($e->getMessage());
return $this->errorResponse($e, 404);
}
/**
* @param string $fileName
*/
#[Override]
public function render($fileName, $variableArray = [], $ext = 'html.twig'): string
{
try {
$template = $this->getTwig()->load(Path::changeExtension($fileName, $ext));
} catch (Twig\Error\LoaderError $e) {
$this->di['logger']->setChannel('routing')->info($e->getMessage());
throw new FOSSBilling\InformationException('Page not found', null, 404);
}
return $template->render($variableArray);
}
/**
/home/wamrmelissen/domains/emmelissen.nl/public_html/library/Box/App.php
{
/** @var TimeDataCollector $timeCollector */
$timeCollector = $this->debugBar->getCollector('time');
$timeCollector->startMeasure('execute', 'Reflecting module controller');
$reflection = new ReflectionMethod(static::class, $methodName);
$args = [];
foreach ($reflection->getParameters() as $param) {
if (isset($params[$param->name])) {
$args[$param->name] = $params[$param->name];
} elseif ($param->isDefaultValueAvailable()) {
$args[$param->name] = $param->getDefaultValue();
}
}
$timeCollector->stopMeasure('execute');
return $reflection->invokeArgs($this, $args);
}
protected function event(string $httpMethod, string $url, string $methodName, ?array $conditions = [], ?string $classname = null): void
{
if (method_exists($this, $methodName)) {
$this->mappings[] = [$httpMethod, $url, $methodName, $conditions];
}
if ($classname !== null) {
$this->shared[] = [$httpMethod, $url, $methodName, $conditions, $classname];
}
}
protected function checkAllowedURLs(): bool
{
$requestPath = $this->getRequestPath();
$allowedURLs = Config::getProperty('maintenance_mode.allowed_urls', []);
// Allow access to the staff panel all the time
$adminApiPrefixes = [
'/api/guest/staff/login',
/home/wamrmelissen/domains/emmelissen.nl/public_html/library/Box/App.php
$mapping = $this->shared[$i];
$url = new Box_UrlHelper($mapping[0], $mapping[1], $mapping[3], $this->url, $this->getRequest()->getMethod());
if ($url->match) {
$timeCollector->stopMeasure('sharedMapping');
return $this->normalizeResponse($this->executeShared($mapping[4], $mapping[2], $url->params));
}
}
$timeCollector->stopMeasure('sharedMapping');
// this class mappings
$timeCollector->startMeasure('mapping', 'Checking mappings');
$mappingsCount = count($this->mappings);
for ($i = 0; $i < $mappingsCount; ++$i) {
$mapping = $this->mappings[$i];
$url = new Box_UrlHelper($mapping[0], $mapping[1], $mapping[3], $this->url, $this->getRequest()->getMethod());
if ($url->match) {
$timeCollector->stopMeasure('mapping');
return $this->normalizeResponse($this->execute($mapping[2], $url->params));
}
}
$timeCollector->stopMeasure('mapping');
$e = new FOSSBilling\InformationException('Page :url not found', [':url' => $this->url], 404);
return $this->show404($e);
}
}
/home/wamrmelissen/domains/emmelissen.nl/public_html/library/Box/App.php
public function run(): Response
{
/** @var TimeDataCollector $timeCollector */
$timeCollector = $this->debugBar->getCollector('time');
try {
$timeCollector->startMeasure('registerModule', 'Registering module routes');
$this->registerModule();
$timeCollector->stopMeasure('registerModule');
$timeCollector->startMeasure('init', 'Initializing the app');
$this->init();
$timeCollector->stopMeasure('init');
$timeCollector->startMeasure('checkperm', 'Checking access to module');
$this->checkPermission();
$timeCollector->stopMeasure('checkperm');
return $this->processRequest();
} catch (AuthenticationRequiredException $e) {
if ($e->getArea() === 'admin') {
$this->di['set_return_uri'];
return new RedirectResponse($this->di['url']->adminLink('staff/login'));
}
$this->di['set_return_uri'];
return new RedirectResponse($this->di['url']->link('login'));
} catch (EmailValidationRequiredException) {
return new RedirectResponse($this->di['url']->link('client/profile'));
} catch (HttpResponseException $e) {
return $e->getResponse();
}
}
/**
* @param string $path
*/
/home/wamrmelissen/domains/emmelissen.nl/public_html/index.php
$timeCollector?->stopMeasure('translate');
// If HTTP error code has been passed, handle it.
if (!is_null($http_err_code)) {
$http_err_code = intval($http_err_code);
switch ($http_err_code) {
case 404:
$e = new FOSSBilling\Exception('Page :url not found', [':url' => $url], 404);
$app->show404($e)->send();
break;
default:
$e = new FOSSBilling\Exception('HTTP Error :err_code occurred while attempting to load :url', [':err_code' => $http_err_code, ':url' => $url], $http_err_code);
(new Response($app->render('error', ['exception' => $e]), $http_err_code))->send();
}
exit;
}
// If no HTTP error passed, run the app.
$app->run()->send();
exit;