当前位置: 首页>>代码示例>>PHP>>正文


PHP Tools::clearCache方法代码示例

本文整理汇总了PHP中Tools::clearCache方法的典型用法代码示例。如果您正苦于以下问题:PHP Tools::clearCache方法的具体用法?PHP Tools::clearCache怎么用?PHP Tools::clearCache使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Tools的用法示例。


在下文中一共展示了Tools::clearCache方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getContent

 public function getContent()
 {
     $output = '';
     $errors = array();
     if (Tools::isSubmit('submitHomeFeatured')) {
         $nbr = Tools::getValue('HOME_FEATURED_NBR');
         if (!Validate::isInt($nbr) || $nbr <= 0) {
             $errors[] = $this->l('The number of products is invalid. Please enter a positive number.');
         }
         $cat = Tools::getValue('HOME_FEATURED_CAT');
         if (!Validate::isInt($cat) || $cat <= 0) {
             $errors[] = $this->l('The category ID is invalid. Please choose an existing category ID.');
         }
         $rand = Tools::getValue('HOME_FEATURED_RANDOMIZE');
         if (!Validate::isBool($rand)) {
             $errors[] = $this->l('Invalid value for the "randomize" flag.');
         }
         if (isset($errors) && count($errors)) {
             $output = $this->displayError(implode('<br />', $errors));
         } else {
             Configuration::updateValue('HOME_FEATURED_NBR', (int) $nbr);
             Configuration::updateValue('HOME_FEATURED_CAT', (int) $cat);
             Configuration::updateValue('HOME_FEATURED_RANDOMIZE', (bool) $rand);
             Tools::clearCache(Context::getContext()->smarty, $this->getTemplatePath('homefeatured.tpl'));
             $output = $this->displayConfirmation($this->l('Your settings have been updated.'));
         }
     }
     return $output . $this->renderForm();
 }
开发者ID:jpodracky,项目名称:dogs,代码行数:29,代码来源:homefeatured.php

示例2: upgrade_module_0_9

function upgrade_module_0_9($module)
{
    $module_path = $module->getLocalPath();
    $img_folder_path = $module->getLocalPath() . 'img';
    $fixture_img_path = $module->getLocalPath() . 'img' . DIRECTORY_SEPARATOR . 'fixtures';
    if (!Tools::file_exists_cache($img_folder_path)) {
        mkdir($img_folder_path);
    }
    if (!Tools::file_exists_cache($fixture_img_path)) {
        mkdir($fixture_img_path);
    }
    $files = scandir($module->getLocalPath());
    foreach ($files as $file) {
        if (strncmp($file, 'advertising', 11) == 0) {
            if ($file == 'advertising.jpg') {
                copy($module_path . $file, $fixture_img_path . DIRECTORY_SEPARATOR . $file);
            } else {
                copy($module_path . $file, $img_folder_path . DIRECTORY_SEPARATOR . $file);
            }
            unlink($module_path . $file);
        }
    }
    Tools::clearCache(Context::getContext()->smarty, $module->getTemplatePath('blockadvertising.tpl'));
    return true;
}
开发者ID:ortegon000,项目名称:tienda,代码行数:25,代码来源:install-0.9.php

示例3: upgrade_module_1_3_4

function upgrade_module_1_3_4($module)
{
    if (Tools::file_exists_cache($module->getLocalPath() . 'img')) {
        recurseCopy($module->getLocalPath() . 'img', $module->getLocalPath() . 'images', true);
    }
    Tools::clearCache(Context::getContext()->smarty, $module->getTemplatePath('homeslider.tpl'));
    return true;
}
开发者ID:dev-lav,项目名称:htdocs,代码行数:8,代码来源:install-1.3.4.php

示例4: getContent

 public function getContent()
 {
     $output = '';
     $errors = array();
     if (Tools::isSubmit('submitSmartBlogAddThis')) {
         $api_kay = Tools::getValue('SMARTBBLOG_ADD_THIS_API_KEY');
         Tools::clearCache(Context::getContext()->smarty, $this->getTemplatePath('smartblogaddthisbutton.tpl'));
         Configuration::updateValue('SMARTBBLOG_ADD_THIS_API_KEY', $api_kay);
         $output .= $this->displayConfirmation($this->l('Your settings have been updated.'));
     }
     return $output . $this->renderForm();
 }
开发者ID:johnulist,项目名称:smartblogaddthisbutton,代码行数:12,代码来源:smartblogaddthisbutton.php

示例5: upgrade_module_1_3_8

