本文整理汇总了PHP中Tools::generateHtaccess方法的典型用法代码示例。如果您正苦于以下问题:PHP Tools::generateHtaccess方法的具体用法?PHP Tools::generateHtaccess怎么用?PHP Tools::generateHtaccess使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tools
的用法示例。
在下文中一共展示了Tools::generateHtaccess方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: install
/**
* Install Procedure
*/
public function install()
{
// Set an url rewriting for prediggo search page
$oMeta = new Meta();
$oMeta->page = 'search_prediggo';
$oMeta->title = array(1 => '', 2 => '');
$oMeta->description = array(1 => '', 2 => '');
$oMeta->keywords = array(1 => '', 2 => '');
$oMeta->url_rewrite = array(1 => 'prediggo_search', 2 => 'prediggo_recherche');
// Set the hook registration
return $oMeta->save() && Db::getInstance()->autoExecute(_DB_PREFIX_ . 'meta', array('page' => 'modules/prediggo/prediggo_search'), 'UPDATE', '`page` = "search_prediggo"') && Tools::generateHtaccess(dirname(__FILE__) . '/../../.htaccess', Configuration::get('PS_REWRITING_SETTINGS'), Configuration::get('PS_HTACCESS_CACHE_CONTROL'), Configuration::get('PS_HTACCESS_SPECIFIC')) && parent::install() && $this->oPrediggoConfig->install() && $this->oPrediggoExportConfig->install() && $this->oPrediggoRecommendationConfig->install() && $this->oPrediggoSearchConfig->install() && $this->registerHook('header') && $this->registerHook('top') && $this->registerHook('leftColumn') && $this->registerHook('rightColumn') && $this->registerHook('footer') && $this->registerHook('authentication') && $this->registerHook('createAccount') && $this->registerHook('backOfficeHeader') && $this->registerHook('paymentTop');
}
示例2: updateOptionPsRewritingSettings
/**
* Called when PS_REWRITING_SETTINGS option is saved
*/
public function updateOptionPsRewritingSettings()
{
Configuration::updateValue('PS_REWRITING_SETTINGS', (int) Tools::getValue('PS_REWRITING_SETTINGS'));
Tools::generateHtaccess($this->ht_file, null, null, '', Tools::getValue('PS_HTACCESS_DISABLE_MULTIVIEWS'));
}
示例3: processSave
public function processSave()
{
$object = $this->loadObject(true);
if ($object->canAddThisUrl(Tools::getValue('domain'), Tools::getValue('domain_ssl'), Tools::getValue('physical_uri'), Tools::getValue('virtual_uri'))) {
$this->errors[] = Tools::displayError('A shop URL that uses this domain already exists.');
}
$return = parent::processSave();
if (!$this->errors) {
Tools::generateHtaccess();
}
return $return;
}
示例4: create_new_shop
public static function create_new_shop($id_seller, $name)
{
$knpphuwouh = "name";
$ebmaugy = "name";
$awebgo = "name";
${"GLOBALS"}["avcwqfcrll"] = "name";
${"GLOBALS"}["ecrzsoxmp"] = "id_show_url";
${"GLOBALS"}["eoufbdiy"] = "shop";
if (empty(${${"GLOBALS"}["plonjgth"]})) {
${$awebgo} = "shop";
}
if (Shop::shop_name_duplicated(${${"GLOBALS"}["avcwqfcrll"]}, 0)) {
${$knpphuwouh} = ${$ebmaugy} . "-" . ${${"GLOBALS"}["blyprwch"]};
}
${${"GLOBALS"}["dcjyfpglzfy"]} = new Shop((int) Configuration::get("PS_SHOP_DEFAULT"));
${${"GLOBALS"}["eoufbdiy"]} = new Shop();
$shop->name = ${${"GLOBALS"}["plonjgth"]};
$shop->id_shop_group = $defshop->id_shop_group;
$shop->id_category = $defshop->id_category;
${"GLOBALS"}["lydbmjobdy"] = "id_found";
$shop->active = 1;
$shop->deleted = 0;
$shop->id_theme = $defshop->id_theme;
${"GLOBALS"}["dbvkuxo"] = "id_show_url";
$shop->add();
${${"GLOBALS"}["iqatubf"]} = "SELECT id_shop_url \tFROM " . _DB_PREFIX_ . "shop_url WHERE active = 1 AND main=1 AND id_shop = " . (int) Configuration::get("PS_SHOP_DEFAULT");
${${"GLOBALS"}["dbvkuxo"]} = intval(Db::getInstance()->getValue(${${"GLOBALS"}["iqatubf"]}));
${${"GLOBALS"}["flauwpvwozn"]} = new ShopUrl(${${"GLOBALS"}["ecrzsoxmp"]});
$shopurl->id = 0;
$shopurl->id_shop = $shop->id;
if ((int) Configuration::get("ASP_SHOP_URL_MODE") == agilemultipleshop::SHOP_URL_MODE_DOMAIN) {
$shopurl->domain = Tools::link_rewrite(${${"GLOBALS"}["plonjgth"]}) . "." . str_replace("www.", "", $shopurl->domain);
$shopurl->domain_ssl = Tools::link_rewrite(${${"GLOBALS"}["plonjgth"]}) . "." . str_replace("www.", "", $shopurl->domain_ssl);
} else {
$shopurl->virtual_uri = Tools::link_rewrite(${${"GLOBALS"}["plonjgth"]});
}
${${"GLOBALS"}["lydbmjobdy"]} = $shopurl->canAddThisUrl($shopurl->domain, $shopurl->domain_ssl, $shopurl->physical_uri, $shopurl->virtual_uri);
if (intval(${${"GLOBALS"}["ewdnile"]}) > 0) {
$shopurl->virtual_uri = $shopurl->virtual_uri . "-" . ${${"GLOBALS"}["blyprwch"]};
}
$shopurl->active = 1;
$shopurl->add();
Tools::generateHtaccess();
return $shop->id;
}
示例5: update
public function update($nullValues = false)
{
if (!parent::update($nullValues)) {
return false;
}
return Tools::generateHtaccess(dirname(__FILE__) . '/../.htaccess', (int) Configuration::get('PS_REWRITING_SETTINGS'), (int) Configuration::get('PS_HTACCESS_CACHE_CONTROL'), Configuration::get('PS_HTACCESS_SPECIFIC'));
}
示例6: processDelete
public function processDelete()
{
if (!Validate::isLoadedObject($object = $this->loadObject())) {
$this->errors[] = Tools::displayError('Unable to load this shop.');
} else {
if (!Shop::hasDependency($object->id)) {
$result = Category::deleteCategoriesFromShop($object->id) && parent::processDelete();
Tools::generateHtaccess();
return $result;
} else {
$this->errors[] = Tools::displayError('You can\'t delete this shop (customer and/or order dependency).');
}
}
return false;
}
示例7: deleteSelection
public function deleteSelection($selection)
{
if (!is_array($selection)) {
die(Tools::displayError());
}
$result = true;
foreach ($selection as $id) {
$this->id = (int) $id;
$result = $result && $this->delete();
}
return $result && Tools::generateHtaccess();
}
示例8: processSave
public function processSave()
{
/** @var ShopUrl $object */
$object = $this->loadObject(true);
if ($object->canAddThisUrl(Tools::getValue('domain'), Tools::getValue('domain_ssl'), Tools::getValue('physical_uri'), Tools::getValue('virtual_uri'))) {
$this->errors[] = $this->trans('A shop URL that uses this domain already exists.', array(), 'Admin.Notifications.Error');
}
$unallowed = str_replace('/', '', Tools::getValue('virtual_uri'));
if ($unallowed == 'c' || $unallowed == 'img' || is_numeric($unallowed)) {
$this->errors[] = $this->trans('A shop virtual URL cannot be "%URL%"', array('%URL%' => $unallowed), 'Admin.Notifications.Error');
}
$return = parent::processSave();
if (!$this->errors) {
Tools::generateHtaccess();
Tools::clearSmartyCache();
Media::clearCache();
}
return $return;
}
示例9: updateOptionPsRewritingSettings
/**
* Called when PS_REWRITING_SETTINGS option is saved
*/
public function updateOptionPsRewritingSettings()
{
Configuration::updateValue('PS_REWRITING_SETTINGS', (int) Tools::getValue('PS_REWRITING_SETTINGS'));
Tools::generateHtaccess($this->ht_file, null, null, '', Tools::getValue('PS_HTACCESS_DISABLE_MULTIVIEWS'));
Tools::enableCache();
Tools::clearCache($this->context->smarty);
Tools::restoreCacheSettings();
}
示例10: processSubmitSellerinfo
//.........这里部分代码省略.........
}
$this->errors = array_merge($this->errors, $this->sellerinfo->validateController());
$this->sellerinfo->id_customer = self::$cookie->id_customer;
if (Module::isInstalled("agilemultipleshop")) {
$mcovgfrp = "shop_name";
${"GLOBALS"}["xdpblji"] = "seller_shopurl";
if (empty(${$mcovgfrp})) {
$this->errors[] = Tools::displayError("The shop name can not be empty.");
}
if (empty($_POST["virtual_uri"]) and (int) Configuration::get("ASP_SHOP_URL_MODE") == agilemultipleshop::SHOP_URL_MODE_VIRTUAL) {
$this->errors[] = Tools::displayError("The shop Virtual Uri can not be empty.");
}
${"GLOBALS"}["edessnqo"] = "id_found";
${"GLOBALS"}["kkzhciyk"] = "seller_shop";
if ($this->sellerinfo->id_shop <= 1) {
$this->sellerinfo->id_shop = 0;
}
${${"GLOBALS"}["kkzhciyk"]} = new Shop($this->sellerinfo->id_shop);
if (Shop::shop_name_duplicated(${${"GLOBALS"}["oxjolt"]}, $seller_shop->id)) {
$this->errors[] = Tools::displayError("The shop name you select has been used by other seller. Please choose a new one.");
}
${"GLOBALS"}["asepnxuok"] = "seller_shop";
if ($this->errors) {
return;
}
if (!Validate::isLoadedObject(${${"GLOBALS"}["asepnxuok"]})) {
$this->sellerinfo->id_shop = AgileMultipleShop::create_new_shop($this->sellerinfo->id_seller, ${${"GLOBALS"}["oxjolt"]});
$this->sellerinfo->update();
${${"GLOBALS"}["esrnnrtkg"]} = new Shop($this->sellerinfo->id_shop);
}
${${"GLOBALS"}["xdpblji"]} = new ShopUrl(Shop::get_main_url_id($seller_shop->id));
${${"GLOBALS"}["edessnqo"]} = $seller_shopurl->canAddThisUrl($seller_shopurl->domain, $seller_shopurl->domain_ssl, $seller_shopurl->physical_uri, ${${"GLOBALS"}["uovivsqns"]});
if (intval(${${"GLOBALS"}["vphoqso"]}) > 0) {
$this->errors[] = Tools::displayError("The uri you select has been used by other seller. Please choose a new one.");
}
}
${"GLOBALS"}["uehqptpfhppm"] = "seller_shop";
if (!(${${"GLOBALS"}["flggvi"]} = new Country($this->sellerinfo->id_country)) || !Validate::isLoadedObject(${$famsbcd})) {
throw new PrestaShopException("Country cannot be loaded with address->id_country");
}
if ((int) $country->contains_states && !(int) $this->sellerinfo->id_state) {
$this->errors[] = Tools::displayError("This country requires a state selection.");
}
${$uskhfeodhv} = $country->zip_code_format;
if ($country->need_zip_code) {
$guefxsgyxvp = "zip_code_format";
${"GLOBALS"}["ayucbbdhdhcq"] = "zip_code_format";
$krvjmkmqh = "postcode";
${"GLOBALS"}["smbwfoxbj"] = "zip_code_format";
if ((${${"GLOBALS"}["wnwubvg"]} = Tools::getValue("postcode")) && ${${"GLOBALS"}["ayucbbdhdhcq"]}) {
${"GLOBALS"}["gusjike"] = "zip_regexp";
${"GLOBALS"}["bgahkjn"] = "zip_regexp";
$edhlvb = "zip_regexp";
${"GLOBALS"}["yvbcolkxptn"] = "zip_regexp";
$pslxhegowq = "zip_regexp";
${${"GLOBALS"}["ctdciodhb"]} = "/^" . ${${"GLOBALS"}["ebwpvmqblmd"]} . "\$/ui";
${"GLOBALS"}["mivinoyltqoh"] = "zip_regexp";
${$pslxhegowq} = str_replace(" ", "( |)", ${${"GLOBALS"}["ctdciodhb"]});
${${"GLOBALS"}["mivinoyltqoh"]} = str_replace("-", "(-|)", ${${"GLOBALS"}["bgahkjn"]});
${${"GLOBALS"}["ctdciodhb"]} = str_replace("N", "[0-9]", ${${"GLOBALS"}["gusjike"]});
${${"GLOBALS"}["ctdciodhb"]} = str_replace("L", "[a-zA-Z]", ${${"GLOBALS"}["ctdciodhb"]});
${${"GLOBALS"}["ctdciodhb"]} = str_replace("C", $country->iso_code, ${${"GLOBALS"}["yvbcolkxptn"]});
// if (!preg_match(${$edhlvb}, ${${"GLOBALS"}["wnwubvg"]}))
// $this->errors[] = "<strong>" . Tools::displayError("Zip / Postal code") . "</strong> " . Tools::displayError("is invalid.") . "<br />" . Tools::displayError("Must be typed as follows:") . " " . str_replace("C", $country->iso_code, str_replace("N", "0", str_replace("L", "A", ${${"GLOBALS"}["ebwpvmqblmd"]})));
}
/*else if (${$guefxsgyxvp})
$this->errors[] = "<strong>" . Tools::displayError("Zip / Postal code") . "</strong> " . Tools::displayError("is required.");
else if (${${"GLOBALS"}["wnwubvg"]} && !preg_match("/^[0-9a-zA-Z -]{4,9}\$/ui", ${$krvjmkmqh}))
$this->errors[] = "<strong>" . Tools::displayError("Zip / Postal code") . "</strong> " . Tools::displayError("is invalid.") . "<br />" . Tools::displayError("Must be typed as follows:") . " " . str_replace("C", $country->iso_code, str_replace("N", "0", str_replace("L", "A", ${${"GLOBALS"}["smbwfoxbj"]})));
*/
}
if ($country->isNeedDni() && (!Tools::getValue("dni") || !Validate::isDniLite(Tools::getValue("dni")))) {
$this->errors[] = Tools::displayError("Identification number is incorrect or has already been used.");
}
$this->sellerinfo->dni = Tools::getValue("dni");
$this->sellerinfo->latitude = Tools::getValue("latitude");
$this->sellerinfo->longitude = Tools::getValue("longitude");
$this->sellerinfo->id_sellertype1 = Tools::getValue("id_sellertype1");
$this->sellerinfo->id_sellertype2 = Tools::getValue("id_sellertype2");
// echo '<pre>', print_r($_FILES, true) , '</pre>';
SellerInfo::processLogoUpload($this->sellerinfo);
SellerInfo::processLicenseUpload($this->sellerinfo);
$this->errors = array_merge($this->errors, $this->sellerinfo->validateController());
if (!empty($this->errors)) {
return;
}
$this->sellerinfo->save();
if (Module::isInstalled("agilemultipleshop") and Validate::isLoadedObject(${${"GLOBALS"}["uehqptpfhppm"]})) {
$wrheluzg = "shop_name";
$seller_shop->name = ${$wrheluzg};
$seller_shop->save();
${"GLOBALS"}["sxuwmytjl"] = "virtual_uri";
$seller_shopurl->virtual_uri = ${${"GLOBALS"}["sxuwmytjl"]};
$seller_shopurl->save();
Tools::generateHtaccess();
}
if (empty($this->errors)) {
self::$smarty->assign("cfmmsg_flag", 1);
}
}
示例11: disable_htaccess_cache
private static function disable_htaccess_cache()
{
$successMsg = 'Successfully disabled htaccess cache control';
$errMsg = 'Could not disable htaccess cache control';
$notChanged = 'Htaccess cache control wal already disabled';
if (PS_CLI_TOOLS::update_global_value('PS_HTACCESS_CACHE_CONTROL', false, $successMsg, $errMsg, $notChanged)) {
if (Tools::generateHtaccess()) {
return true;
} else {
return false;
}
} else {
return false;
}
}
示例12: enableURLRewriting
function enableURLRewriting()
{
Configuration::updateValue('PS_REWRITING_SETTINGS', 1);
Tools::generateHtaccess();
}
示例13: postProcess
public function postProcess()
{
/* PrestaShop demo mode */
if (_PS_MODE_DEMO_) {
$this->errors[] = $this->trans('This functionality has been disabled.', array(), 'Admin.Notifications.Error');
return;
}
Hook::exec('action' . get_class($this) . ucfirst($this->action) . 'Before', array('controller' => $this));
if (Tools::isSubmit('submitAddServer')) {
if ($this->access('add')) {
if (!Tools::getValue('memcachedIp')) {
$this->errors[] = $this->trans('The Memcached IP is missing.', array(), 'Admin.Parameters.Notification');
}
if (!Tools::getValue('memcachedPort')) {
$this->errors[] = $this->trans('The Memcached port is missing.', array(), 'Admin.Parameters.Notification');
}
if (!Tools::getValue('memcachedWeight')) {
$this->errors[] = $this->trans('The Memcached weight is missing.', array(), 'Admin.Parameters.Notification');
}
if (!count($this->errors)) {
if (CacheMemcache::addServer(pSQL(Tools::getValue('memcachedIp')), (int) Tools::getValue('memcachedPort'), (int) Tools::getValue('memcachedWeight'))) {
Tools::redirectAdmin(self::$currentIndex . '&token=' . Tools::getValue('token') . '&conf=4');
} else {
$this->errors[] = $this->trans('The Memcached server cannot be added.', array(), 'Admin.Parameters.Notification');
}
}
} else {
$this->errors[] = $this->trans('You do not have permission to add this.', array(), 'Admin.Notifications.Error');
}
}
if (Tools::getValue('deleteMemcachedServer')) {
if ($this->access('add')) {
if (CacheMemcache::deleteServer((int) Tools::getValue('deleteMemcachedServer'))) {
Tools::redirectAdmin(self::$currentIndex . '&token=' . Tools::getValue('token') . '&conf=4');
} else {
$this->errors[] = $this->trans('There was an error when attempting to delete the Memcached server.', array(), 'Admin.Parameters.Notification');
}
} else {
$this->errors[] = $this->trans('You do not have permission to delete this.', array(), 'Admin.Notifications.Error');
}
}
$redirectAdmin = false;
if ((bool) Tools::getValue('smarty_up')) {
if ($this->access('edit')) {
Configuration::updateValue('PS_SMARTY_FORCE_COMPILE', Tools::getValue('smarty_force_compile', _PS_SMARTY_NO_COMPILE_));
if (Configuration::get('PS_SMARTY_CACHE') != Tools::getValue('smarty_cache')) {
Tools::clearSmartyCache();
}
Configuration::updateValue('PS_SMARTY_CACHE', Tools::getValue('smarty_cache', 0));
Configuration::updateValue('PS_SMARTY_CLEAR_CACHE', Tools::getValue('smarty_clear_cache'));
Configuration::updateValue('PS_SMARTY_LOCAL', Tools::getValue('smarty_local', 0));
$redirectAdmin = true;
} else {
$this->errors[] = $this->trans('You do not have permission to edit this.', array(), 'Admin.Notifications.Error');
}
}
if ((bool) Tools::getValue('features_detachables_up')) {
if ($this->access('edit')) {
if (Tools::isSubmit('combination')) {
if ((!Tools::getValue('combination') && Combination::isCurrentlyUsed()) === false) {
Configuration::updateValue('PS_COMBINATION_FEATURE_ACTIVE', (bool) Tools::getValue('combination'));
}
}
if (Tools::isSubmit('customer_group')) {
if ((!Tools::getValue('customer_group') && Group::isCurrentlyUsed()) === false) {
Configuration::updateValue('PS_GROUP_FEATURE_ACTIVE', (bool) Tools::getValue('customer_group'));
}
}
Configuration::updateValue('PS_FEATURE_FEATURE_ACTIVE', (bool) Tools::getValue('feature'));
$redirectAdmin = true;
} else {
$this->errors[] = $this->trans('You do not have permission to edit this.', array(), 'Admin.Notifications.Error');
}
}
if ((bool) Tools::getValue('ccc_up')) {
if ($this->access('edit')) {
$theme_cache_directory = _PS_ALL_THEMES_DIR_ . $this->context->shop->theme_directory . '/cache/';
@mkdir($theme_cache_directory, 0777, true);
if (((bool) Tools::getValue('PS_CSS_THEME_CACHE') || (bool) Tools::getValue('PS_JS_THEME_CACHE')) && !is_writable($theme_cache_directory)) {
$this->errors[] = $this->trans('To use Smart Cache, the directory %directorypath% must be writable.', array('%directorypath%' => realpath($theme_cache_directory)), 'Admin.Parameters.Notification');
}
if ($tmp = (int) Tools::getValue('PS_CSS_THEME_CACHE')) {
$version = (int) Configuration::get('PS_CCCCSS_VERSION');
if (Configuration::get('PS_CSS_THEME_CACHE') != $tmp) {
Configuration::updateValue('PS_CCCCSS_VERSION', ++$version);
}
}
if ($tmp = (int) Tools::getValue('PS_JS_THEME_CACHE')) {
$version = (int) Configuration::get('PS_CCCJS_VERSION');
if (Configuration::get('PS_JS_THEME_CACHE') != $tmp) {
Configuration::updateValue('PS_CCCJS_VERSION', ++$version);
}
}
if (!Configuration::updateValue('PS_CSS_THEME_CACHE', (int) Tools::getValue('PS_CSS_THEME_CACHE')) || !Configuration::updateValue('PS_JS_THEME_CACHE', (int) Tools::getValue('PS_JS_THEME_CACHE')) || !Configuration::updateValue('PS_HTML_THEME_COMPRESSION', (int) Tools::getValue('PS_HTML_THEME_COMPRESSION')) || !Configuration::updateValue('PS_JS_HTML_THEME_COMPRESSION', (int) Tools::getValue('PS_JS_HTML_THEME_COMPRESSION')) || !Configuration::updateValue('PS_JS_DEFER', (int) Tools::getValue('PS_JS_DEFER')) || !Configuration::updateValue('PS_HTACCESS_CACHE_CONTROL', (int) Tools::getValue('PS_HTACCESS_CACHE_CONTROL'))) {
$this->errors[] = $this->trans('Unknown error.', array(), 'Admin.Notifications.Error');
} else {
$redirectAdmin = true;
if (Configuration::get('PS_HTACCESS_CACHE_CONTROL')) {
if (is_writable(_PS_ROOT_DIR_ . '/.htaccess')) {
Tools::generateHtaccess();
//.........这里部分代码省略.........
示例14: _writeRewriteRule
private function _writeRewriteRule()
{
if ($this->checkRewriteRule()) {
return true;
}
if (version_compare(_PS_VERSION_, '1.5.0.0', '>=')) {
$htaccess_source = file_get_contents($this->_htFile);
$dest_rule = 'index.php?fc=module&module=pm_advancedsearch4&controller=advancedsearch4&isolang=$1&id_seo=$2&seo_url=$3';
} else {
$htaccess_source = Configuration::get('PS_HTACCESS_SPECIFIC');
$dest_rule = __PS_BASE_URI__ . 'modules/pm_advancedsearch4/advancedsearch4.php?isolang=$1&id_seo=$2&seo_url=$3';
$dest_rule_2 = __PS_BASE_URI__ . 'modules/pm_advancedsearch4/advancedsearch4.php?';
}
if (preg_match('#\\^\\(\\[a-z\\]\\{2\\}\\)\\/s/#', $htaccess_source)) {
$PS_HTACCESS_SPECIFIC = preg_replace('#\\^\\(\\[a-z\\]\\{2\\}\\)\\/s/#', '^([a-z]{2})?/?s/', $htaccess_source);
} else {
if (preg_match('#\\#START AS4 RULES#', $htaccess_source)) {
$htaccess_source = preg_replace('#\\#START AS4 RULES(.*)\\#END AS4 RULES\\n?#s', '', $htaccess_source);
}
$PS_HTACCESS_SPECIFIC = '#START AS4 RULES (Do not remove)' . "\n";
if (version_compare(_PS_VERSION_, '1.5.0.0', '>=')) {
$PS_HTACCESS_SPECIFIC .= '<IfModule mod_rewrite.c>' . "\n" . 'RewriteEngine on' . "\n";
}
$PS_HTACCESS_SPECIFIC .= 'RewriteRule ^as4_seositemap.xml$ modules/pm_advancedsearch4/sitemap/seositemap.xml [L]' . "\n";
$PS_HTACCESS_SPECIFIC .= 'RewriteRule ^as4_seositemap-([0-9]+).xml$ modules/pm_advancedsearch4/sitemap/seositemap-$1.xml [L]' . "\n";
if (version_compare(_PS_VERSION_, '1.5.0.0', '>=') && Shop::isFeatureActive()) {
foreach (array_values(Shop::getCompleteListOfShopsID()) as $id_shop) {
$shopUrl = new Shop($id_shop);
$base_uri = $shopUrl->virtual_uri;
$PS_HTACCESS_SPECIFIC .= 'RewriteCond %{QUERY_STRING} !^controller=products-comparison [NC]' . "\n";
$PS_HTACCESS_SPECIFIC .= 'RewriteRule ^' . str_replace('\\-', '-', preg_quote($base_uri)) . '([a-z]{2})?/?s/([0-9]+)/([a-zA-Z0-9/_-]*) ' . $dest_rule . ' [QSA,L]' . "\n";
}
} else {
if (version_compare(_PS_VERSION_, '1.5.0.0', '>=')) {
$PS_HTACCESS_SPECIFIC .= 'RewriteCond %{QUERY_STRING} !^controller=products-comparison [NC]' . "\n";
}
$PS_HTACCESS_SPECIFIC .= 'RewriteRule ^([a-z]{2})?/?s/([0-9]+)/([a-zA-Z0-9/_-]*) ' . $dest_rule . ' [QSA,L]' . "\n";
$PS_HTACCESS_SPECIFIC .= 'RewriteCond %{QUERY_STRING} ^isolang=([a-z]{2})&id_seo=([0-9]+)&seo_url=([a-zA-Z0-9/_-]*).*p=([0-9]+)$' . "\n";
$PS_HTACCESS_SPECIFIC .= 'RewriteRule ^advancedsearch4.php ' . __PS_BASE_URI__ . '%1/s/%2/%3?p=%4 [R=301,L]' . "\n";
$PS_HTACCESS_SPECIFIC .= 'RewriteCond %{QUERY_STRING} ^isolang=([a-z]{2})&id_seo=([0-9]+)&seo_url=([a-zA-Z0-9/_-]*)' . "\n";
$PS_HTACCESS_SPECIFIC .= 'RewriteRule ^advancedsearch4.php ' . __PS_BASE_URI__ . '%1/s/%2/%3? [R=301,L]' . "\n";
$PS_HTACCESS_SPECIFIC .= 'RewriteCond %{QUERY_STRING} ^id_seo=([0-9]+)&seo_url=([a-zA-Z0-9/_-]*).*p=([0-9]+)$' . "\n";
$PS_HTACCESS_SPECIFIC .= 'RewriteRule ^advancedsearch4.php ' . __PS_BASE_URI__ . 's/%1/%2?p=%3 [R=301,L]' . "\n";
$PS_HTACCESS_SPECIFIC .= 'RewriteCond %{QUERY_STRING} ^id_seo=([0-9]+)&seo_url=([a-zA-Z0-9/_-]*)' . "\n";
$PS_HTACCESS_SPECIFIC .= 'RewriteRule ^advancedsearch4.php ' . __PS_BASE_URI__ . 's/%1/%2? [R=301,L]' . "\n";
}
if (version_compare(_PS_VERSION_, '1.5.0.0', '>=')) {
$PS_HTACCESS_SPECIFIC .= '</IfModule>' . "\n";
}
$PS_HTACCESS_SPECIFIC .= '#END AS4 RULES' . "\n";
$PS_HTACCESS_SPECIFIC .= $htaccess_source;
}
if (version_compare(_PS_VERSION_, '1.5.0.0', '>=')) {
return file_put_contents($this->_htFile, $PS_HTACCESS_SPECIFIC);
} else {
Configuration::updateValue('PS_HTACCESS_SPECIFIC', $PS_HTACCESS_SPECIFIC, true);
if (Tools::generateHtaccess($this->_htFile, Configuration::get('PS_REWRITING_SETTINGS'), Configuration::get('PS_HTACCESS_CACHE_CONTROL'), $PS_HTACCESS_SPECIFIC, Configuration::get('PS_HTACCESS_DISABLE_MULTIVIEWS'))) {
return true;
}
}
return false;
}
示例15: update
public function update($nullValues = false)
{
if (!parent::update($nullValues)) {
return false;
}
// If url_rewrite is not enabled, we don't need to regenerate .htaccess
if (!Configuration::get('PS_REWRITING_SETTINGS')) {
return true;
}
return Tools::generateHtaccess(dirname(__FILE__) . '/../.htaccess', (int) Configuration::get('PS_REWRITING_SETTINGS'), (int) Configuration::get('PS_HTACCESS_CACHE_CONTROL'), Configuration::get('PS_HTACCESS_SPECIFIC'), (int) Configuration::get('PS_HTACCESS_DISABLE_MULTIVIEWS'));
}