/home/shahrdari/domains/gorgan.ir/public_html/application/vendor/pecee/simple-router/src/Pecee/SimpleRouter/ClassLoader/ClassLoader.php
<?php
namespace Pecee\SimpleRouter\ClassLoader;
use Pecee\SimpleRouter\Exceptions\ClassNotFoundHttpException;
class ClassLoader implements IClassLoader
{
/**
* Load class
*
* @param string $class
* @return object
* @throws ClassNotFoundHttpException
*/
public function loadClass(string $class)
{
if (class_exists($class) === false) {
throw new ClassNotFoundHttpException($class, null, sprintf('Class "%s" does not exist', $class), 404, null);
}
return new $class();
}
/**
* Called when loading class method
* @param object $class
* @param string $method
* @param array $parameters
* @return object
*/
public function loadClassMethod($class, string $method, array $parameters)
{
return call_user_func_array([$class, $method], array_values($parameters));
}
/**
* Load closure
*
* @param Callable $closure
Arguments
"Class "slider_controller" does not exist"
/home/shahrdari/domains/gorgan.ir/public_html/application/vendor/pecee/simple-router/src/Pecee/SimpleRouter/Route/Route.php
$router->debug('Executing callback');
/* Load class from type hinting */
if (is_array($callback) === true && isset($callback[0], $callback[1]) === true) {
$callback[0] = $router->getClassLoader()->loadClass($callback[0]);
}
/* When the callback is a function */
return $router->getClassLoader()->loadClosure($callback, $parameters);
}
$controller = $this->getClass();
$method = $this->getMethod();
$namespace = $this->getNamespace();
$className = ($namespace !== null && $controller[0] !== '\\') ? $namespace . '\\' . $controller : $controller;
$router->debug('Loading class %s', $className);
$class = $router->getClassLoader()->loadClass($className);
if ($method === null) {
$controller[1] = '__invoke';
}
if (method_exists($class, $method) === false) {
throw new ClassNotFoundHttpException($className, $method, sprintf('Method "%s" does not exist in class "%s"', $method, $className), 404, null);
}
$router->debug('Executing callback %s -> %s', $className, $method);
return $router->getClassLoader()->loadClassMethod($class, $method, $parameters);
}
protected function parseParameters($route, $url, $parameterRegex = null): ?array
{
$regex = (strpos($route, $this->paramModifiers[0]) === false) ? null :
sprintf
(
static::PARAMETERS_REGEX_FORMAT,
/home/shahrdari/domains/gorgan.ir/public_html/application/vendor/pecee/simple-router/src/Pecee/SimpleRouter/Router.php
'route' => $route,
'middlewares' => $route->getMiddlewares(),
]);
$route->loadMiddleware($this->request, $this);
$output = $this->handleRouteRewrite($key, $url);
if ($output !== null) {
return $output;
}
$methodNotAllowed = false;
$this->request->addLoadedRoute($route);
$this->fireEvents(EventHandler::EVENT_RENDER_ROUTE, [
'route' => $route,
]);
$routeOutput = $route->renderRoute($this->request, $this);
if ($this->renderMultipleRoutes === true) {
if ($routeOutput !== null) {
return $routeOutput;
}
$output = $this->handleRouteRewrite($key, $url);
if ($output !== null) {
return $output;
}
} else {
$output = $this->handleRouteRewrite($key, $url);
return $output ?? $routeOutput;
}
}
}
} catch (Exception $e) {
$this->handleException($e);
/home/shahrdari/domains/gorgan.ir/public_html/application/vendor/pecee/simple-router/src/Pecee/SimpleRouter/Router.php
$this->debug('Start rendering exception handler');
$handler->handleError($this->request, $e);
$this->debug('Finished rendering exception-handler');
if (isset($this->loadedExceptionHandlers[$key]) === false && $this->request->hasPendingRewrite() === true) {
$this->loadedExceptionHandlers[$key] = $handler;
$this->debug('Exception handler contains rewrite, reloading routes');
$this->fireEvents(EventHandler::EVENT_REWRITE, [
'rewriteUrl' => $this->request->getRewriteUrl(),
'rewriteRoute' => $this->request->getRewriteRoute(),
]);
if ($this->request->getRewriteRoute() !== null) {
$this->processedRoutes[] = $this->request->getRewriteRoute();
}
return $this->routeRequest();
}
} catch (Exception $e) {
}
$this->debug('Finished processing');
}
$this->debug('Finished exception handling - exception not handled, throwing');
throw $e;
}
/**
* Find route by alias, class, callback or method.
*
* @param string $name
* @return ILoadableRoute|null
*/
public function findRoute(string $name): ?ILoadableRoute
/home/shahrdari/domains/gorgan.ir/public_html/application/vendor/pecee/simple-router/src/Pecee/SimpleRouter/Router.php
if ($this->renderMultipleRoutes === true) {
if ($routeOutput !== null) {
return $routeOutput;
}
$output = $this->handleRouteRewrite($key, $url);
if ($output !== null) {
return $output;
}
} else {
$output = $this->handleRouteRewrite($key, $url);
return $output ?? $routeOutput;
}
}
}
} catch (Exception $e) {
$this->handleException($e);
}
if ($methodNotAllowed === true) {
$message = sprintf('Route "%s" or method "%s" not allowed.', $this->request->getUrl()->getPath(), $this->request->getMethod());
$this->handleException(new NotFoundHttpException($message, 403));
}
if (count($this->request->getLoadedRoutes()) === 0) {
$rewriteUrl = $this->request->getRewriteUrl();
if ($rewriteUrl !== null) {
$message = sprintf('Route not found: "%s" (rewrite from: "%s")', $rewriteUrl, $this->request->getUrl()->getPath());
} else {
$message = sprintf('Route not found: "%s"', $this->request->getUrl()->getPath());
}
$this->debug($message);
return $this->handleException(new NotFoundHttpException($message, 404));
/home/shahrdari/domains/gorgan.ir/public_html/application/vendor/pecee/simple-router/src/Pecee/SimpleRouter/Router.php
*/
public function start(): ?string
{
$this->debug('Router starting');
$this->fireEvents(EventHandler::EVENT_INIT);
$this->loadRoutes();
if ($this->csrfVerifier !== null) {
$this->fireEvents(EventHandler::EVENT_RENDER_CSRF, [
'csrfVerifier' => $this->csrfVerifier,
]);
/* Verify csrf token for request */
$this->csrfVerifier->handle($this->request);
}
$output = $this->routeRequest();
$this->fireEvents(EventHandler::EVENT_LOAD, [
'loadedRoutes' => $this->getRequest()->getLoadedRoutes(),
]);
$this->debug('Routing complete');
return $output;
}
/**
* Routes the request
*
* @return string|null
* @throws HttpException
* @throws Exception
*/
public function routeRequest(): ?string
{
$this->debug('Routing request');
/home/shahrdari/domains/gorgan.ir/public_html/application/vendor/pecee/simple-router/src/Pecee/SimpleRouter/SimpleRouter.php
* @var Router
*/
protected static $router;
/**
* Start routing
*
* @throws \Pecee\SimpleRouter\Exceptions\NotFoundHttpException
* @throws \Pecee\Http\Middleware\Exceptions\TokenMismatchException
* @throws HttpException
* @throws Exception
*/
public static function start(): void
{
// Set default namespaces
foreach (static::router()->getRoutes() as $route) {
static::addDefaultNamespace($route);
}
echo static::router()->start();
}
/**
* Start the routing an return array with debugging-information
*
* @return array
*/
public static function startDebug(): array
{
$routerOutput = null;
try {
ob_start();
static::router()->setDebugEnabled(true)->start();
$routerOutput = ob_get_clean();
} catch (Exception $e) {
}
// Try to parse library version
/home/shahrdari/domains/gorgan.ir/public_html/application/components/routes.php
$request->setRewriteCallback( module_error_run('400'));
break;
case 401:
$request->setRewriteCallback( module_error_run('401'));
break;
case 403:
$request->setRewriteCallback( module_error_run('403'));
break;
case 404:
$request->setRewriteCallback( module_error_run('404'));
break;
case 500:
$request->setRewriteCallback( module_error_run('500'));
break;
case 503:
$request->setRewriteCallback( module_error_run('503'));
break;
}
});
parent::start();
}
}
/home/shahrdari/domains/gorgan.ir/public_html/modules/slider/configure.php
set_cache('module_slider_categories', $cache['slider_categories']);
}
return $cache['slider_categories'];
}
function module_slider_run(){
require_once(root_dir . 'modules/slider/frontend.php');
routes::group(['prefix' => path.'slider'/*, 'middleware' => [ApiVerification::class,TestApi::class]*/ ], function () {
//ROUTE::get('/', '[slider_controller::class, '_default']');
routes::get('/', 'slider_controller@_default');
routes::get('/page/{number}', [slider_controller::class, '_default'])->where(['number' => '[0-9]+']);
routes::get('/author/{name}', [slider_controller::class, '_author'])->where(['slug'=>'.+']);
routes::get('/tag/{slug}', [slider_controller::class, '_tag'])->where(['slug'=>'.+']);
routes::get('/category/{slug}', 'slider_controller@_category')->where(['slug'=>'.+']);
routes::get('/type/{type}', [slider_controller::class, '_type'])->where(['type'=>'.+']);
routes::get('/archives/{match}', 'slider_controller@_archives_show')->where(['match'=>'.+']);
routes::match(['get', 'post'],'/detail/{name}', 'slider_controller@_single')->where(['name'=>'.+']);
routes::get('/poll/save/{id}/{key}', 'slider_controller@_save_poll')->where(['key'=>'.+']);
});
routes::start();
}
function block_slider_show($op = null, $id = null, $position = null){
global $parsysm,$options,$system;
$lang=$parsysm->ep_lang->translate('slider/frontend');
$where = null;
$op['total'] = !isset($op['total']) || intval($op['total']) <= 0? 5 : intval($op['total']);
$op['cat'] = !isset($op['cat']) || intval($op['cat']) <= 0 ? 0 : intval($op['cat']);
$op['number_letter'] = !isset($op['number_letter']) || intval($op['number_letter']) <= 0 ? 120 : intval($op['number_letter']);
$op['type'] = !isset($op['type']) || $op['type'] == null ? 'post' : $op['type'];
if ($op['cat'] > 0){
$categories = slider_categories();
$where = 'FIND_IN_SET('.$op['cat'].', cnt.categories)';
if (isset($categories[$op['cat']]['term_parent']) && $categories[$op['cat']]['term_parent'] == 0){
foreach ($categories as $c){
if ($c['term_parent'] != $op['cat']) continue;
$where .= ' OR FIND_IN_SET('.$c['term_id'].', cnt.categories)';
}
}
/home/shahrdari/domains/gorgan.ir/public_html/application/controller/control.php
*/
require_once(ctrl_dir.'frontend/control.php');
global $options;
if (isset($_GET['dashboard']) && $_GET['dashboard'] == $options['admin'] && $options['admin'] != ''){
define('home', false);
require_once(ctrl_dir.'backend/control.php');
}elseif (isset($_GET['act']) && $_GET['act'] == $options['partner'] && $options['partner'] != ''){
define('home', false);
require_once(ctrl_dir.'asistant/control.php');
}else{
check_url();
if (mod_rewrite !== 'error' && $_GET['act'] == ''){
define('home', true);
$_GET['act'] = $options['default-module'];
}else{
define('home', false);
}
if (mod_rewrite !== 'error' && is_module($_GET['act']) && function_exists('module_'.str_replace('-', '_', $_GET['act']).'_run')){
call_user_func('module_'.str_replace('-', '_', $_GET['act']).'_run');
}else{
module_error_run('404');
}
}
/home/shahrdari/domains/gorgan.ir/public_html/application/autoload.php
return 'PARSYSM';
}
}else{
return 'PARSYSM';
}
}else{
return 'PARSYSM';
}
}else{
return 'error';
}
}
}
}
$loader = new Autoload();
$loader->register();
$loader->parsysm_checkRoute();
require_once(app_dir.'helper/ParsysmHandler.php');
require_once (app_dir.'controller/control.php');
require_once (app_dir.'base/bootable.php');
Arguments
"/home/shahrdari/domains/gorgan.ir/public_html/application/controller/control.php"
/home/shahrdari/domains/gorgan.ir/public_html/index.php
* Copyright (c) 2018 - 2021, Iran Republic Islamic IT of Technology
* @package PARSYSM CMF
* @author Ehsan Pakroo ( PARSYSM TEAM )
* @copyright Copyright (c) 2018 - 2021, Ehsan Pakroo, Inc. (http://eh5an.ir/)
* @copyright Copyright (c) 2018 - 2021, PARSYSM Co of Technology (http://parsysm.ir/)
* @license https://rc.majlis.ir/fa/law/show/93463/
* @link https://parsysm.ir/
* @since Version 9.1.16
* @filesource
*/
@ob_start();
@ob_implicit_flush(0);
@session_start();
@error_reporting(E_ALL ^ E_WARNING ^ E_NOTICE);
@ini_set('display_errors', true);
@ini_set('html_errors', false);
@ini_set('error_reporting', E_ALL ^ E_WARNING ^ E_NOTICE);
require (__DIR__.'/routes.php');
require (app_dir.'autoload.php');
\application\app::_parsysm_run();
\application\parsysm::ehsan(lisancekey,sitekey);
Arguments
"/home/shahrdari/domains/gorgan.ir/public_html/application/autoload.php"