/home
/piloteo
/www
/vendor
/twig
/twig
/lib
/Twig
/Loader
/Filesystem.php
if (!$this->isAbsolutePath($path)) {
$path = $this->rootPath.'/'.$path;
}
if (is_file($path.'/'.$shortname)) {
if (false !== $realpath = realpath($path.'/'.$shortname)) {
return $this->cache[$name] = $realpath;
}
return $this->cache[$name] = $path.'/'.$shortname;
}
}
$this->errorCache[$name] = sprintf('Unable to find template "%s" (looked into: %s).', $name, implode(', ', $this->paths[$namespace]));
if (!$throw) {
return false;
}
throw new Twig_Error_Loader($this->errorCache[$name]);
}
private function normalizeName($name)
{
return preg_replace('#/{2,}#', '/', str_replace('\\', '/', $name));
}
private function parseName($name, $default = self::MAIN_NAMESPACE)
{
if (isset($name[0]) && '@' == $name[0]) {
if (false === $pos = strpos($name, '/')) {
throw new Twig_Error_Loader(sprintf('Malformed namespaced template name "%s" (expecting "@namespace/template_name").', $name));
}
$namespace = substr($name, 1, $pos - 1);
$shortname = substr($name, $pos + 1);
return array($namespace, $shortname);
}
/home
/piloteo
/www
/vendor
/twig
/twig
/lib
/Twig
/Loader
/Filesystem.php
$path = rtrim($path, '/\\');
if (!isset($this->paths[$namespace])) {
$this->paths[$namespace][] = $path;
} else {
array_unshift($this->paths[$namespace], $path);
}
}
public function getSourceContext($name)
{
$path = $this->findTemplate($name);
return new Twig_Source(file_get_contents($path), $name, $path);
}
public function getCacheKey($name)
{
$path = $this->findTemplate($name);
$len = strlen($this->rootPath);
if (0 === strncmp($this->rootPath, $path, $len)) {
return substr($path, $len);
}
return $path;
}
public function exists($name)
{
$name = $this->normalizeName($name);
if (isset($this->cache[$name])) {
return true;
}
return false !== $this->findTemplate($name, false);
}
public function isFresh($name, $time)
/home
/piloteo
/www
/vendor
/twig
/twig
/lib
/Twig
/Environment.php
/**
* Gets the template class associated with the given string.
*
* The generated template class is based on the following parameters:
*
* * The cache key for the given template;
* * The currently enabled extensions;
* * Whether the Twig C extension is available or not;
* * PHP version;
* * Twig version;
* * Options with what environment was created.
*
* @param string $name The name for which to calculate the template class name
* @param int|null $index The index if it is an embedded template
*
* @return string The template class name
*/
public function getTemplateClass($name, $index = null)
{
$key = $this->getLoader()->getCacheKey($name).$this->optionsHash;
return $this->templateClassPrefix.hash('sha256', $key).(null === $index ? '' : '_'.$index);
}
/**
* Renders a template.
*
* @param string $name The template name
* @param array $context An array of parameters to pass to the template
*
* @return string The rendered template
*
* @throws Twig_Error_Loader When the template cannot be found
* @throws Twig_Error_Syntax When an error occurred during compilation
* @throws Twig_Error_Runtime When an error occurred during rendering
*/
public function render($name, array $context = array())
{
return $this->loadTemplate($name)->render($context);
}
/home
/piloteo
/www
/vendor
/twig
/twig
/lib
/Twig
/Environment.php
/**
* 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 $index The index if it is an embedded template
*
* @return Twig_Template A template instance representing the given template name
*
* @throws Twig_Error_Loader When the template cannot be found
* @throws Twig_Error_Runtime When a previously generated cache is corrupted
* @throws Twig_Error_Syntax When an error occurred during compilation
*
* @internal
*/
public function loadTemplate($name, $index = null)
{
$cls = $mainCls = $this->getTemplateClass($name);
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);
$this->cache->write($key, $content);
$this->cache->load($key);
/home
/piloteo
/www
/vendor
/twig
/twig
/lib
/Twig
/Environment.php
$key = $this->getLoader()->getCacheKey($name).$this->optionsHash;
return $this->templateClassPrefix.hash('sha256', $key).(null === $index ? '' : '_'.$index);
}
/**
* Renders a template.
*
* @param string $name The template name
* @param array $context An array of parameters to pass to the template
*
* @return string The rendered template
*
* @throws Twig_Error_Loader When the template cannot be found
* @throws Twig_Error_Syntax When an error occurred during compilation
* @throws Twig_Error_Runtime When an error occurred during rendering
*/
public function render($name, array $context = array())
{
return $this->loadTemplate($name)->render($context);
}
/**
* Displays a template.
*
* @param string $name The template name
* @param array $context An array of parameters to pass to the template
*
* @throws Twig_Error_Loader When the template cannot be found
* @throws Twig_Error_Syntax When an error occurred during compilation
* @throws Twig_Error_Runtime When an error occurred during rendering
*/
public function display($name, array $context = array())
{
$this->loadTemplate($name)->display($context);
}
/**
* Loads a template.
*
/home
/piloteo
/www
/easydoor
/Renderer
/Renderer.php
if($debug) {
$this->twig->addExtension(new \Twig_Extension_Debug());
}
}
public function setModules($modules)
{
$this->modules = $modules;
}
public function addExtension()
{
$this->twig->addExtension(new TwigFunctions($this->modules));
$this->twig->addExtension(new Twig_Extensions_Extension_Text());
}
public function render(string $view, array $params = [])
{
return $this->twig->render($view . TWIG_EXTENSION, $params);
}
public function addPath(string $namespace, $path = null)
{
return $this->loader->addPath($path, $namespace);
}
public function addGlobal(string $key, $value)
{
$this->twig->addGlobal($key, $value);
}
}
/home
/piloteo
/www
/easydoor
/Module
/ModuleModel.php
$render = str_replace(', ]', ']', $render);
return $render;
} elseif(isset($_GET['ajax'])) {
if($debug) var_dump('4');
header("content-type: application/json");
return \GuzzleHttp\json_encode($this->rst);
} else {
if($debug) var_dump('5');
if(isset($_GET)) {
$this->renderer->addGlobal('mget', $_GET);
}
$pathModuleBack = FILE_BACK_VIEWS_MODULE . '/' . $this->namelower . '/' . $view;
if (BACK && !file_exists($pathModuleBack . TWIG_EXTENSION)) {
$view = PATH_BACK_VIEWS_MODULE . '/' . $view;
} else {
$view = $this->namelower . '/' . $view;
}
return $this->renderer->render($view, $this->rst);
}
}
public function setTwigParams($params)
{
$this->twigParams = $params;
}
public function setTwigRequete(bool $value)
{
$this->twigRequete = $value;
}
public function getSecurityKey()
{
return hash('sha256', DB::table('mod_foconfiguration')->first()->domainfo);
}
private function setLanguages()
{
/home
/piloteo
/www
/easydoor
/Module
/ModuleCommon.php
public function one(ServerRequestInterface $request = null)
{
if (array_key_exists('id', $this->twigParams)) {
$id = $this->twigParams['id'];
} else {
$id = $request->getAttributes()['id'];
}
$this->result = $this->getOne($id);
$fieldActive = DB_ACTIVE;
if(isset($_GET[$this->getSecurityKey()])) {
return $this->render('one');
}
elseif($this->result AND $this->config[$fieldActive] AND $this->result->$fieldActive == 0 AND !BACK) {
return false;
}
else {
return $this->render('one');
}
}
public function first()
{
$id = DB_ID;
$this->where();
$this->order();
$firstId = $this->sql->select(DB_ID)->first();
$this->result = $this->getOne($firstId->$id);
return $this->render('one');
}
public function paginator()
{
$totalItems = $this->sql->count();
if (BACK) {
if(!array_key_exists('start', $_GET)) $_GET['start'] = 0;
/home
/piloteo
/www
/easydoor
/App.php
$view = substr($routeName, strripos($routeName, '.')+1, strlen($routeName));
if(array_key_exists('name',$module[0])) {
$this->modules[$module[0]->name]->prepareFields();
}
$objectBack = NAMESPACE_APP . '\\' . NAMESPACE_MODULE . '\ModuleBack';
if(get_class($module[0]) == $objectBack) {
if($user->hasPerm($module[0]->name, $view) OR $view == 'one') {
$response = call_user_func_array($module, [$request]);
}
else {
return new Response(403, [], $this->renderer->render('403'));
}
}
else {
if(USER_CLASS) {
if (!array_key_exists('name', $module[0]) OR $user->hasPerm($module[0]->name, $view)) {
$response = call_user_func_array($module, [$request]);
} else {
return new Response(403, [], $this->renderer->render('403'));
}
}
else {
$response = call_user_func_array($module, [$request]);
}
}
}
if (is_string($response)) {
return new Response(200, [], $response);
} elseif ($response instanceof ResponseInterface) {
return $response;
} elseif($uri === '/') {
return new Response(200, [], $this->renderer->render('home'));
} else {
return new Response(404, [], $this->renderer->render('404'));
}
/home
/piloteo
/www
/easydoor
/App.php
$view = substr($routeName, strripos($routeName, '.')+1, strlen($routeName));
if(array_key_exists('name',$module[0])) {
$this->modules[$module[0]->name]->prepareFields();
}
$objectBack = NAMESPACE_APP . '\\' . NAMESPACE_MODULE . '\ModuleBack';
if(get_class($module[0]) == $objectBack) {
if($user->hasPerm($module[0]->name, $view) OR $view == 'one') {
$response = call_user_func_array($module, [$request]);
}
else {
return new Response(403, [], $this->renderer->render('403'));
}
}
else {
if(USER_CLASS) {
if (!array_key_exists('name', $module[0]) OR $user->hasPerm($module[0]->name, $view)) {
$response = call_user_func_array($module, [$request]);
} else {
return new Response(403, [], $this->renderer->render('403'));
}
}
else {
$response = call_user_func_array($module, [$request]);
}
}
}
if (is_string($response)) {
return new Response(200, [], $response);
} elseif ($response instanceof ResponseInterface) {
return $response;
} elseif($uri === '/') {
return new Response(200, [], $this->renderer->render('home'));
} else {
return new Response(404, [], $this->renderer->render('404'));
}
/home
/piloteo
/www
/boot.php
$cache = new Cache();
if(! defined('BACK')) {
define('BACK', false);
}
$whoops = new \Whoops\Run;
$whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler);
$whoops->register();
$app = new \easydoor\App([
'router' => $router,
'renderer' => $renderer,
'predis' => $predis,
'cache' => $cache,
]);
send($app->run(\GuzzleHttp\Psr7\ServerRequest::fromGlobals()));
/home
/piloteo
/www
/front
/public
/index.php
<?php
define('PATH', __DIR__);
define('USER_CLASS', 'Adherent');
define('NAMESPACES_MODULES', [
'ModuleFront' => 'front'
]);
require dirname(__DIR__, 2) . '/boot.php';