예제 #1
0
 /**
  * Run the controller
  */
 public function run()
 {
     // Check if shop has been installed
     $blnInstalled = \Database::getInstance()->tableExists(Config::getTable());
     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 ' . RepositoryVersion::format(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);
         }
     }
 }
예제 #2
0
 /**
  * Initialize the content element
  * @param object
  */
 public function __construct($objElement)
 {
     parent::__construct($objElement);
     // Load Isotope JavaScript and style sheet
     if (TL_MODE == 'FE') {
         $version = RepositoryVersion::encode(Isotope::VERSION);
         $GLOBALS['TL_JAVASCRIPT'][] = Debug::uncompressedFile('system/modules/isotope/assets/js/isotope.min.js|static|' . $version);
         $GLOBALS['TL_CSS'][] = Debug::uncompressedFile('system/modules/isotope/assets/css/isotope.min.css|screen|static|' . $version);
     }
 }
예제 #3
0
 /**
  * Load libraries and scripts
  *
  * @param \ModuleModel $objModule
  * @param string $strColumn
  */
 public function __construct($objModule, $strColumn = 'main')
 {
     parent::__construct($objModule, $strColumn);
     if ($this->iso_list_where != '') {
         $this->iso_list_where = Haste::getInstance()->call('replaceInsertTags', $this->iso_list_where);
     }
     $this->iso_buttons = deserialize($this->iso_buttons);
     if (!is_array($this->iso_buttons)) {
         $this->iso_buttons = array();
     }
     Isotope::initialize();
     // Load Isotope JavaScript and style sheet
     if (TL_MODE == 'FE') {
         $version = RepositoryVersion::encode(Isotope::VERSION);
         $GLOBALS['TL_JAVASCRIPT'][] = Debug::uncompressedFile('system/modules/isotope/assets/js/isotope.min.js|static|' . $version);
         $GLOBALS['TL_CSS'][] = Debug::uncompressedFile('system/modules/isotope/assets/css/isotope.min.css|screen|static|' . $version);
         // Disable caching for pages with certain modules (eg. Cart)
         if ($this->blnDisableCache) {
             global $objPage;
             $objPage->cache = 0;
         }
     }
 }
예제 #4
0
 /**
  * @deprecated Deprecated since Haste 4.8, to be removed in Haste 5.
  *             Use RepositoryVersion::formatShort() instead.
  */
 public static function repositoryShortVersion($aVersion)
 {
     return RepositoryVersion::formatShort($aVersion);
 }
 /**
  * @dataProvider semverProvider
  */
 public function testEncodeSemver($input, $expected)
 {
     $this->assertEquals($expected, RepositoryVersion::encode($input));
 }