Exemple #1
0
 /**
  * Méthode d'instanciation de l'objet en singleton
  *
  * design pattern singleton
  *
  * @author Vincent Chaillou <*****@*****.**>
  * @since 2012-06-26
  * @version v1
  */
 public static function getInstance()
 {
     if (!isset(self::$instance)) {
         self::$instance = new LogErreur();
     }
     return self::$instance;
 }
Exemple #2
0
define('RelativePathConf', ReducPath(RelativePathTop . '../../config/'));
include_once RelativePathLibs . 'class_erreur.php';
include_once RelativePathLibs . 'class_config.php';
include_once RelativePathLibs . 'class_tpl.php';
include_once RelativePathLibs . 'commun.php';
function ReducPath($in)
{
    $tab_out = array();
    $idx = 0;
    $tab_in = explode('/', $in);
    foreach ($tab_in as $item) {
        switch ($item) {
            case '..':
                if (isset($tab_out[$idx]) && $tab_out[$idx] != '..') {
                    unset($tab_out[$idx--]);
                } else {
                    $tab_out[++$idx] = $item;
                }
                break;
            case '.':
                break;
            default:
                $tab_out[++$idx] = $item;
        }
    }
    $out = implode('/', $tab_out);
    return $out;
}
$LogErreur = LogErreur::getInstance();
$ConfigApp = ConfigApp::getInstance();
$Tpl = Tpl::getInstance();