コード例 #1
0
        if ($path2) {
            continue;
        }
        if (array_key_exists($variable, $_SERVER)) {
            $path2 = substr($_SERVER[$variable], 0, strrpos($_SERVER[$variable], '/')) . '/';
        }
    }
    if (!$path2) {
        $path2 = '/';
    }
    die("<p>Votre Iconito n'est pas encore install&eacute; &mdash; <a href=\"" . $path2 . "install/index.php\">Cliquez ici</a></p>");
}
// tentative de création du controlleur
try {
    $coord = new ProjectController($path . '/../project/config/copix.conf.php');
    $coord->process();
    // on gère les exceptions de type CopixCredentialException différement, elles redirigent au lieu de s'afficher, et ne génèrent pas de log
} catch (CopixCredentialException $e) {
    header('location: ' . CopixUrl::get('auth||', array('noCredential' => 1, 'auth_url_return' => _url('#'))));
    exit;
    // toutes les exceptions de Copix passeront ici, sauf CopixCredentialException
} catch (CopixException $e) {
    $extras = array('file' => $e->getFile(), 'line' => $e->getLine(), 'exception' => get_class($e));
    _log($e->getMessage(), 'errors', CopixLog::EXCEPTION, $extras);
    // si l'exception générée est dans la création du coordinateur, on ne peut pas faire un bon affichage de l'exception
    if (!isset($coord)) {
        echo $e->getMessage();
    } else {
        // on vérifie que le coordinateur arrive bien à afficher l'exception, il se peut qu'il n'y arrive pas
        try {
            $coord->showException($e);