function upgrade_module_1_3_8($module)
{
    // Only img present, just need to rename folder
    if (file_exists($module->getLocalPath() . 'img') && !file_exists($module->getLocalPath() . 'images')) {
        rename($module->getLocalPath() . 'img', $module->getLocalPath() . 'images');
    } else {
        if (file_exists($module->getLocalPath() . 'img') && file_exists($module->getLocalPath() . 'images')) {
            recurseCopy($module->getLocalPath() . 'img', $module->getLocalPath() . 'images', true);
        }
    }
    Tools::clearCache(Context::getContext()->smarty, $module->getTemplatePath('homeslider.tpl'));
    return true;
}
开发者ID:evgrishin,项目名称:mh16014,代码行数:13,代码来源:install-1.3.8.php

示例6: getContent

 public function getContent()
 {
     $output = '';
     $errors = array();
     $languages = Language::getLanguages();
     $id_lang_default = (int) Configuration::get('PS_LANG_DEFAULT');
     $id_lang = $this->context->language->id;
     if (Tools::isSubmit('submitGlobal')) {
         Configuration::updateValue('DEALS', Tools::getValue('DEALS'));
         Tools::clearCache(Context::getContext()->smarty, $this->getTemplatePath('discountproducts_home.tpl'));
         $output .= $this->displayConfirmation($this->l('Your settings have been updated.'));
     }
     $output .= $this->displayForm();
     return $output;
 }
开发者ID:habypk,项目名称:zocart,代码行数:15,代码来源:discountproducts.php

示例7: upgrade_module_2_5

function upgrade_module_2_5($module)
{
    $module_path = $module->getLocalPath();
    $img_folder_path = $module->getLocalPath() . 'img';
    if (!Tools::file_exists_cache($img_folder_path)) {
        mkdir($img_folder_path);
    }
    $files = scandir($module->getLocalPath());
    foreach ($files as $file) {
        if (strncmp($file, 'homepage_logo', 13) == 0) {
            copy($module_path . $file, $img_folder_path . DIRECTORY_SEPARATOR . $file);
            unlink($module_path . $file);
        }
    }
    Tools::clearCache(Context::getContext()->smarty, $module->getTemplatePath('editorial.tpl'));
    return true;
}
开发者ID:prestashop,项目名称:editorial,代码行数:17,代码来源:install-2.5.php

示例8: getContent

 public function getContent()
 {
     $output = '';
     $errors = array();
     if (Tools::isSubmit('submitHomeFeatured')) {
         $nbr = (int) Tools::getValue('HOME_FEATURED_NBR');
         if (!$nbr || $nbr <= 0 || !Validate::isInt($nbr)) {
             $errors[] = $this->l('An invalid number of products has been specified.');
         } else {
             Tools::clearCache(Context::getContext()->smarty, $this->getTemplatePath('homefeatured.tpl'));
             Configuration::updateValue('HOME_FEATURED_NBR', (int) $nbr);
         }
         if (isset($errors) && count($errors)) {
             $output .= $this->displayError(implode('<br />', $errors));
         } else {
             $output .= $this->displayConfirmation($this->l('Your settings have been updated.'));
         }
     }
     return $output . $this->renderForm();
 }
开发者ID:carloslastresDev,项目名称:HealthyTaiwan_UsingPrestaShop,代码行数:20,代码来源:homefeatured.php

