コード例 #1
0
ファイル: fn.common.php プロジェクト: arpad9/bygmarket
/**
 * Clears cache - all or by type
 * @param string $type cache type (misc, registry, static or all)
 * @param string $extra extra data to pass to cache clear function
 */
function fn_clear_cache($type = 'all', $extra = '')
{
    if ($type == 'misc' || $type == 'all') {
        fn_rm(fn_get_cache_path(false), false);
    }
    if ($type == 'assets' || $type == 'all' || $type == 'statics') {
        // FIXME: backward compatibility for "statics"
        Storage::instance('assets')->deleteDir($extra);
        fn_set_storage_data('cache_id', time());
    }
    if ($type == 'registry' || $type == 'all') {
        Registry::cleanup();
    }
    // static cache does not reset when all cache is reset
    if ($type == 'static') {
        fn_rm(Registry::get('config.dir.cache_static'));
    }
    fn_set_hook('clear_cache_post', $type, $extra);
}
コード例 #2
0
/**
 * Clears cache - all or by type
 * @param string $type cache type (misc, registry, static or all)
 * @param string $extra extra data to pass to cache clear function
 */
function fn_clear_cache($type = 'all', $extra = '')
{
    if ($type == 'misc' || $type == 'all') {
        fn_rm(Registry::get('config.dir.cache_misc'), false);
    }
    if ($type == 'statics' || $type == 'all') {
        Storage::instance('statics')->deleteDir($extra);
        fn_set_storage_data('cache_id', time());
    }
    if ($type == 'registry' || $type == 'all') {
        Registry::cleanup();
    }
}
コード例 #3
0
ファイル: Settings.php プロジェクト: heg-arc-ne/cscart
 /**
  * Updates value of setting by section name and setting name
  *
  * @param  string $section_name        Section name
  * @param  string $setting_name        Setting name
  * @param  string $setting_value       Setting value
  * @param  bool   $force_cache_cleanup Force registry cleanup after setting was updated
  * @param  int    $company_id          Company identifier
  * @return bool   Always true
  */
 public function updateValue($setting_name, $setting_value, $section_name = '', $force_cache_cleanup = false, $company_id = null, $execute_functions = true)
 {
     if (!empty($setting_name)) {
         $object_id = $this->getId($setting_name, $section_name);
         $this->updateValueById($object_id, $setting_value, $company_id, $execute_functions);
         if ($force_cache_cleanup) {
             Registry::cleanup();
         }
     }
     return true;
 }
コード例 #4
0
            $missed_languages = array_diff($_all_languages, $_lcs);
            if (!empty($missed_languages)) {
                $descriptions = array('name' => $n, 'value' => $lcs['EN']);
                foreach ($missed_languages as $descriptions['lang_code']) {
                    $row = db_get_field("SELECT name FROM ?:language_values WHERE name = ?s AND lang_code = ?s", $descriptions['name'], $descriptions['lang_code']);
                    if (empty($row)) {
                        db_query("REPLACE INTO ?:language_values ?e", $descriptions);
                    }
                }
            }
        }
    }
    // Install templates
    $areas = array('customer', 'admin', 'mail');
    $installed_skins = fn_get_dir_contents(Registry::get('config.dir.skins'));
    //	foreach ($installed_skins as $skin_name) {
    //		foreach ($areas as $area) {
    //			if (is_dir(Registry::get('config.dir.skins')_REPOSITORY . 'base/' . $area . '/addons/' . $addon)) {
    //				fn_rm(Registry::get('config.dir.skins') . $skin_name . '/' . $area . '/addons/' . $addon);
    //				fn_copy(Registry::get('config.dir.skins')_REPOSITORY . 'base/' . $area . '/addons/' . $addon, Registry::get('config.dir.skins') . $skin_name . '/' . $area . '/addons/' . $addon);
    //			}
    //		}
    //	}
    $data = array('option_name' => 'review_attributes_version', 'option_type' => 'I', 'value' => REVIEW_ATTRIBUTES_VERSION);
    db_query("REPLACE INTO ?:settings ?e", $data);
    fn_rm(DIR_COMPILED, false);
    fn_rm(DIR_CACHE, false);
    Registry::cleanup();
    fn_set_notification('N', __('notice'), __('upgrade_completed'));
    return array(CONTROLLER_STATUS_REDIRECT, "review_attributes.manage");
}