/var/www/vhosts/gmkmakina.com/httpdocs/vendor/symfony/routing/Matcher/UrlMatcher.php
{
return $this->context;
}
/**
* {@inheritdoc}
*/
public function match(string $pathinfo)
{
$this->allow = $this->allowSchemes = [];
if ($ret = $this->matchCollection(rawurldecode($pathinfo) ?: '/', $this->routes)) {
return $ret;
}
if ('/' === $pathinfo && !$this->allow && !$this->allowSchemes) {
throw new NoConfigurationException();
}
throw 0 < \count($this->allow) ? new MethodNotAllowedException(array_unique($this->allow)) : new ResourceNotFoundException(sprintf('No routes found for "%s".', $pathinfo));
}
/**
* {@inheritdoc}
*/
public function matchRequest(Request $request)
{
$this->request = $request;
$ret = $this->match($request->getPathInfo());
$this->request = null;
return $ret;
}
public function addExpressionLanguageProvider(ExpressionFunctionProviderInterface $provider)
{
$this->expressionLanguageProviders[] = $provider;
}
Arguments
"No routes found for "/images/gunes/6.jpg"."
/var/www/vhosts/gmkmakina.com/httpdocs/app/Core/RouteResolver.php
use Symfony\Component\Routing\RequestContext;
class RouteResolver
{
/**
* Verilen request ile uyuşan bir route olup olmadığını tespit eder.
*
* Eğer eşleşen bir route olması durumunda bu routeyi geri döndürür.
*
* @param $request
* @return array
*/
public static function resolve($request)
{
$routes = Application::getInstance()->getRoutes();
$context = new RequestContext("/");
$context->fromRequest($request);
$matcher = new UrlMatcher($routes, $context);
return $matcher->match($request->getPathInfo());
}
}
Arguments
/var/www/vhosts/gmkmakina.com/httpdocs/app/Core/Application.php
public function loadProviders()
{
$app_config_path = ROOT_PATH . '/config/app.yml';
$app_config = Yaml::parseFile($app_config_path);
foreach ($app_config["providers"] as $provider) {
$provider::register();
}
}
/**
* Gelen request parçala, route ve aksiyon ve parametre
* bilgilerini al
*
* @param $request
* @return array
*/
public function dispatch($request)
{
$match = RouteResolver::resolve($request);
// use double brackets to get controller array from result
[$action, $route] = pullOut($match, "_controller", "_route");
$request->setRoute($route);
[$controller, $method] = explode('::', $action);
return [
'action' => [
new $controller,
$method
],
'parameters' => $match
];
}
/**
* Gelen requestin gereken şartları taşıması halinde
* ilgili aksiyona gönder
*
* @param $request
* @return mixed|Response
Arguments
App\Core\Request {#18
-route: null
+attributes: Symfony\Component\HttpFoundation\ParameterBag {#9}
+request: Symfony\Component\HttpFoundation\ParameterBag {#13}
+query: Symfony\Component\HttpFoundation\ParameterBag {#19}
+server: Symfony\Component\HttpFoundation\ServerBag {#70}
+files: Symfony\Component\HttpFoundation\FileBag {#69}
+cookies: Symfony\Component\HttpFoundation\ParameterBag {#68}
+headers: Symfony\Component\HttpFoundation\HeaderBag {#71}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: null
#pathInfo: "/images/gunes/6.jpg"
#requestUri: "/images/gunes/6.jpg"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-preferredFormat: null
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/var/www/vhosts/gmkmakina.com/httpdocs/app/Core/Application.php
return [
'action' => [
new $controller,
$method
],
'parameters' => $match
];
}
/**
* Gelen requestin gereken şartları taşıması halinde
* ilgili aksiyona gönder
*
* @param $request
* @return mixed|Response
*/
public function send($request)
{
$action = $this->dispatch($request);
$this->justifyRequest($request);
$response = call_user_func($action['action'], ...array_values($action['parameters']));
if (!($response instanceof Response)) {
$response = response($response);
}
return $response;
}
/**
* Requesting gereken şartları taşıdığını kontrol eder
* ve request üzerinde bir takım düzenlemeler yapar.
*
* @param $request
*/
public function justifyRequest($request)
{
Arguments
App\Core\Request {#18
-route: null
+attributes: Symfony\Component\HttpFoundation\ParameterBag {#9}
+request: Symfony\Component\HttpFoundation\ParameterBag {#13}
+query: Symfony\Component\HttpFoundation\ParameterBag {#19}
+server: Symfony\Component\HttpFoundation\ServerBag {#70}
+files: Symfony\Component\HttpFoundation\FileBag {#69}
+cookies: Symfony\Component\HttpFoundation\ParameterBag {#68}
+headers: Symfony\Component\HttpFoundation\HeaderBag {#71}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: null
#pathInfo: "/images/gunes/6.jpg"
#requestUri: "/images/gunes/6.jpg"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-preferredFormat: null
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}
/var/www/vhosts/gmkmakina.com/httpdocs/public/index.php
# gerekli ön hazırlıkları tamamla ve app instancesini al
$app = require __DIR__ . '/../bootstrap/app.php';
# global php değişkenlerini kullanarak http isteğini oluştur
$request = \App\Core\Request::createFromGlobals();
# Eğer uygulama kurulumu gerçekleşmemişse ve uygulamanın kurulumu dışında
# bir istek varsa öncelikle kurulum sayfasını getir
# Eğer kurulum sırasında kurulumun tamamnlanması için istek gönderilmiş ise
# bu isteklerin devam etmesine izin ver.
if ($app->applicationNeedsSetup() && !$request->isSetupProcess()){
$app->setupApplication();
};
if (! $app->applicationNeedsSetup()) {
$app->loadProviders();
}
# uygulamayı başlat.
$response = $app->send($request);
$response->send();
Arguments
App\Core\Request {#18
-route: null
+attributes: Symfony\Component\HttpFoundation\ParameterBag {#9}
+request: Symfony\Component\HttpFoundation\ParameterBag {#13}
+query: Symfony\Component\HttpFoundation\ParameterBag {#19}
+server: Symfony\Component\HttpFoundation\ServerBag {#70}
+files: Symfony\Component\HttpFoundation\FileBag {#69}
+cookies: Symfony\Component\HttpFoundation\ParameterBag {#68}
+headers: Symfony\Component\HttpFoundation\HeaderBag {#71}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: null
#pathInfo: "/images/gunes/6.jpg"
#requestUri: "/images/gunes/6.jpg"
#baseUrl: ""
#basePath: null
#method: "GET"
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-preferredFormat: null
-isHostValid: true
-isForwardedValid: true
basePath: ""
format: "html"
}