Beispiel #1
0
        $controller->RenderHeaders();
        $controller->Render();
    }
} catch (Exception $e) {
    if (GitPHP_Config::GetInstance()->GetValue('debug', false)) {
        throw $e;
    }
    if (!GitPHP_Resource::Instantiated()) {
        /*
         * In case an error was thrown before instantiating
         * the resource manager
         */
        GitPHP_Resource::Instantiate('en_US');
    }
    require_once GITPHP_CONTROLLERDIR . 'Controller_Message.class.php';
    $controller = new GitPHP_Controller_Message();
    $controller->SetParam('message', $e->getMessage());
    if ($e instanceof GitPHP_MessageException) {
        $controller->SetParam('error', $e->Error);
        $controller->SetParam('statuscode', $e->StatusCode);
    } else {
        $controller->SetParam('error', true);
    }
    $controller->RenderHeaders();
    $controller->Render();
}
if (GitPHP_Log::GetInstance()->GetEnabled()) {
    $entries = GitPHP_Log::GetInstance()->GetEntries();
    foreach ($entries as $logline) {
        echo "<br />\n" . $logline;
    }
Beispiel #2
0
 /**
  * Get message controller
  *
  * @return GitPHP_ControllerBase
  */
 public function GetMessageController()
 {
     $params = $this->QueryVarArrayToParameterArray($_GET);
     if (!empty($_GET['q'])) {
         $restparams = GitPHP_Router::ReadCleanUrl($_SERVER['REQUEST_URI']);
         if (count($restparams) > 0) {
             $params = array_merge($params, $restparams);
         }
     }
     $controller = new GitPHP_Controller_Message();
     foreach ($params as $paramname => $paramval) {
         if ($paramname !== 'action') {
             $controller->SetParam($paramname, $paramval);
         }
     }
     $controller->SetRouter($this);
     return $controller;
 }