Ejemplo n.º 1
0
        			throw new GitPHP_MessageException(sprintf(__('Could not run the diff executable "%1$s".  You may need to set the "%2$s" config value.'), $exe->GetBinary(), 'diffbin'), true, 500);
        		}*/
    }
    unset($exe);
    /*
     * Authentification
     */
    $auth = new GitPHP_Authentication();
    $auth->authenticate();
    /*
     * Project list
     */
    if (file_exists(GITPHP_CONFIGDIR . 'projects.conf.php')) {
        GitPHP_ProjectList::Instantiate(GITPHP_CONFIGDIR . 'projects.conf.php', false);
    } else {
        GitPHP_ProjectList::Instantiate(GITPHP_CONFIGDIR . 'gitphp.conf.php', true);
    }
    $controller = GitPHP_Controller::GetController(isset($_GET['a']) ? $_GET['a'] : null);
    if ($controller) {
        $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
         */
Ejemplo n.º 2
0
 /**
  * Initialize project list
  */
 protected function InitializeProjectList()
 {
     if (file_exists(GITPHP_CONFIGDIR . 'projects.conf.php')) {
         $this->projectList = GitPHP_ProjectList::Instantiate($this->config, GITPHP_CONFIGDIR . 'projects.conf.php', false);
     } else {
         $this->projectList = GitPHP_ProjectList::Instantiate($this->config, GITPHP_CONFIGDIR . 'gitphp.conf.php', true);
     }
     $this->projectList->SetMemoryCache(new GitPHP_MemoryCache($this->config->GetValue('objectmemory')));
     if ($this->config->GetValue('objectcache')) {
         $strategy = null;
         $servers = $this->config->GetValue('memcache');
         if ($servers) {
             if (class_exists('Memcached')) {
                 $strategy = new GitPHP_Cache_Memcached($servers);
             } else {
                 if (class_exists('Memcache')) {
                     $strategy = new GitPHP_Cache_Memcache($servers);
                 } else {
                     throw new GitPHP_MissingMemcacheException();
                 }
             }
         } else {
             $strategy = new GitPHP_Cache_File(GITPHP_CACHEDIR . 'objects', $this->config->GetValue('objectcachecompress'));
         }
         $cache = new GitPHP_Cache($strategy);
         $cache->SetLifetime($this->config->GetValue('objectcachelifetime'));
         $this->projectList->SetCache($cache);
     }
     $this->projectList->SetExe($this->exe);
     if ($this->log) {
         $this->projectList->AddObserver($this->log);
     }
 }