/var/hpwsites/u_050media_html/website/html/private/zilver/deploy/releases/10/controllers/frontend/FrontendController.php
//@todo Should refactor all the underlying controllers to return a view
$currentPathSegment = $path->current();
if (strrpos($currentPathSegment, '.xml') !== false) {
return $this->resolveXmlResourceRequest($currentPathSegment);
}
if ($currentPathSegment === 'account' && !$this->request->isPost()) {
if (!$this->isAuthorizedRequest($path->copy())) {
$this->session->setPartialState('FRONTENDLOGIN', PartialState::INITIAL);
$this->response->setStatus(301);
$this->response->setLocation("/account/login/");
$this->session->setErrorMessage("U bent niet meer ingelogd");
return true;
}
}
$controllerName = $this->getControllerNameForUri($currentPathSegment);
if ($controllerName === null) {
throw new UrlNotFoundException(
"FrontendController: path [{$this->request->getUri()}] kan niet verwerkt worden"
);
}
$moduleName = $this->getModuleNameForController($controllerName);
$this->request->setModule($moduleName);
$result = false;
if ($this->container->has($controllerName)) {
$result = $this->container->make($controllerName)->handlePath($path);
}
if ($result === false) {
throw new UrlNotFoundException('Pagina niet gevonden');
}
if ($this->response->isRedirect()) {
return true;
}
/var/hpwsites/u_050media_html/website/html/private/zilver/deploy/releases/10/controllers/ApplicationController.php
* Execute a run based on the path given. Convention is that this function
* will return a boolean or a View class. For now there is no telling what
* it will return.
*
* @return bool|ResponseInterface|Response|View|ControllerInterface
* @throws UrlNotFoundException
*/
public function __invoke()
{
try {
$serverRequest = $this->container->get(ServerRequestInterface::class);
if (($path = $serverRequest->getUri()->getPath()) !== '/') {
// make sure URLs with and without trailing slash work on the same route
$serverRequest = $serverRequest->withUri($serverRequest->getUri()->withPath(rtrim($path, '/')));
}
return $this->container->get(RequestHandlerInterface::class)->handle($serverRequest);
} catch (\League\Route\Http\Exception\NotFoundException $nfe) {
try {
$path = $this->container->get(Path::class);
return $this->getLegacyControllerForPath($path)->handlePath($path);
} catch (UrlNotFoundException $e) {
$configurationReader = $this->container->get(ConfigurationReader::class);
if ($configurationReader->isAddonEnabled(AddonDictionary::NOT_FOUND_PAGE)) {
$twigEnvironment = $this->container->get(Environment::class);
return new Response(
$twigEnvironment->render('404.twig'),
Response::HTTP_NOT_FOUND
);
}
if ($configurationReader->isDebugEnabled()) {
throw $e;
}
return new RedirectResponse('/', 301);
}
}
}
/**
* @param Path $path
* @return ControllerInterface
/var/hpwsites/u_050media_html/website/html/private/zilver/deploy/releases/10/vendor/php-di/invoker/src/Invoker.php
$callableReflection = CallableReflection::create($callable);
$args = $this->parameterResolver->getParameters($callableReflection, $parameters, array());
// Sort by array key because call_user_func_array ignores numeric keys
ksort($args);
// Check all parameters are resolved
$diff = array_diff_key($callableReflection->getParameters(), $args);
if (! empty($diff)) {
/** @var \ReflectionParameter $parameter */
$parameter = reset($diff);
throw new NotEnoughParametersException(sprintf(
'Unable to invoke the callable because no value was given for parameter %d ($%s)',
$parameter->getPosition() + 1,
$parameter->name
));
}
return call_user_func_array($callable, $args);
}
/**
* Create the default parameter resolver.
*
* @return ParameterResolver
*/
private function createParameterResolver()
{
return new ResolverChain(array(
new NumericArrayResolver,
new AssociativeArrayResolver,
new DefaultValueResolver,
));
}
/**
* @return ParameterResolver By default it's a ResolverChain
*/
public function getParameterResolver()
/var/hpwsites/u_050media_html/website/html/private/zilver/deploy/releases/10/vendor/php-di/invoker/src/Invoker.php
$callableReflection = CallableReflection::create($callable);
$args = $this->parameterResolver->getParameters($callableReflection, $parameters, array());
// Sort by array key because call_user_func_array ignores numeric keys
ksort($args);
// Check all parameters are resolved
$diff = array_diff_key($callableReflection->getParameters(), $args);
if (! empty($diff)) {
/** @var \ReflectionParameter $parameter */
$parameter = reset($diff);
throw new NotEnoughParametersException(sprintf(
'Unable to invoke the callable because no value was given for parameter %d ($%s)',
$parameter->getPosition() + 1,
$parameter->name
));
}
return call_user_func_array($callable, $args);
}
/**
* Create the default parameter resolver.
*
* @return ParameterResolver
*/
private function createParameterResolver()
{
return new ResolverChain(array(
new NumericArrayResolver,
new AssociativeArrayResolver,
new DefaultValueResolver,
));
}
/**
* @return ParameterResolver By default it's a ResolverChain
*/
public function getParameterResolver()
/var/hpwsites/u_050media_html/website/html/private/zilver/deploy/releases/10/vendor/php-di/php-di/src/Container.php
$this->definitionResolver->resolve($definition);
return $instance;
}
/**
* Call the given function using the given parameters.
*
* Missing parameters will be resolved from the container.
*
* @param callable $callable Function to call.
* @param array $parameters Parameters to use. Can be indexed by the parameter names
* or not indexed (same order as the parameters).
* The array can also contain DI definitions, e.g. DI\get().
*
* @return mixed Result of the function.
*/
public function call($callable, array $parameters = [])
{
return $this->getInvoker()->call($callable, $parameters);
}
/**
* Define an object or a value in the container.
*
* @param string $name Entry name
* @param mixed|DefinitionHelper $value Value, use definition helpers to define objects
*/
public function set(string $name, $value)
{
if ($value instanceof DefinitionHelper) {
$value = $value->getDefinition($name);
} elseif ($value instanceof \Closure) {
$value = new FactoryDefinition($name, $value);
}
if ($value instanceof ValueDefinition) {
$this->resolvedEntries[$name] = $value->getValue();
} elseif ($value instanceof Definition) {
$value->setName($name);
/var/hpwsites/u_050media_html/website/html/private/zilver/deploy/releases/10/index.php
|| @file_get_contents(sprintf('%s/tenants/fallback/flush.flag', __DIR__)) === '1')) {
apcu_delete(\ZilverCMS\classes\DiContainerBuilder::getCacheAPCUIterator(__DIR__, $tenant));
}
$container = \ZilverCMS\classes\DiContainerBuilder::initialize(
getenv('DISABLE_DI_COMPILATION') !== '1',
$enableDiCache,
$tenant,
__DIR__ . '/di_base.php',
[
__DIR__ . '/di.php',
__DIR__ . '/di_autowire.php',
]
);
$container->get(\Whoops\Run::class)->register();
\ZilverCMS\classes\DeprecationService::setEnabled($container->get('configuration.debug'));
$controllerResponse = $container->call(\ZilverCMS\controllers\ApplicationController::class);
if ($controllerResponse instanceof \Symfony\Component\HttpFoundation\Response) {
$controllerResponse->send();
} elseif ($controllerResponse instanceof \Psr\Http\Message\ResponseInterface) {
$container->get(\ZilverCMS\classes\Http\ResponseEmitter::class)->emit($controllerResponse);
} else {
echo $container->get(OutgoingResponse::class)->send();
}