Ejemplo n.º 1
0
 public function buildDataSet(Xinc_Project $project, array $buildHistoryArr = array(), $previousData = array())
 {
     if (count($previousData) > 0) {
         $data = $previousData;
     } else {
         $data = array('Files' => array(), 'Warnings' => array(), 'Errors' => array());
     }
     $builds = array();
     foreach ($buildHistoryArr as $buildTimestamp => $buildFileName) {
         try {
             $buildObject = Xinc_Build::unserialize($project, $buildTimestamp, Xinc_Gui_Handler::getInstance()->getStatusDir());
             $numberOfFiles = $buildObject->getStatistics()->get('checkstyle.numberOfFiles');
             if (null === $numberOfFiles) {
                 continue;
             }
             $buildNo = $buildObject->getNumber();
             if (isset($builds[$buildNo])) {
                 $builds[$buildNo]++;
                 $buildNo .= '.f' . $builds[$buildNo];
             } else {
                 $builds[$buildNo] = 0;
             }
             $data['Files'][$buildNo] = $numberOfFiles;
             $data['Warnings'][$buildNo] = $buildObject->getStatistics()->get('checkstyle.numberOfWarnings');
             $data['Errors'][$buildNo] = $buildObject->getStatistics()->get('checkstyle.numberOfErrors');
             $prevBuildNo = $buildNo;
             unset($buildObject);
         } catch (Exception $e) {
             // TODO: Handle
         }
     }
     return $data;
 }
 public function buildDataSet(Xinc_Project $project, array $buildHistoryArr = array(), $previousData = array())
 {
     if (count($previousData) > 0) {
         $data = $previousData;
     } else {
         $data = array('Number of Tests' => array(), 'Passed tests' => array(), 'Failed tests' => array());
     }
     $builds = array();
     foreach ($buildHistoryArr as $buildTimestamp => $buildFileName) {
         try {
             $buildObject = Xinc_Build::unserialize($project, $buildTimestamp, Xinc_Gui_Handler::getInstance()->getStatusDir());
             $buildNo = $buildObject->getNumber();
             if (isset($builds[$buildNo])) {
                 $builds[$buildNo]++;
                 $buildNo .= '.f' . $builds[$buildNo];
             } else {
                 $builds[$buildNo] = 0;
             }
             if ($buildObject->getStatistics()->get('phpunit.numberOfTests') > 0) {
                 $data['Number of Tests'][$buildNo] = $buildObject->getStatistics()->get('phpunit.numberOfTests');
                 $data['Failed tests'][$buildNo] = $buildObject->getStatistics()->get('phpunit.numberOfFailures');
                 $data['Passed tests'][$buildNo] = $buildObject->getStatistics()->get('phpunit.numberOfTests') - $buildObject->getStatistics()->get('phpunit.numberOfFailures');
             } else {
                 $data['Number of Tests'][$buildNo] = 0;
                 $data['Failed tests'][$buildNo] = 0;
                 $data['Passed tests'][$buildNo] = 0;
             }
             unset($buildObject);
         } catch (Exception $e) {
             // TODO: Handle
         }
     }
     return $data;
 }
