Example #1
0
 public function indexAction()
 {
     $server = new stdClass();
     foreach ($_SERVER as $k => $v) {
         $server->{$k} = $v;
     }
     $this->view->pageTitle = $this->translate('admin_headline');
     $this->view->system = $server;
     $this->view->isAdmin = Zend_Auth::getInstance()->getIdentity()->hasRole('admin_admin');
     $this->view->version = FansubCMS_Version::getCurrentVersion();
     if ($this->request->getParam('checkLatest')) {
         $this->view->latestVersion = FansubCMS_Version::getLatest();
         $this->view->update = FansubCMS_Version::compareVersion(FansubCMS_Version::getLatest());
     }
     $this->view->zendVersion = FansubCMS_Version::getFrameworkVersion(FansubCMS_Version::ZEND);
     $this->view->doctrineVersion = FansubCMS_Version::getFrameworkVersion(FansubCMS_Version::DOCTRINE);
 }
Example #2
0
 /**
  * Fetches the version of the latest stable release
  *
  * @return string
  */
 public static function getLatest()
 {
     if (null === self::$_lastestVersion) {
         self::$_lastestVersion = 'not available';
         $handle = fopen(self::$_updateUrl, 'r');
         if (false !== $handle) {
             $versions = stream_get_contents($handle);
             $versions = explode("\n", $versions);
             foreach ($versions as $version) {
                 if (substr($version, 0, 7) == 'latest=') {
                     self::$_lastestVersion = trim(str_replace('latest=', '', $version));
                     break;
                 }
             }
             fclose($handle);
         }
     }
     return self::$_lastestVersion;
 }