public function __construct()
 {
     $releaseManifest = UpdateService::getInstance()->getReleaseManifest();
     $oldPath = $releaseManifest['old_root_path'];
     require_once $oldPath . 'generis/vendor/autoload.php';
     require_once $oldPath . 'generis/common/conf/db.conf.php';
     $connectionParams = array('driver' => SGBD_DRIVER, 'host' => DATABASE_URL, 'dbname' => DATABASE_NAME, 'user' => DATABASE_LOGIN, 'password' => DATABASE_PASS);
     $config = new \Doctrine\DBAL\Configuration();
     $this->connection = \Doctrine\DBAL\DriverManager::getConnection($connectionParams, $config);
 }
 /**
  * Generate a list of installed extensions and their versions
  * 
  * @return array an assoiciativ array with extensionId => extensionVersion
  */
 private function getExtensionVersions()
 {
     $manifest = UpdateService::getInstance()->getReleaseManifest();
     $list = array();
     foreach ($manifest['old_extensions'] as $extId) {
         if (isset(self::$renamedExtensions[$extId])) {
             $list[self::$renamedExtensions[$extId]] = '0';
         } else {
             $list[$extId] = '0';
         }
     }
     $list['funcAcl'] = '0';
     return $list;
 }
 /**
  * (non-PHPdoc)
  * @see \OatBox\Common\ScriptRunner::run()
  */
 public function run()
 {
     $service = UpdateService::getInstance();
     $extManifests = $service->getUpdateManifests();
     $releaseManifest = $service->getReleaseManifest();
     $oldRootPath = $releaseManifest['old_root_path'];
     foreach ($extManifests as $ext => $update) {
         Logger::t('Moving Folder ' . $ext);
         File::move($oldRootPath . $ext, DIR_DATA . 'old/' . $ext, false);
     }
     $rootFiles = array('.htaccess', 'index.php', 'favicon.ico', 'fdl-1.3.txt', 'gpl-2.0.txt', 'license', 'version', 'readme.txt');
     foreach ($rootFiles as $file) {
         if (is_file($oldRootPath . $file)) {
             Logger::t('Moving File ' . $file);
             File::move($oldRootPath . $file, DIR_DATA . 'old/' . $file, false);
         } else {
             Logger::w('File not found : ' . $file);
         }
     }
 }
Example #4
0
 /**
  * 
  * @access public
  * @author "Lionel Lecaque, <*****@*****.**>"
  */
 public function index()
 {
     if (!$this->hasRequestParameter('key')) {
         $this->redirect(ROOT_URL . Uri::url('maintenance', 'Main'));
     }
     $key = $this->getRequestParameter('key');
     if (!UpdateService::isAllowed($key)) {
         $this->redirect(ROOT_URL . Uri::url('maintenance', 'Main'));
     } else {
         if ($this->releaseManifest['status'] == 'patch') {
             $successMsg = 'Patch have been deployed, update completed, <a>return to TAO HOME</a>';
             $successLink = ROOT_URL . '..';
         } else {
             $successMsg = 'First phase of your update is achieved, in next phase will migrate your data according to new version. <a>Click to proceed.</a>';
             $successLink = ROOT_URL . '../taoUpdate/data/index?key=' . $this->service->getkey();
         }
         $this->setData('successLink', $successLink);
         $this->setData('successMsg', $successMsg);
         $this->setData('ROOT_URL', ROOT_URL);
         $this->setView('logViewer.tpl');
     }
 }
 private function getOldRootPath()
 {
     $service = UpdateService::getInstance();
     $releaseManifest = $service->getReleaseManifest();
     return $releaseManifest['old_root_path'];
 }
 public function run()
 {
     $service = UpdateService::getInstance();
     $service->restartTaoContext();
 }
 public function run()
 {
     $service = UpdateService::getInstance();
     $service->deployNewRelease();
 }