/var/www/erfcms8.7/App/Cms.php
if (config()->get('news.enabled')) {
$router->get('/news', [NewsCrudController::class, 'getResponse']);
$router->post('/news', [NewsCrudController::class, 'postResponse']);
}
if (config()->get('calendar.enabled')) {
$router->get('/calendar', [CalendarCrudController::class, 'getResponse']);
$router->post('/calendar', [CalendarCrudController::class, 'postResponse']);
}
if (config()->get('comments.enabled')) {
$router->get('/comments', [CommentsCrudController::class, 'getResponse']);
$router->post('/comments', [CommentsCrudController::class, 'postResponse']);
}
}
);
// ------------------------------------------
$this->router->any('{any}', function () {
throw new Exception('', 410);
})->where('any', '(.*)');
}
}
Arguments
/var/www/erfcms8.7/vendor/illuminate/routing/CallableDispatcher.php
* Create a new callable dispatcher instance.
*
* @param \Illuminate\Container\Container $container
* @return void
*/
public function __construct(Container $container)
{
$this->container = $container;
}
/**
* Dispatch a request to a given callable.
*
* @param \Illuminate\Routing\Route $route
* @param callable $callable
* @return mixed
*/
public function dispatch(Route $route, $callable)
{
return $callable(...array_values($this->resolveParameters($route, $callable)));
}
/**
* Resolve the parameters for the callable.
*
* @param \Illuminate\Routing\Route $route
* @param callable $callable
* @return array
*/
protected function resolveParameters(Route $route, $callable)
{
return $this->resolveMethodDependencies($route->parametersWithoutNulls(), new ReflectionFunction($callable));
}
}
/var/www/erfcms8.7/vendor/illuminate/routing/Route.php
*/
protected function isControllerAction()
{
return is_string($this->action['uses']) && ! $this->isSerializedClosure();
}
/**
* Run the route action and return the response.
*
* @return mixed
*/
protected function runCallable()
{
$callable = $this->action['uses'];
if ($this->isSerializedClosure()) {
$callable = unserialize($this->action['uses'])->getClosure();
}
return $this->container[CallableDispatcher::class]->dispatch($this, $callable);
}
/**
* Determine if the route action is a serialized Closure.
*
* @return bool
*/
protected function isSerializedClosure()
{
return RouteAction::containsSerializedClosure($this->action);
}
/**
* Run the route action and return the response.
*
* @return mixed
*
* @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
*/
protected function runController()
/var/www/erfcms8.7/vendor/illuminate/routing/Route.php
protected function parseAction($action)
{
return RouteAction::parse($this->uri, $action);
}
/**
* Run the route action and return the response.
*
* @return mixed
*/
public function run()
{
$this->container = $this->container ?: new Container;
try {
if ($this->isControllerAction()) {
return $this->runController();
}
return $this->runCallable();
} catch (HttpResponseException $e) {
return $e->getResponse();
}
}
/**
* Checks whether the route's action is a controller.
*
* @return bool
*/
protected function isControllerAction()
{
return is_string($this->action['uses']) && ! $this->isSerializedClosure();
}
/**
* Run the route action and return the response.
*
* @return mixed
*/
/var/www/erfcms8.7/vendor/illuminate/routing/Router.php
/**
* Run the given route within a Stack "onion" instance.
*
* @param \Illuminate\Routing\Route $route
* @param \Illuminate\Http\Request $request
* @return mixed
*/
protected function runRouteWithinStack(Route $route, Request $request)
{
$shouldSkipMiddleware = $this->container->bound('middleware.disable') &&
$this->container->make('middleware.disable') === true;
$middleware = $shouldSkipMiddleware ? [] : $this->gatherRouteMiddleware($route);
return (new Pipeline($this->container))
->send($request)
->through($middleware)
->then(fn ($request) => $this->prepareResponse(
$request, $route->run()
));
}
/**
* Gather the middleware for the given route with resolved class names.
*
* @param \Illuminate\Routing\Route $route
* @return array
*/
public function gatherRouteMiddleware(Route $route)
{
return $this->resolveMiddleware($route->gatherMiddleware(), $route->excludedMiddleware());
}
/**
* Resolve a flat array of middleware classes from the provided array.
*
* @param array $middleware
* @param array $excluded
* @return array
/var/www/erfcms8.7/vendor/illuminate/pipeline/Pipeline.php
* @return mixed
*/
public function thenReturn()
{
return $this->then(function ($passable) {
return $passable;
});
}
/**
* Get the final piece of the Closure onion.
*
* @param \Closure $destination
* @return \Closure
*/
protected function prepareDestination(Closure $destination)
{
return function ($passable) use ($destination) {
try {
return $destination($passable);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
}
};
}
/**
* Get a Closure that represents a slice of the application onion.
*
* @return \Closure
*/
protected function carry()
{
return function ($stack, $pipe) {
return function ($passable) use ($stack, $pipe) {
try {
if (is_callable($pipe)) {
// If the pipe is a callable, then we will call it directly, but otherwise we
// will resolve the pipes out of the dependency container and call it with
// the appropriate method and arguments, returning the results back out.
/var/www/erfcms8.7/vendor/illuminate/pipeline/Pipeline.php
public function via($method)
{
$this->method = $method;
return $this;
}
/**
* Run the pipeline with a final destination callback.
*
* @param \Closure $destination
* @return mixed
*/
public function then(Closure $destination)
{
$pipeline = array_reduce(
array_reverse($this->pipes()), $this->carry(), $this->prepareDestination($destination)
);
return $pipeline($this->passable);
}
/**
* Run the pipeline and return the result.
*
* @return mixed
*/
public function thenReturn()
{
return $this->then(function ($passable) {
return $passable;
});
}
/**
* Get the final piece of the Closure onion.
*
* @param \Closure $destination
* @return \Closure
*/
/var/www/erfcms8.7/vendor/illuminate/routing/Router.php
}
/**
* Run the given route within a Stack "onion" instance.
*
* @param \Illuminate\Routing\Route $route
* @param \Illuminate\Http\Request $request
* @return mixed
*/
protected function runRouteWithinStack(Route $route, Request $request)
{
$shouldSkipMiddleware = $this->container->bound('middleware.disable') &&
$this->container->make('middleware.disable') === true;
$middleware = $shouldSkipMiddleware ? [] : $this->gatherRouteMiddleware($route);
return (new Pipeline($this->container))
->send($request)
->through($middleware)
->then(fn ($request) => $this->prepareResponse(
$request, $route->run()
));
}
/**
* Gather the middleware for the given route with resolved class names.
*
* @param \Illuminate\Routing\Route $route
* @return array
*/
public function gatherRouteMiddleware(Route $route)
{
return $this->resolveMiddleware($route->gatherMiddleware(), $route->excludedMiddleware());
}
/**
* Resolve a flat array of middleware classes from the provided array.
*
* @param array $middleware
* @param array $excluded
/var/www/erfcms8.7/vendor/illuminate/routing/Router.php
$this->container->instance(Route::class, $route);
return $route;
}
/**
* Return the response for the given route.
*
* @param \Illuminate\Http\Request $request
* @param \Illuminate\Routing\Route $route
* @return \Symfony\Component\HttpFoundation\Response
*/
protected function runRoute(Request $request, Route $route)
{
$request->setRouteResolver(fn () => $route);
$this->events->dispatch(new RouteMatched($route, $request));
return $this->prepareResponse($request,
$this->runRouteWithinStack($route, $request)
);
}
/**
* Run the given route within a Stack "onion" instance.
*
* @param \Illuminate\Routing\Route $route
* @param \Illuminate\Http\Request $request
* @return mixed
*/
protected function runRouteWithinStack(Route $route, Request $request)
{
$shouldSkipMiddleware = $this->container->bound('middleware.disable') &&
$this->container->make('middleware.disable') === true;
$middleware = $shouldSkipMiddleware ? [] : $this->gatherRouteMiddleware($route);
return (new Pipeline($this->container))
->send($request)
->through($middleware)
/var/www/erfcms8.7/vendor/illuminate/routing/Router.php
*
* @param \Illuminate\Http\Request $request
* @return \Symfony\Component\HttpFoundation\Response
*/
public function dispatch(Request $request)
{
$this->currentRequest = $request;
return $this->dispatchToRoute($request);
}
/**
* Dispatch the request to a route and return the response.
*
* @param \Illuminate\Http\Request $request
* @return \Symfony\Component\HttpFoundation\Response
*/
public function dispatchToRoute(Request $request)
{
return $this->runRoute($request, $this->findRoute($request));
}
/**
* Find the route matching a given request.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Routing\Route
*/
protected function findRoute($request)
{
$this->events->dispatch(new Routing($request));
$this->current = $route = $this->routes->match($request);
$route->setContainer($this->container);
$this->container->instance(Route::class, $route);
return $route;
}
/var/www/erfcms8.7/vendor/illuminate/routing/Router.php
* @return \Symfony\Component\HttpFoundation\Response
*/
public function respondWithRoute($name)
{
$route = tap($this->routes->getByName($name))->bind($this->currentRequest);
return $this->runRoute($this->currentRequest, $route);
}
/**
* Dispatch the request to the application.
*
* @param \Illuminate\Http\Request $request
* @return \Symfony\Component\HttpFoundation\Response
*/
public function dispatch(Request $request)
{
$this->currentRequest = $request;
return $this->dispatchToRoute($request);
}
/**
* Dispatch the request to a route and return the response.
*
* @param \Illuminate\Http\Request $request
* @return \Symfony\Component\HttpFoundation\Response
*/
public function dispatchToRoute(Request $request)
{
return $this->runRoute($request, $this->findRoute($request));
}
/**
* Find the route matching a given request.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Routing\Route
*/
protected function findRoute($request)
/var/www/erfcms8.7/App/Cms.php
if ($this->isAuthenticated()) {
Cms::$adminControlsEnabled = true;
}
}
public function run(): void
{
try {
MenuModel::exists();
$this->moduleMapper->getModules(); // This initializes all Blocks.
$this->registerRoutes();
} catch (Exception) {
$this->registerInstallRoutes();
}
$response = $this->pipeline
->send($this->request)
->through([Canonical::class])
->then(function ($request) {
return $this->router->dispatch($request);
});
/** @var Response $response */
$response->send();
}
public function registerInstallRoutes(): void
{
$this->router->get('/', [InstallController::class, 'show']);
$this->router->post('/', [InstallController::class, 'install']);
}
public function registerRoutes(): void
{
$defined = [];
// ------------------------------------------
$this->router->get('/sitemap.xml', [SitemapController::class, 'show']);
$this->router->get('/robots.txt', [RobotsController::class, 'show']);
/var/www/erfcms8.7/vendor/illuminate/pipeline/Pipeline.php
* @return mixed
*/
public function thenReturn()
{
return $this->then(function ($passable) {
return $passable;
});
}
/**
* Get the final piece of the Closure onion.
*
* @param \Closure $destination
* @return \Closure
*/
protected function prepareDestination(Closure $destination)
{
return function ($passable) use ($destination) {
try {
return $destination($passable);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
}
};
}
/**
* Get a Closure that represents a slice of the application onion.
*
* @return \Closure
*/
protected function carry()
{
return function ($stack, $pipe) {
return function ($passable) use ($stack, $pipe) {
try {
if (is_callable($pipe)) {
// If the pipe is a callable, then we will call it directly, but otherwise we
// will resolve the pipes out of the dependency container and call it with
// the appropriate method and arguments, returning the results back out.
/var/www/erfcms8.7/App/Http/Middleware/Canonical.php
public function handle(Request $request, Closure $next): Response
{
$scheme = strtolower(parse_url(config()->get('app.url'), PHP_URL_SCHEME) ?: 'HTTP');
$host = strtolower(parse_url(config()->get('app.url'), PHP_URL_HOST) ?: 'localhost');
if (str_contains($request->getRequestUri(), 'index.php') ||
$scheme !== $request->getScheme() ||
$host !== $request->getHost()) {
$redirectUrl = $scheme.'://'.$host.str_replace(
'index.php',
'',
$request->getRequestUri()
);
response()->setStatusCode(302);
return response()->header('Location', $redirectUrl);
}
return $next($request);
}
}
/var/www/erfcms8.7/vendor/illuminate/pipeline/Pipeline.php
// the appropriate method and arguments, returning the results back out.
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
[$name, $parameters] = $this->parsePipeString($pipe);
// If the pipe is a string we will parse the string and resolve the class out
// of the dependency injection container. We can then build a callable and
// execute the pipe function giving in the parameters that are required.
$pipe = $this->getContainer()->make($name);
$parameters = array_merge([$passable, $stack], $parameters);
} else {
// If the pipe is already an object we'll just make a callable and pass it to
// the pipe as-is. There is no need to do any extra parsing and formatting
// since the object we're given was already a fully instantiated object.
$parameters = [$passable, $stack];
}
$carry = method_exists($pipe, $this->method)
? $pipe->{$this->method}(...$parameters)
: $pipe(...$parameters);
return $this->handleCarry($carry);
} catch (Throwable $e) {
return $this->handleException($passable, $e);
}
};
};
}
/**
* Parse full pipe string to get name and parameters.
*
* @param string $pipe
* @return array
*/
protected function parsePipeString($pipe)
{
[$name, $parameters] = array_pad(explode(':', $pipe, 2), 2, []);
/var/www/erfcms8.7/vendor/illuminate/pipeline/Pipeline.php
public function via($method)
{
$this->method = $method;
return $this;
}
/**
* Run the pipeline with a final destination callback.
*
* @param \Closure $destination
* @return mixed
*/
public function then(Closure $destination)
{
$pipeline = array_reduce(
array_reverse($this->pipes()), $this->carry(), $this->prepareDestination($destination)
);
return $pipeline($this->passable);
}
/**
* Run the pipeline and return the result.
*
* @return mixed
*/
public function thenReturn()
{
return $this->then(function ($passable) {
return $passable;
});
}
/**
* Get the final piece of the Closure onion.
*
* @param \Closure $destination
* @return \Closure
*/
/var/www/erfcms8.7/App/Cms.php
}
if ($this->isAuthenticated()) {
Cms::$adminControlsEnabled = true;
}
}
public function run(): void
{
try {
MenuModel::exists();
$this->moduleMapper->getModules(); // This initializes all Blocks.
$this->registerRoutes();
} catch (Exception) {
$this->registerInstallRoutes();
}
$response = $this->pipeline
->send($this->request)
->through([Canonical::class])
->then(function ($request) {
return $this->router->dispatch($request);
});
/** @var Response $response */
$response->send();
}
public function registerInstallRoutes(): void
{
$this->router->get('/', [InstallController::class, 'show']);
$this->router->post('/', [InstallController::class, 'install']);
}
public function registerRoutes(): void
{
$defined = [];
// ------------------------------------------
$this->router->get('/sitemap.xml', [SitemapController::class, 'show']);
/home/mwweb/htdocs/app/local/cms.php
$cms = container()->make(Cms::class);
$page = container()->make(PageController::class);
$layout = container()->make(Layout::class);
$page->setLayout($layout);
$router = container()->make(Router::class);
$dashboard= container()->make(DashboardController::class);
$router->group(['prefix' => config()->get('admin.urlpath'), 'middleware' => BasicAuth::class],
function (Router $router) {
$router->get('/teilnehmer', [TeilnehmerCrudController::class, 'getResponse']);
$router->post('/teilnehmer', [TeilnehmerCrudController::class, 'postResponse']);
}
);
$url = config()->get('admin.urlpath');
$dashboard->addItem('Teilnehmer',['url' => $url . 'teilnehmer', 'icon' =>bi('people')]);
$router->get('/teilnehmerliste', [TeilnehmerlisteController::class, 'get']);
$cms->run();
/home/mwweb/htdocs/app/local/public/index.php
<?php
$_ENV['PUBLIC_PATH'] = __DIR__;
require_once __DIR__ . '/../cms.php';
Arguments
"/home/mwweb/htdocs/app/local/cms.php"