Ejemplo n.º 3
0
 public function getContent(Xinc_Build_Interface $build)
 {
     $deliverableLinkTemplateFile = Xinc_Data_Repository::getInstance()->getWeb('templates' . DIRECTORY_SEPARATOR . 'dashboard' . DIRECTORY_SEPARATOR . 'detail' . DIRECTORY_SEPARATOR . 'extension' . DIRECTORY_SEPARATOR . 'documentation-link.phtml');
     $deliverableLinkTemplate = file_get_contents($deliverableLinkTemplateFile);
     $getDeliverableUrl = './api/documentation/get/file/' . $build->getProject()->getName() . '/' . $build->getBuildTime() . '/';
     $statusDir = Xinc_Gui_Handler::getInstance()->getStatusDir();
     $subDir = $build->getStatusSubDir();
     $docDir = $statusDir . DIRECTORY_SEPARATOR . $subDir . DIRECTORY_SEPARATOR . Xinc_Plugin_Repos_Documentation::DOCUMENTATION_DIR;
     $deliverableLinks = array();
     $docs = $build->getInternalProperties()->get('documentation');
     if (!is_array($docs)) {
         return false;
     }
     foreach ($docs as $alias => $array) {
         $publicName = $alias;
         $dirName = dirname($array['file']);
         $indexFile = preg_replace('/\\/+/', '/', $array['index']);
         $myDocDir = $docDir . DIRECTORY_SEPARATOR . $publicName;
         $myDocDir = preg_replace('/\\/+/', '/', $myDocDir);
         $indexFile = str_replace($myDocDir, '', $indexFile);
         $link = $getDeliverableUrl . $publicName . '/' . $indexFile;
         $link = preg_replace('/\\/+/', '/', $link);
         $deliverableLinks[] = call_user_func_array('sprintf', array($deliverableLinkTemplate, $link, $publicName));
     }
     return implode(', ', $deliverableLinks);
 }
Ejemplo n.º 4
0
 /**
  *
  * @param integer $start
  * @param integer $limit
  *
  * @return array
  */
 private function _getProjectListing($start, $limit = null)
 {
     $statusDir = Xinc_Gui_Handler::getInstance()->getStatusDir();
     $dh = opendir($statusDir);
     $projects = array();
     while ($file = readdir($dh)) {
         if (preg_match('/(.*)\\.history/', $file, $matches)) {
             $projects[] = $matches[1];
         }
     }
     return $projects;
 }
Ejemplo n.º 5
0
 /**
  * Gets a build defined by its project name and buildTime
  *
  * @param string $projectName
  * @param integer $buildTime
  * @throws Xinc_Build_Exception_Unserialization
  * @throws Xinc_Build_Exception_NotFound
  * @return Xinc_Build_Interface
  */
 public static function getBuild(Xinc_Project $project, $buildTime)
 {
     $statusDir = null;
     if (class_exists('Xinc_Gui_Handler')) {
         $statusDir = Xinc_Gui_Handler::getInstance()->getStatusDir();
     } else {
         if (class_exists('Xinc')) {
             $statusDir = Xinc::getInstance()->getStatusDir();
         }
     }
     return Xinc_Build::unserialize($project, $buildTime, $statusDir);
 }
Ejemplo n.º 6
0
 protected function _generateChildren()
 {
     $builds = new Xinc_Build_Iterator();
     $handler = Xinc_Gui_Handler::getInstance();
     $statusDir = $handler->getStatusDir();
     $dir = opendir($statusDir);
     while ($file = readdir($dir)) {
         $fullfile = $statusDir . DIRECTORY_SEPARATOR . $file;
         if (!in_array($file, array('.', '..')) && is_dir($fullfile)) {
             $statusfile = $fullfile . DIRECTORY_SEPARATOR . 'build.ser';
             if (file_exists($statusfile)) {
                 $project = new Xinc_Project();
                 $project->setName($file);
                 try {
                     $object = Xinc_Build_Repository::getLastBuild($project);
                     $builds->add($object);
                 } catch (Exception $e) {
                 }
             }
         }
     }
     $projects = array();
     while ($builds->hasNext()) {
         $build = $builds->next();
         /**
          * Do we have children?
          */
         $children = array();
         foreach ($this->_subMenus as $subExtension) {
             $item = $subExtension->getItem($build->getProject());
             if (!$item instanceof Xinc_Plugin_Repos_Gui_Menu_Extension_Item) {
                 continue;
             }
             $children[] = $item->generate();
         }
         $item = new Xinc_Plugin_Repos_Gui_Menu_Extension_Item('project-' . $build->getProject()->getName() . '-' . $build->getBuildTime(), $build->getLabel() . ' - ' . $build->getProject()->getName(), './dashboard/detail?project=' . $build->getProject()->getName() . '&timestamp=' . $build->getBuildTime(), $build->getProject()->getName(), '', false, count($children) > 0 ? false : true, $children);
         $projects[] = $item->generate();
     }
     return implode(',', $projects);
 }
