/** * Load service YAML * * @param string $path File path * * @return mixed */ public function loadServiceYAML($path) { return \Includes\Utils\Operator::loadServiceYAML($path); }
* to licensing@x-cart.com so we can send you a copy immediately. * * DISCLAIMER * * Do not modify this file if you wish to upgrade X-Cart to newer versions * in the future. If you wish to customize X-Cart for your needs please * refer to http://www.x-cart.com/ for more information. * * @category X-Cart 5 * @author Qualiteam software Ltd <*****@*****.**> * @copyright Copyright (c) 2011-2015 Qualiteam software Ltd <*****@*****.**>. All rights reserved * @license http://www.x-cart.com/license-agreement.html X-Cart 5 License Agreement * @link http://www.x-cart.com/ */ return function () { $data = \Includes\Utils\Operator::loadServiceYAML(LC_DIR_VAR . 'cleanURL.pages.yaml'); if ($data) { /** @var \XLite\Model\Repo\ARepo $repo */ $repo = \XLite\Core\Database::getRepo('XLite\\Module\\CDev\\SimpleCMS\\Model\\Page'); $iterator = $repo->getExportIterator(); $iterator->rewind(); while ($iterator->valid()) { /** @var \XLite\Model\AEntity $entity */ $entity = $iterator->current(); $entity = $entity[0]; if (!empty($data[$entity->getUniqueIdentifier()])) { $cleanURL = $data[$entity->getUniqueIdentifier()]; $entity->setCleanUrl($cleanURL . '.htm', true); $entity->setCleanUrl($cleanURL . '.html', true); \XLite\Core\Database::getEM()->flush(); \XLite\Core\Database::getEM()->clear();
/** * Move registry info entry from ENABLED registry to the DISABLED one. * Module must be set as DISABLED in the DB after this operation * * @param string $module Module actual name * * @return boolean Flag if the registry entry was moved */ public static function moveModuleToDisabledRegistry($module) { $enabledPath = static::getEnabledStructurePath(); $enabledRegistry = \Includes\Utils\Operator::loadServiceYAML($enabledPath); $disabledPath = static::getDisabledStructuresPath(); $disabledRegistry = \Includes\Utils\Operator::loadServiceYAML($disabledPath); $result = false; if (isset($enabledRegistry[$module])) { $disabledRegistry[$module] = $enabledRegistry[$module]; unset($enabledRegistry[$module]); $result = true; } static::storeModuleRegistry($enabledPath, $enabledRegistry); static::storeModuleRegistry($disabledPath, $disabledRegistry); return $result; }