/** * Initializing site * * @return Site */ public static function init() { if (!isset(self::$instance)) { self::$instance = new Site(); } return self::$instance; }
public static function gI() { if (self::$instance === null) { self::$instance = new self(); } return self::$instance; }
/** * Create and return this class. */ public static function getInstance() { if (!self::$instance) { self::$instance = new self(); } return self::$instance; }
function _query($qry) { if (Site::instance()->debug()) { echo 'Requete MySql : ' . htmlentities($qry); } return @mysql_query($qry, $this->dblink); }
private static function setInstance(Site $object) { self::$instance = $object; $objectCache = ObjectCache::getInstance(); $objectCache->setEncryptedObject("EducaskSiteObject", $object, true); }
if (is_string($erreur)) { $body = htmlentities($erreur); } } $footer = '</fieldset><p>Si cette erreur persiste, contactez un administrateur.<br /><br />@SimpleFramework, tous droits réservés.</p>'; die($header . $body . $footer); } } ///Anti MagicQuotes if (get_magic_quotes_gpc()) { foreach ($_GET as $k => $v) { $_GET[$k] = stripslashes($v); } foreach ($_POST as $k => $v) { $_POST[$k] = stripslashes($v); } } require REP_RACINE . 'Config/Config.class.php'; _includeSite(REP_RACINE); try { Site::instance()->load(REP_RACINE); } catch (Exception $e) { $erreurHandler = null; if (class_exists('FatalErrorRender')) { $erreurHandler = new FatalErrorRender($e); } else { $erreurHandler = new FatalErrorRenderBasic($e); } } Site::instance()->timeMgr->markTime('Fin du fichier init.php');
<?php include 'init.php'; include 'changes.php'; $pr = Site::instance()->getNewRender(); $pr->useCache('index', 100); if ($pr->afficherSiCache()) { } else { $pr->setVar('changelog', $changelog); $pr->setVar('templateHtml', htmlentities(file_get_contents('Templates/default/index_example.tpl'))); $pr->afficher('index'); }
function setExecTime() { $this->setVar('generateTime', Site::instance()->getExecTime()); }
function racine() { return Site::instance()->repRacine; }