Ejemplo n.º 7
0
 public function buildDataSet(Xinc_Project $project, array $buildHistoryArr = array(), $previousData = array())
 {
     if (count($previousData) > 0) {
         $data = $previousData;
     } else {
         $data = array('Build Status' => array('Successful Builds' => 0, 'Failed Builds' => 0));
     }
     foreach ($buildHistoryArr as $buildTimestamp => $buildFileName) {
         try {
             $buildObject = Xinc_Build::unserialize($project, $buildTimestamp, Xinc_Gui_Handler::getInstance()->getStatusDir());
             if ($buildObject->getStatus() == Xinc_Build_Interface::PASSED) {
                 $data['Build Status']['Successful Builds']++;
             } else {
                 $data['Build Status']['Failed Builds']++;
             }
             unset($buildObject);
         } catch (Exception $e) {
             // TODO: Handle
         }
     }
     return $data;
 }
Ejemplo n.º 8
0
 public function buildDataSet(Xinc_Project $project, array $buildHistoryArr = array(), $previousData = array())
 {
     if (count($previousData) > 0) {
         $data = $previousData;
     } else {
         $data = array('Successful Builds' => array(), 'Failed Builds' => array());
     }
     $builds = array();
     foreach ($buildHistoryArr as $buildTimestamp => $buildFileName) {
         try {
             $buildObject = Xinc_Build::unserialize($project, $buildTimestamp, Xinc_Gui_Handler::getInstance()->getStatusDir());
             $duration = $buildObject->getStatistics()->get('build.duration');
             $buildNo = $buildObject->getNumber();
             if (!is_numeric($duration)) {
                 $duration = 0;
             }
             if (isset($builds[$buildNo])) {
                 $builds[$buildNo]++;
                 $buildNo .= '.f' . $builds[$buildNo];
             } else {
                 $builds[$buildNo] = 0;
             }
             if ($buildObject->getStatus() == Xinc_Build_Interface::PASSED) {
                 $data['Successful Builds'][$buildNo] = $duration;
                 $data['Failed Builds'][$buildNo] = 0;
             } else {
                 $data['Failed Builds'][$buildNo] = $duration;
                 $data['Successful Builds'][$buildNo] = 0;
             }
             $prevBuildNo = $buildNo;
             unset($buildObject);
         } catch (Exception $e) {
             // TODO: Handle
         }
     }
     return $data;
 }
Ejemplo n.º 9
0
 private function _getHistoryBuilds($projectName, $start, $limit = null)
 {
     $project = new Xinc_Project();
     $project->setName($projectName);
     try {
         $buildHistoryArr = Xinc_Build_History::getFromTo($project, $start, $limit);
         $totalCount = Xinc_Build_History::getCount($project);
         $builds = array();
         foreach ($buildHistoryArr as $buildTimestamp => $buildFileName) {
             try {
                 //echo $buildTimestamp . ' - '. $buildFileName . "<br>";
                 //Xinc_Build_Repository::getBuild($project, $buildTimestamp);
                 //$buildObject = Xinc_Build::unserialize($project,
                 //                                       $buildTimestamp,
                 //                                       Xinc_Gui_Handler::getInstance()->getStatusDir());
                 $buildObject = Xinc_Build_Repository::getBuild($project, $buildTimestamp);
                 $timezone = $buildObject->getConfigDirective('timezone');
                 if ($timezone !== null) {
                     Xinc_Timezone::set($timezone);
                 }
                 $builds[] = array('buildtime' => date('Y-m-d H:i:s', $buildObject->getBuildTime()), 'timezone' => Xinc_Timezone::get(), 'buildtimeRaw' => $buildObject->getBuildTime(), 'label' => $buildObject->getLabel(), 'status' => $buildObject->getStatus());
                 /**
                  * restore to system timezone
                  */
                 $xincTimezone = Xinc_Gui_Handler::getInstance()->getConfigDirective('timezone');
                 if ($xincTimezone !== null) {
                     Xinc_Timezone::set($xincTimezone);
                 } else {
                     Xinc_Timezone::reset();
                 }
             } catch (Exception $e) {
                 // TODO: Handle
             }
         }
         //$builds = array_reverse($builds);
     } catch (Exception $e) {
         $builds = array();
         $totalCount = 0;
     }
     $object = new stdClass();
     $object->totalcount = $totalCount;
     $object->builds = $builds;
     //return new Xinc_Build_Iterator($builds);
     return $object;
 }
