/** * Execute certain hook handle * * @return void */ public function executeHookHandler() { if (\XLite\Upgrade\Cell::getInstance()->isUpgraded()) { $entries = \XLite\Upgrade\Cell::getInstance()->getEntries(); if ($entries) { \Includes\Utils\Operator::showMessage('', true, false); /** @var \XLite\Upgrade\Entry\AEntry $entry */ foreach ($entries as $entry) { if (!$entry->isPostUpgradeActionsCalled()) { $message = '...Invoke actions for ' . $entry->getActualName(); \Includes\Decorator\Utils\CacheManager::logMessage(PHP_EOL); \Includes\Decorator\Utils\CacheManager::logMessage($message); $isInvoked = \XLite\Upgrade\Cell::getInstance()->runHelper($entry, 'post_rebuild'); if ($isInvoked && \XLite\Upgrade\Cell::getInstance()->getHookRedirect()) { break; } if (!\XLite\Upgrade\Cell::getInstance()->hasUnfinishedUpgradeHooks('post_rebuild', $entry)) { // All post-rebuild hooks completed, run the rest actions... \XLite\Upgrade\Cell::getInstance()->runCommonHelper($entry, 'add_labels'); \XLite\Upgrade\Cell::getInstance()->callInstallEvent($entry); $entry->setPostUpgradeActionsCalled(); } if (\Includes\Decorator\Utils\CacheManager::isTimeExceeds(static::STEP_TTL)) { break; } } } } } \Includes\Decorator\Utils\CacheManager::logMessage(PHP_EOL); \XLite\Core\Database::getEM()->flush(); \XLite\Core\Database::getEM()->clear(); }
/** * Execute certain hook handle * * @return void */ public function executeHookHandler() { $list = \Includes\Decorator\Plugin\Doctrine\Utils\FixturesManager::getFixtures(); if ($list) { \Includes\Utils\Operator::showMessage('', true, false); foreach ($list as $fixture) { $message = '...Load ' . substr($fixture, strlen(LC_DIR_ROOT)); \Includes\Utils\Operator::showMessage($message, true, true); \Includes\Decorator\Utils\CacheManager::logMessage(PHP_EOL); \Includes\Decorator\Utils\CacheManager::logMessage($message); if (static::isYAML($fixture)) { // Load YAML fixture \XLite\Core\Database::getInstance()->loadFixturesFromYaml($fixture); } else { // Load SQL queries \Includes\Utils\Database::uploadSQLFromFile($fixture); } \Includes\Decorator\Plugin\Doctrine\Utils\FixturesManager::removeFixtureFromList($fixture); if (\Includes\Decorator\Utils\CacheManager::isTimeExceeds(static::STEP_TTL)) { break; } } } \Includes\Decorator\Utils\CacheManager::logMessage(PHP_EOL); \XLite\Core\Database::getEM()->clear(); }
/** * Execute certain hook handle * * @return void */ public function executeHookHandler() { $schema = \Includes\Decorator\Plugin\Doctrine\Utils\DBSchemaManager::getDBSchema(); if ($schema) { do { $queries = array(); foreach ($schema as $k => $query) { $queries[] = $query; unset($schema[$k]); } if ($queries) { \XLite\Core\Database::getInstance()->executeQueries($queries); } } while ($schema && !\Includes\Decorator\Utils\CacheManager::isTimeExceeds(static::STEP_TTL)); \Includes\Decorator\Plugin\Doctrine\Utils\DBSchemaManager::updateDBSchema($schema); } }
/** * Execute certain hook handle * * @return void */ public function executeHookHandler() { if (static::isCalculateCacheAllowed() && \Includes\Decorator\Utils\CacheInfo::get('rebuildBlockMark')) { $i = static::getCounter(); do { $processed = \XLite\Core\QuickData::getInstance()->updateChunk($i, static::CHUNK_LENGTH); if (0 < $processed) { \XLite\Core\Database::getEM()->clear(); } $i += $processed; static::setCounter($i); \Includes\Utils\Operator::showMessage('.', false, true); } while (0 < $processed && !\Includes\Decorator\Utils\CacheManager::isTimeExceeds(static::STEP_TTL)); } }