Beispiel #1
0
<?php

date_default_timezone_set("Europe/Paris");
define("MEMORY_REAL_USAGE", true);
$timeInit = microtime(true);
$memInit = memory_get_usage(MEMORY_REAL_USAGE);
require_once __DIR__ . "/includes/libs/core/application/class.Singleton.php";
require_once __DIR__ . "/includes/libs/core/application/class.Autoload.php";
use core\application\Autoload;
use core\application\Core;
Autoload::$folder = __DIR__;
spl_autoload_register(array(Autoload::getInstance(), "load"));
Core::checkEnvironment();
Core::init();
Core::parseURL();
Core::execute(Core::getController(), Core::getAction(), Core::getTemplate());
Core::endApplication();
Beispiel #2
0
 /**
  * Méthode d'affichage du debugger
  * @param bool $pDisplay
  * @param bool $pError
  * @return string
  */
 public static function render($pDisplay = true, $pError = false)
 {
     $className = "Smarty";
     if (!class_exists('Smarty')) {
         /**
          * 20150827 - Note from me to me : if Smarty is not defined, then we load it manually
          * And because of namespace handling in PHP, if an error occurs while defining a class,
          * the current definition namespace will be stuck and there will be no way to load a new
          * class in another one.
          * If you dont trust the young you look up to $classes.
          */
         Autoload::getInstance()->load("Smarty");
         $classes = get_declared_classes();
         $className = end($classes);
     }
     /** @var Smarty $smarty */
     $smarty = new $className();
     $smarty->clear_all_assign();
     $smartyDir = "includes/libs/core/tools/debugger/templates/_cache/";
     $smarty->template_dir = "includes/libs/core/tools/debugger/templates";
     $smarty->cache_dir = $smartyDir;
     $smarty->compile_dir = $smartyDir;
     $globalVars = self::getGlobalVars();
     foreach ($globalVars as $n => &$v) {
         $smarty->assign_by_ref($n, $v);
     }
     $smarty->assign("is_error", $pError);
     $smarty->assign("dir_to_theme", "http://" . Configuration::$server_domain . "/" . (isset(Configuration::$server_folder) ? Configuration::$server_folder . "/" : "") . "includes/libs/core/tools/debugger");
     $smarty->assign("dir_to_components", Core::$path_to_components);
     $smarty->assign("server_url", Configuration::$server_url);
     return $smarty->fetch("template.debugger.tpl", null, null, $pDisplay);
 }