Ejemplo n.º 10
0
<?php

require_once 'Xinc/Ini.php';
require_once 'Xinc/Gui/Handler.php';
/*
 * get environment variables or read config.xml
 */
$handler = new Xinc_Gui_Handler(Xinc_Ini::getInstance()->get('etc', 'xinc') . DIRECTORY_SEPARATOR . 'system.xml', Xinc_Ini::getInstance()->get('status_dir', 'xinc'));
$handler->view();
Ejemplo n.º 11
0
 public function handleEvent($eventId)
 {
     $this->projectName = $_GET['project'];
     if (isset($_GET['timestamp'])) {
         $this->buildTimeStamp = $_GET['timestamp'];
     }
     $this->project = new Xinc_Project();
     $this->project->setName($this->projectName);
     switch ($eventId) {
         case Xinc_Gui_Event::PAGE_LOAD:
             $handler = Xinc_Gui_Handler::getInstance();
             $statusDir = $handler->getStatusDir();
             if ($this->buildTimeStamp != null) {
                 $fullStatusDir = Xinc_Build_History::getBuildDir($this->project, $this->buildTimeStamp);
             } else {
                 $fullStatusDir = Xinc_Build_History::getLastBuildDir($this->project);
                 $this->buildTimeStamp = Xinc_Build_History::getLastBuildTime($this->project);
             }
             //$statusFile = $fullStatusDir . DIRECTORY_SEPARATOR . 'build.ser';
             $this->build = Xinc_Build::unserialize($this->project, $this->buildTimeStamp, Xinc_Gui_Handler::getInstance()->getStatusDir());
             $timezone = $this->build->getConfigDirective('timezone');
             if ($timezone !== null) {
                 Xinc_Timezone::set($timezone);
             }
             $detailDir = $fullStatusDir;
             /**
              * get History Builds
              */
             //$this->historyBuilds = $this->getHistoryBuilds($statusDir);
             /**
              * Generate the build selector on the right
              */
             $this->_generateBuildsView();
             /**
              * Overview info tab
              */
             $this->_generateSummaryView();
             /**
              * Generate the tab for the log messages
              */
             $this->_generateLogView();
             /**
              * Generate the external tabs that were registered through a hook
              */
             $this->_generateExternalExtensions();
             include Xinc_Data_Repository::getInstance()->getWeb('templates' . DIRECTORY_SEPARATOR . 'dashboard' . DIRECTORY_SEPARATOR . 'detail' . DIRECTORY_SEPARATOR . 'projectDetail.phtml');
             break;
         default:
             break;
     }
     /**
      * restore to system timezone
      */
     $xincTimezone = Xinc_Gui_Handler::getInstance()->getConfigDirective('timezone');
     if ($xincTimezone !== null) {
         Xinc_Timezone::set($xincTimezone);
     } else {
         Xinc_Timezone::reset();
     }
 }
