Ejemplo n.º 1
0
 /**
  * Run the controller
  */
 public function run()
 {
     // Check if shop has been installed
     $blnInstalled = \Database::getInstance()->tableExists(\Isotope\Model\Config::getTable());
     $strStep = '';
     foreach (scan(TL_ROOT . '/system/modules/isotope/library/Isotope/Upgrade') as $strFile) {
         $strVersion = pathinfo($strFile, PATHINFO_FILENAME);
         if (preg_match('/To[0-9]{10}/', $strVersion)) {
             $strClass = 'Isotope\\Upgrade\\' . $strVersion;
             $strStep = 'Version ' . \Haste\Util\Format::repositoryVersion(substr($strVersion, 2));
             try {
                 $objUpgrade = new $strClass();
                 $objUpgrade->run($blnInstalled);
             } catch (\Exception $e) {
                 $this->handleException($strStep, $e);
             }
         }
     }
     if ($blnInstalled) {
         try {
             $this->verifySystemIntegrity();
             $this->purgeCaches();
         } catch (\Exception $e) {
             $this->handleException('Finalization', $e);
         }
     }
 }