예제 #1
0
파일: Main.php 프로젝트: kirkbauer2/kirkxc
 /**
  * Execute certain hook handler
  *
  * @return void
  */
 public function executeHookHandler()
 {
     // Truncate old
     if (!\Includes\Decorator\Utils\CacheManager::isCapsular()) {
         $this->clearAll();
     }
     // Create new
     $this->createLists();
 }
예제 #2
0
파일: Main.php 프로젝트: kirkbauer2/kirkxc
 /**
  * Execute certain hook handler
  *
  * @return void
  */
 public function executeHookHandler()
 {
     // Delete old and rename new
     if (\Includes\Decorator\Utils\CacheManager::isCapsular()) {
         $repo = \XLite\Core\Database::getRepo('XLite\\Model\\TemplatePatch');
         $key = \Includes\Decorator\Utils\CacheManager::getKey();
         $repo->deleteObsolete($key);
         $repo->markCurrentVersion($key);
     }
 }
예제 #3
0
파일: Main.php 프로젝트: kirkbauer2/kirkxc
 /**
  * Execute certain hook handle
  *
  * @return void
  */
 public function executeHookHandler()
 {
     $this->saveMetadata();
     if (!\Includes\Decorator\Utils\CacheManager::isCapsular() || $this->isMetadataChanged()) {
         \Includes\Decorator\Utils\CacheInfo::set('metadataChangedState', true);
         \Includes\Decorator\Plugin\Doctrine\Utils\DBSchemaManager::prepareDBSchema();
     } else {
         \Includes\Decorator\Utils\CacheInfo::set('metadataChangedState', false);
         \Includes\Decorator\Plugin\Doctrine\Utils\DBSchemaManager::removeDBSchema();
     }
 }
예제 #4
0
파일: Main.php 프로젝트: kirkbauer2/kirkxc
 /**
  * Execute certain hook handler
  *
  * @return void
  */
 public function executeHookHandler()
 {
     // Remove old capsular directories
     if (\Includes\Decorator\Utils\CacheManager::isCapsular()) {
         $currentKey = \Includes\Decorator\Utils\CacheManager::getKey();
         foreach (\Includes\Decorator\Utils\CacheManager::getCacheDirs(true) as $dir) {
             $list = glob(rtrim($dir, LC_DS) . '.*');
             if ($list) {
                 foreach ($list as $subdir) {
                     list($main, $key) = explode('.', $subdir, 2);
                     if ($key && $key != $currentKey) {
                         \Includes\Utils\FileManager::unlinkRecursive($subdir);
                     }
                 }
             }
         }
     }
     \Includes\Decorator\Utils\CacheManager::cleanupCache();
     // Load classes from "classes" (do not use cache)
     \Includes\Autoloader::switchLcAutoloadDir();
     \Includes\Decorator\Plugin\Doctrine\Plugin\QuickData\Main::initializeCounter();
 }
예제 #5
0
 /**
  * Check - current plugin is bocking or not
  *
  * @return boolean
  */
 public function isBlockingPlugin()
 {
     return !\Includes\Decorator\Utils\CacheManager::isCapsular();
 }
예제 #6
0
파일: Main.php 프로젝트: kirkbauer2/kirkxc
 /**
  * Prepare common properties
  *
  * @param array  $data  Data describe the patch
  * @param string $class Patcher class
  *
  * @return array
  */
 protected function getCommonData(array $data, $class)
 {
     $parts = explode(':', $data[$class::PATCHER_CELL_TPL], 3);
     if (1 == count($parts)) {
         $parts = array('customer', '', $parts[0]);
     } elseif (2 == count($parts)) {
         $parts = array($parts[0], '', $parts[1]);
     }
     $version = \Includes\Decorator\Utils\CacheManager::isCapsular() ? \Includes\Decorator\Utils\CacheManager::getKey() : null;
     return array('patch_type' => $data[$class::PATCHER_CELL_TYPE], 'version' => $version) + array_combine(array('zone', 'lang', 'tpl'), $parts);
 }
예제 #7
0
 /**
  * Construct data key 
  * 
  * @param mixed $key Key
  *  
  * @return string
  */
 protected static function constructDataKey($key)
 {
     if (true === $key) {
         $key = \Includes\Decorator\Utils\CacheManager::isCapsular() ? \Includes\Decorator\Utils\CacheManager::getkey() : '_';
     } elseif (false === $key) {
         $key = '_';
     }
     return $key;
 }