Ejemplo n.º 12
0
 /**
  * Get history of all the builds for a project
  *
  * @param string $projectName
  * @param integer $start
  * @param integer $limit
  *
  * @return stdClass
  */
 private function _getHistoryBuilds($projectName, $start, $limit = null)
 {
     $statusDir = Xinc_Gui_Handler::getInstance()->getStatusDir();
     $historyFile = $statusDir . DIRECTORY_SEPARATOR . $projectName . '.history';
     $project = new Xinc_Project();
     $project->setName($projectName);
     $buildHistoryArr = unserialize(file_get_contents($historyFile));
     $totalCount = count($buildHistoryArr);
     if ($limit == null) {
         $limit = $totalCount;
     }
     $buildHistoryArr = array_slice($buildHistoryArr, $start, $limit, true);
     $builds = array();
     foreach ($buildHistoryArr as $buildTimestamp => $buildFileName) {
         try {
             $buildObject = Xinc_Build::unserialize($project, $buildTimestamp, Xinc_Gui_Handler::getInstance()->getStatusDir());
             $builds[] = array('buildtime' => $buildObject->getBuildTime(), 'label' => $buildObject->getLabel());
         } catch (Exception $e) {
             // TODO: Handle
         }
     }
     $builds = array_reverse($builds);
     $object = new stdClass();
     $object->totalcount = $totalCount;
     $object->builds = $builds;
     //return new Xinc_Build_Iterator($builds);
     return $object;
 }
Ejemplo n.º 13
0
 /**
  * returns the status dir
  *
  * @return string
  */
 private static function _getStatusDir()
 {
     $statusDir = null;
     $isGuiMode = false;
     $isXincMode = false;
     if (class_exists('Xinc_Gui_Handler')) {
         $handler = Xinc_Gui_Handler::getInstance();
         $isGuiMode = $handler instanceof Xinc_Gui_Handler;
     }
     if (class_exists('Xinc')) {
         $xinc = Xinc::getInstance();
         $isXincMode = $xinc instanceof Xinc;
     }
     if ($isGuiMode) {
         // we are in gui mode
         $statusDir = Xinc_Gui_Handler::getInstance()->getStatusDir();
     } else {
         if ($isXincMode) {
             $statusDir = Xinc::getInstance()->getStatusDir();
         } else {
             try {
                 $statusDir = Xinc_Ini::getInstance()->get('status_dir', 'xinc');
             } catch (Exception $e) {
                 $statusDir = null;
             }
         }
     }
     return $statusDir;
 }