示例9: updateBlockPosition

 public function updateBlockPosition($order = null)
 {
     if (is_null($order)) {
         return false;
     }
     $position = explode('::', $order);
     $res = false;
     if (count($position) > 0) {
         foreach ($position as $key => $id_block) {
             $res = Db::getInstance()->execute('
                 UPDATE `' . _DB_PREFIX_ . 'advance_topmenu_blocks`
                 SET `position` = ' . $key . '
                 WHERE `id_block` = ' . (int) $id_block);
             if (!$res) {
                 break;
             }
         }
     }
     Tools::clearCache(Context::getContext()->smarty, $this->getTemplatePath('topmenu.tpl'));
     return $res;
 }
开发者ID:abdoumej,项目名称:libsamy,代码行数:21,代码来源:advancetopmenu.php

示例10: _deferedClearCache

 public static function _deferedClearCache($template_path, $cache_id, $compile_id)
 {
     Tools::enableCache();
     $number_of_template_cleared = Tools::clearCache(Context::getContext()->smarty, $template_path, $cache_id, $compile_id);
     Tools::restoreCacheSettings();
     return $number_of_template_cleared;
 }
开发者ID:nmardones,项目名称:PrestaShop,代码行数:7,代码来源:Module.php

示例11: clearSmartyCache

 public function clearSmartyCache()
 {
     Tools::enableCache();
     Tools::clearCache($this->context->smarty);
     Tools::restoreCacheSettings();
 }
开发者ID:M03G,项目名称:PrestaShop,代码行数:6,代码来源:AdminImportController.php

示例12: updateOptionPsRewritingSettings

 /**
  * Called when PS_REWRITING_SETTINGS option is saved
  */
 public function updateOptionPsRewritingSettings()
 {
     Configuration::updateValue('PS_REWRITING_SETTINGS', (int) Tools::getValue('PS_REWRITING_SETTINGS'));
     if (Tools::generateHtaccess($this->ht_file, null, null, '', Tools::getValue('PS_HTACCESS_DISABLE_MULTIVIEWS'), false, Tools::getValue('PS_HTACCESS_DISABLE_MODSEC'))) {
         Tools::enableCache();
         Tools::clearCache($this->context->smarty);
         Tools::restoreCacheSettings();
     } else {
         Configuration::updateValue('PS_REWRITING_SETTINGS', 0);
         // Message copied/pasted from the information tip
         $message = $this->l('Before being able to use this tool, you need to:');
         $message .= '<br />- ' . $this->l('Create a blank .htaccess in your root directory.');
         $message .= '<br />- ' . $this->l('Give it write permissions (CHMOD 666 on Unix system)');
         $this->errors[] = $message;
     }
 }
开发者ID:rongandat,项目名称:vatfairfoot,代码行数:19,代码来源:AdminMetaController.php

示例13: _clearCache

 protected function _clearCache($template, $cacheId = NULL, $compileId = NULL)
 {
     global $smarty;
     Tools::clearCache($smarty);
 }
开发者ID:nicolasjeol,项目名称:hec-ecommerce,代码行数:5,代码来源:Module.php

示例14: getContent

 public function getContent()
 {
     $output = '';
     $errors = array();
     $languages = Language::getLanguages();
     $id_lang_default = (int) Configuration::get('PS_LANG_DEFAULT');
     $id_lang = $this->context->language->id;
     if (Tools::getValue('confirm_msg')) {
         $output .= $this->displayConfirmation(Tools::getValue('confirm_msg'));
     }
     if (Tools::isSubmit('submitGlobal')) {
         $id_position = (int) Tools::getValue('id_position', 1);
         $html_id = $this->getHtmlIdByPosition($id_position);
         if ($html_id && count($html_id) > 0) {
             $htmlObject = new HtmlObject($html_id['id_htmlobject']);
         } else {
             $htmlObject = new HtmlObject();
         }
         $htmlObject->active = (int) Tools::getValue('active');
         //$hook_postition
         $htmlObject->hook_postition = (int) Tools::getValue('id_position');
         foreach ($languages as $language) {
             $htmlObject->title[$language['id_lang']] = Tools::getValue('item_title_' . $language['id_lang']);
             $htmlObject->content[$language['id_lang']] = Tools::getValue('item_html_' . $language['id_lang']);
         }
         if (!$errors || count($errors) < 1) {
             /* Update */
             if ($html_id && count($html_id) > 0) {
                 if (!$htmlObject->update()) {
                     $errors[] = $this->displayError($this->l('The Advertising slide could not be updated.'));
                 }
             } elseif (!$htmlObject->add()) {
                 $errors[] = $this->displayError($this->l('The Advertising slide could not be add.'));
             }
             /* Adds */
         }
         if (!isset($errors) || count($errors) < 1) {
             if ($html_id && count($html_id) > 0) {
                 $confirm_msg = $this->l('Slide successfully updated.');
             } else {
                 $confirm_msg = $this->l('New slide successfully added.');
             }
             Tools::clearCache(Context::getContext()->smarty, $this->getTemplatePath('blockhtml.tpl'));
             Tools::redirectAdmin(AdminController::$currentIndex . '&configure=' . $this->name . '&token=' . Tools::getAdminTokenLite('AdminModules') . '&confirm_msg=' . $confirm_msg . '&id_position=' . $id_position);
         }
     }
     if (isset($errors) && count($errors)) {
         $output .= $this->displayError(implode('<br />', $errors));
     }
     return $output . $this->displayForm();
 }
开发者ID:habypk,项目名称:zocart,代码行数:51,代码来源:blockhtml.php

示例15: postProcess

 /**
  * This functions make checks about AdminThemes configuration edition only.
  *
  * @since 1.4
  */
 public function postProcess()
 {
     // new check compatibility theme feature (1.4) :
     $val = Tools::getValue('PS_THEME');
     Configuration::updateValue('PS_IMG_UPDATE_TIME', time());
     if (!empty($val) && !$this->_isThemeCompatible($val)) {
         // don't submit if errors
         unset($_POST['submitThemes' . $this->table]);
     }
     Tools::clearCache($this->context->smarty);
     parent::postProcess();
 }
开发者ID:rrameshsat,项目名称:Prestashop,代码行数:17,代码来源:AdminThemesController.php


注:本文中的Tools::clearCache方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。