Ejemplo n.º 14
0
 /**
  * Get a list of all builds of a project
  *
  * @param string $projectName
  * @param integer $start
  * @param integer $limit
  *
  * @return stdClass
  */
 private function _getLogMessagesArr($projectName, $buildTime, $start, $limit = null)
 {
     $statusDir = Xinc_Gui_Handler::getInstance()->getStatusDir();
     $historyFile = $statusDir . DIRECTORY_SEPARATOR . $projectName . '.history';
     $project = new Xinc_Project();
     $project->setName($projectName);
     $totalCount = 0;
     try {
         $build = Xinc_Build::unserialize($project, $buildTime, $statusDir);
         $timezone = $build->getConfigDirective('timezone');
         if ($timezone !== null) {
             Xinc_Timezone::set($timezone);
         }
         $detailDir = Xinc_Build_History::getBuildDir($project, $buildTime);
         $logXmlFile = $detailDir . DIRECTORY_SEPARATOR . 'buildlog.xml';
         if (file_exists($logXmlFile)) {
             /**
              * Add fopen() to the function to just get the loglines
              * that we need.
              * the bigger the logfiles get, the more this gets a
              * performance problem
              */
             $xmlStr = '';
             $pos = 0;
             $fh = fopen($logXmlFile, 'r');
             $xmlStr = fgets($fh);
             $xmlStr .= fgets($fh);
             $tagOpen = false;
             while ($pos < $start && ($message = $this->_getNextMessage($fh)) !== false) {
                 $pos++;
                 $totalCount++;
             }
             if ($limit != null) {
                 $addClosingTag = true;
                 while ($pos < $start + $limit && ($message = $this->_getNextMessage($fh)) !== false) {
                     $xmlStr .= $message;
                     $pos++;
                     $totalCount++;
                 }
                 $xmlStr .= '</build>';
             } else {
                 while (($message = $this->_getNextMessage($fh)) !== false) {
                     $xmlStr .= $message;
                     $totalCount++;
                     $pos++;
                 }
                 $xmlStr .= '</build>';
             }
             $tagOpen = false;
             $tagClosed = false;
             while (($message = $this->_getNextMessage($fh)) !== false) {
                 $totalCount++;
                 $pos++;
             }
             fclose($fh);
             $logXml = new SimpleXMLElement($xmlStr);
         } else {
             $logXml = new SimpleXmlElement('<log/>');
         }
         $totalCount = $pos;
         //count($logXml->children());
         $i = $pos;
         $logmessages = array();
         $id = $totalCount - $start;
         foreach ($logXml->children() as $logEntry) {
             $attributes = $logEntry->attributes();
             $logmessages[] = array('id' => $id--, 'date' => (string) $attributes->timestamp, 'stringdate' => date('Y-m-d H:i:s', (int) $attributes->timestamp), 'timezone' => Xinc_Timezone::get(), 'priority' => (string) $attributes->priority, 'message' => base64_decode($logEntry));
         }
         /**
          * restore to system timezone
          */
         $xincTimezone = Xinc_Gui_Handler::getInstance()->getConfigDirective('timezone');
         if ($xincTimezone !== null) {
             Xinc_Timezone::set($xincTimezone);
         } else {
             Xinc_Timezone::reset();
         }
         //$logmessages = array_slice($logmessages, $start, $limit, false);
     } catch (Exception $e1) {
         $totalCount = 0;
         $logmessages = array();
     }
     $object = new stdClass();
     $object->totalmessages = $totalCount;
     $object->logmessages = $logmessages;
     //return new Xinc_Build_Iterator($builds);
     return $object;
 }
Ejemplo n.º 15
0
 public function getArtifacts(Xinc_Build_Interface $build)
 {
     $statusDir = Xinc_Gui_Handler::getInstance()->getStatusDir();
     $projectName = $build->getProject()->getName();
     $buildTimestamp = $build->getBuildTime();
     $buildLabel = $build->getLabel();
     $templateFile = Xinc_Data_Repository::getInstance()->getWeb('templates' . DIRECTORY_SEPARATOR . 'dashboard' . DIRECTORY_SEPARATOR . 'detail' . DIRECTORY_SEPARATOR . 'extension' . DIRECTORY_SEPARATOR . 'artifactsJs.phtml');
     $template = file_get_contents($templateFile);
     $content = str_replace(array('{projectname}', '{buildtime}', '{buildlabel}'), array($projectName, $buildTimestamp, $buildLabel), $template);
     return $content;
 }
Ejemplo n.º 16
0
 public function getTestResults(Xinc_Build_Interface $build)
 {
     require_once 'PEAR/Config.php';
     $statusDir = Xinc_Gui_Handler::getInstance()->getStatusDir();
     $projectName = $build->getProject()->getName();
     $buildTimestamp = $build->getBuildTime();
     $buildLabel = $build->getLabel();
     $templateFile = Xinc_Data_Repository::getInstance()->getWeb('templates' . DIRECTORY_SEPARATOR . 'dashboard' . DIRECTORY_SEPARATOR . 'detail' . DIRECTORY_SEPARATOR . 'extension' . DIRECTORY_SEPARATOR . 'phpunit-summary.phtml');
     $template = file_get_contents($templateFile);
     $url = '/phpunit/results/?project=' . $projectName . '&buildtime=' . $buildTimestamp . '&f=results.html';
     $sourceFile = $build->getInternalProperties()->get('phpunit.file');
     if ($sourceFile != null && file_exists($sourceFile) && class_exists('XSLTProcessor')) {
         $xslFile = Xinc_Data_Repository::getInstance()->getPlugins('resources' . DIRECTORY_SEPARATOR . 'phpunit' . DIRECTORY_SEPARATOR . 'summary.xsl');
         try {
             $outputFileName = Xinc_Ini::getInstance()->get('tmp_dir', 'xinc') . DIRECTORY_SEPARATOR . 'phpunit_summary_' . $projectName . '_' . $buildTimestamp;
         } catch (Exception $e) {
             Xinc_Logger::getInstance()->error('Cannot get xinc.ini configuration');
             $outputFileName = 'phpunit_summary_' . $projectName . '_' . $buildTimestamp;
         }
         if (file_exists($outputFileName)) {
             $summary = file_get_contents($outputFileName);
         } else {
             $summary = $this->_transformResults($sourceFile, $xslFile, $outputFileName);
         }
         //$click = 'openMenuTab(\'phpunit-'.$projectName.'-'.$buildTimestamp.'\',\'PHPUnit - '.$projectName.'\',\''.$url.'\',null,false,false,\'auto\');';
         $detailsLink = '<a href="' . $url . '">Details</a>';
         $content = str_replace(array('{detailsLink}', '{summary}'), array($detailsLink, $summary), $template);
     } else {
         $content = false;
     }
     return $content;
 }
Ejemplo n.º 17
0
 public function handleEvent($eventId)
 {
     switch ($eventId) {
         case Xinc_Gui_Event::PAGE_LOAD:
             $query = urldecode($_SERVER['REQUEST_URI']);
             $this->features = $this->extensions['PROJECT_FEATURE'];
             $handler = Xinc_Gui_Handler::getInstance();
             $statusDir = $handler->getStatusDir();
             $dir = opendir($statusDir);
             while ($file = readdir($dir)) {
                 $project = array();
                 $fullfile = $statusDir . DIRECTORY_SEPARATOR . $file;
                 if (!in_array($file, array('.', '..')) && is_dir($fullfile)) {
                     $project['name'] = $file;
                     $statusfile = $fullfile . DIRECTORY_SEPARATOR . 'build.ser';
                     //$xincProject = $fullfile . DIRECTORY_SEPARATOR . '.xinc';
                     if (file_exists($statusfile)) {
                         //$ini = parse_ini_file($statusfile, true);
                         $project = new Xinc_Project();
                         $project->setName($file);
                         try {
                             $object = Xinc_Build_Repository::getLastBuild($project);
                             $this->builds->add($object);
                         } catch (Exception $e) {
                         }
                     } else {
                         if (file_exists($xincProject)) {
                             $project['build.status'] = -10;
                             $project['build.time'] = 0;
                             $project['build.label'] = '';
                             $this->projects[] = $project;
                         }
                     }
                     $this->menu = '';
                     if (isset($this->extensions['MAIN_MENU'])) {
                         if (is_array($this->extensions['MAIN_MENU'])) {
                             foreach ($this->extensions['MAIN_MENU'] as $extension) {
                                 $this->menu .= call_user_func_array($extension, array($this, 'Dashboard'));
                             }
                         }
                     }
                 }
             }
             if (preg_match('/\\/dashboard\\/projects.*/', $query)) {
                 include_once Xinc_Data_Repository::getInstance()->getWeb('templates' . DIRECTORY_SEPARATOR . 'dashboard' . DIRECTORY_SEPARATOR . 'projects.phtml');
             }
             break;
         default:
             break;
     }
     /**
      * restore to system timezone
      */
     $xincTimezone = Xinc_Gui_Handler::getInstance()->getConfigDirective('timezone');
     if ($xincTimezone !== null) {
         Xinc_Timezone::set($xincTimezone);
     } else {
         Xinc_Timezone::reset();
     }
 }