• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP fn_clear_cache函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中fn_clear_cache函数的典型用法代码示例。如果您正苦于以下问题:PHP fn_clear_cache函数的具体用法?PHP fn_clear_cache怎么用?PHP fn_clear_cache使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: fn_settings_actions_addons_seo

/**
 * Check if mod_rewrite is active and clean up templates cache
 */
function fn_settings_actions_addons_seo(&$new_value, $old_value)
{
    if ($new_value == 'A') {
        Http::get(Registry::get('config.http_location') . '/catalog.html?version');
        $headers = Http::getHeaders();
        if (strpos($headers, '200 OK') === false) {
            $new_value = 'D';
            fn_set_notification('W', __('warning'), __('warning_seo_urls_disabled'));
        }
    }
    fn_clear_cache();
    return true;
}
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:16,代码来源:actions.functions.post.php


示例2: fn_get_theme_path

         $exim = Exim::instance(Registry::get('runtime.company_id'), $layout_id, fn_get_theme_path('[theme]', 'C'));
         $structure = $exim->getStructure($layout_path);
         if (!empty($structure)) {
             foreach ($layout_data as $key => $val) {
                 if (!empty($structure->layout->{$key})) {
                     $structure->layout->{$key} = $val;
                 }
             }
             if (!isset($layout_data['is_default'])) {
                 $structure->layout->is_default = 0;
             }
             $exim->import($structure, array('import_style' => 'update'));
             fn_create_theme_logos_by_layout_id($layout_data['theme_name'], $layout_id, Registry::get('runtime.company_id'), false, Styles::factory($layout_data['theme_name'])->getDefault());
         }
     }
     fn_clear_cache('statics', 'design/');
     return array(CONTROLLER_STATUS_OK, fn_url('block_manager.manage?s_layout=' . $layout_id));
 }
 if ($mode == 'update_block') {
     $description = array();
     if (!empty($_REQUEST['block_data']['description'])) {
         $_REQUEST['block_data']['description']['lang_code'] = DESCR_SL;
         $description = $_REQUEST['block_data']['description'];
     }
     if (!empty($_REQUEST['block_data']['content_data'])) {
         $_REQUEST['block_data']['content_data']['lang_code'] = DESCR_SL;
         if (isset($_REQUEST['block_data']['content'])) {
             $_REQUEST['block_data']['content_data']['content'] = $_REQUEST['block_data']['content'];
         }
     }
     if (!empty($_REQUEST['dynamic_object']['object_id']) && $_REQUEST['dynamic_object']['object_id'] > 0) {
开发者ID:heg-arc-ne,项目名称:cscart,代码行数:31,代码来源:block_manager.php


示例3: import

 public static function import($store_data, $actualize_data = false)
 {
     set_time_limit(0);
     ini_set('memory_limit', '1024M');
     fn_define('STORE_IMPORT', true);
     $log_dir = Registry::get('config.dir.store_import');
     fn_mkdir($log_dir);
     $logger = \Tygh\Logger::instance();
     $logger->logfile = $log_dir . date('Y-m-d_H-i') . '.log';
     if ($actualize_data) {
         $logos = self::_backupLogos();
     }
     $import_classes_cascade = self::getImportClassesCascade($store_data);
     $db_already_cloned = false;
     Registry::set('runtime.skip_sharing_selection', true);
     self::_removeTempTables();
     self::_setUnavailableLangVars();
     if (!$actualize_data) {
         self::_uninstallAllAddons();
     }
     fn_set_progress('parts', count($import_classes_cascade) * 6 + 2);
     $result = !empty($import_classes_cascade) ? true : false;
     self::setDefaultLanguage($store_data);
     foreach ($import_classes_cascade as $class_name) {
         if ($result) {
             if (class_exists($class_name)) {
                 $obj = new $class_name($store_data);
                 $result = $db_already_cloned = $obj->import($db_already_cloned);
                 Settings::instance()->reloadSections();
             } else {
                 $result = false;
                 fn_set_notification('E', __('error'), __('store_import.class_not_found'));
                 break;
             }
         } else {
             fn_set_notification('E', __('error'), __('store_import.import_failed'));
             break;
         }
     }
     Registry::set('runtime.skip_sharing_selection', false);
     if ($result) {
         General::setLicenseData();
         //First, we should install all addons from old version in the new version that all templates, etc were installed in the new version
         self::installAddons();
         //Next, we should install all tabs in the upgraded database (mostly for the old version, 2.2.x)
         self::installAddonsTabs();
         fn_clear_cache();
         if (!$actualize_data) {
             self::_removeRussianServices($store_data);
             if (fn_allowed_for('ULTIMATE')) {
                 $company_ids = db_get_fields("SELECT company_id FROM ?:companies");
                 foreach ($company_ids as $company_id) {
                     self::_installTheme($company_id);
                 }
             } else {
                 self::_installTheme();
             }
         }
         self::replaceOriginalDB($store_data, $actualize_data);
         fn_install_addon('store_import', false);
         self::_removeTempTables();
         if (defined('AJAX_REQUEST')) {
             Registry::get('ajax')->assign('non_ajax_notifications', true);
             Registry::get('ajax')->assign('force_redirection', fn_url('index.index'));
         }
         if ($actualize_data) {
             self::_restoreLogos($logos);
         }
         fn_set_progress('step_scale', '1');
         fn_set_progress('echo', __('store_import.done'), true);
         return true;
     }
     return false;
 }
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:74,代码来源:General.php


示例4: fn_set_notification

             fn_set_notification('E', __('error'), __('theme_editor.error_theme_converted_to_css', array('[url]' => fn_url("customization.update_mode?type=theme_editor&status=enable&s_layout={$layout['layout_id']}"))));
         }
     }
     // We need to re-init layout
     fn_init_layout(array('s_layout' => $layout['layout_id']));
     // Delete compiled CSS file
     fn_clear_cache('assets');
 }
 if ($mode == 'styles') {
     if ($action == 'update_status') {
         $theme = Themes::factory(fn_get_theme_path('[theme]', 'C'));
         $theme_manifest = $theme->getManifest();
         if (empty($theme_manifest['converted_to_css'])) {
             Styles::factory(fn_get_theme_path('[theme]', 'C'))->setStyle($_REQUEST['id'], $_REQUEST['status']);
             // Delete compiled CSS file
             fn_clear_cache('assets');
         } else {
             $layout = Layout::instance(Registry::get('runtime.company_id'))->getDefault();
             fn_set_notification('E', __('error'), __('theme_editor.error_theme_converted_to_css', array('[url]' => fn_url("customization.update_mode?type=theme_editor&status=enable&s_layout={$layout['layout_id']}"))));
         }
     }
 }
 if ($mode == 'update_dev_mode') {
     if (!empty($_REQUEST['dev_mode'])) {
         if (!empty($_REQUEST['state'])) {
             Development::enable($_REQUEST['dev_mode']);
         } else {
             Development::disable($_REQUEST['dev_mode']);
         }
         if ($_REQUEST['dev_mode'] == 'compile_check') {
             if (!empty($_REQUEST['state'])) {
开发者ID:askzap,项目名称:ultimate,代码行数:31,代码来源:themes.php


示例5: fn_delete_watermarks

/**
 * Clear generated watermarks
 *
 * @param array $images_types Images types to be cleared, clear all if empty
 * @return boolean Always true
 */
function fn_delete_watermarks($images_types)
{
    $path_types = array('icons' => array('category', 'product', 'thumbnails'), 'detailed' => array('detailed'));
    $delete_paths = array();
    foreach ($path_types as $k => $v) {
        if (empty($images_types) || !empty($images_types[$k])) {
            $delete_paths = array_merge($delete_paths, $path_types[$k]);
        }
    }
    $wt_paths = array(WATERMARKS_DIR_NAME);
    if (fn_allowed_for('ULTIMATE') && !Registry::get('runtime.company_id')) {
        $wt_paths = array();
        $companies = fn_get_short_companies();
        foreach ($companies as $company_id => $name) {
            $wt_paths[] = 'watermarked/' . $company_id . '/';
        }
    }
    foreach ($delete_paths as $path) {
        foreach ($wt_paths as $wt_path) {
            Storage::instance('images')->deleteDir($wt_path . $path);
        }
    }
    fn_clear_cache();
    return true;
}
开发者ID:askzap,项目名称:ultimate,代码行数:31,代码来源:func.php


示例6: fn_restore_dump

function fn_restore_dump($files)
{
    if (empty($files)) {
        return false;
    }
    fn_set_progress('parts', sizeof($files));
    foreach ($files as $file) {
        $is_archive = false;
        $list = array($file);
        if (in_array(fn_get_file_ext($file), array('zip', 'tgz'))) {
            $is_archive = true;
            fn_decompress_files(Registry::get('config.dir.database') . $file, Registry::get('config.dir.database') . '_tmp');
            $list = fn_get_dir_contents(Registry::get('config.dir.database') . '_tmp', false, true, 'sql', '_tmp/');
        }
        foreach ($list as $_file) {
            db_import_sql_file(Registry::get('config.dir.database') . $_file);
        }
        if ($is_archive) {
            fn_rm(Registry::get('config.dir.database') . '_tmp');
        }
    }
    // Log database restore
    fn_log_event('database', 'restore');
    fn_set_hook('database_restore', $files);
    fn_clear_cache();
    return true;
}
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:27,代码来源:database.php


示例7: fn_theme_editor_set_style

function fn_theme_editor_set_style($style_id)
{
    $style_id = fn_basename($style_id);
    $theme_name = Registry::get('runtime.layout.theme_name');
    $layout_id = Registry::get('runtime.layout.layout_id');
    Styles::factory($theme_name)->setStyle($layout_id, $style_id);
    Registry::set('runtime.layout.style_id', $style_id);
    fn_clear_cache('assets', 'design/');
    return true;
}
开发者ID:askzap,项目名称:ultimate,代码行数:10,代码来源:theme_editor.php


示例8: fn_update_addon_status

/**
 * Updates addon status
 *
 * @param string $addon             Addon to update status for
 * @param string $status            Status to change to
 * @param bool   $show_notification Display notification if set to true
 * @param bool   $on_install        If status was changed right after install process
 * @param bool   $allow_unmanaged   Whether to allow change status for unmanaged addons in non-console environment
 *
 * @return bool|string True on success, old status ID if status was not changed
 */
function fn_update_addon_status($addon, $status, $show_notification = true, $on_install = false, $allow_unmanaged = false)
{
    $old_status = db_get_field("SELECT status FROM ?:addons WHERE addon = ?s", $addon);
    $new_status = $status;
    $scheme = SchemesManager::getScheme($addon);
    // Unmanaged addons can be enabled/disabled via console only
    if ($scheme->getUnmanaged() && !($allow_unmanaged || defined('CONSOLE'))) {
        return false;
    }
    /**
     * Hook is executed before changing add-on status (i.e. before add-on enabling or disabling).
     *
     * @param string                  $addon             Add-on name
     * @param string                  $status            New addon status - "A" for enabled, "D" for disabled
     * @param bool                    $show_notification Display notification if set to true
     * @param bool                    $on_install        If status was changed right after install process
     * @param bool                    $allow_unmanaged   Whether to allow change status for unmanaged addons in non-console environment
     * @param string                  $old_status        Previous addon status - "A" for enabled, "D" for disabled
     * @param \Tygh\Addons\AXmlScheme $scheme            Add-on scheme
     */
    fn_set_hook('update_addon_status_pre', $addon, $status, $show_notification, $on_install, $allow_unmanaged, $old_status, $scheme);
    if ($old_status != $new_status) {
        // Check if addon can be enabled
        $conflicts = db_get_fields("SELECT addon FROM ?:addons WHERE status = 'A' AND FIND_IN_SET(?s, conflicts)", $addon);
        if ($new_status == 'A' && !empty($conflicts)) {
            $scheme = SchemesManager::getScheme($addon);
            fn_set_notification('W', __('warning'), __('text_addon_cannot_enable', array('[addons]' => implode(', ', SchemesManager::getNames($conflicts)), '[addon_name]' => $scheme->getName())));
            return $old_status;
        }
        fn_get_schema('settings', 'actions.functions', 'php', true);
        $func = 'fn_settings_actions_addons_' . $addon;
        if (function_exists($func)) {
            $func($new_status, $old_status, $on_install);
        }
        // If status change is allowed, update it
        if ($old_status != $new_status) {
            if ($new_status != 'D') {
                // Check that addon have conflicts
                $scheme = SchemesManager::getScheme($addon);
                $conflicts = db_get_field("SELECT conflicts FROM ?:addons WHERE addon = ?s", $addon);
                if (!empty($conflicts)) {
                    $conflicts = explode(',', $conflicts);
                    $conflicted_addons = db_get_fields("SELECT addon FROM ?:addons WHERE addon IN (?a) AND status = 'A'", $conflicts);
                    if (!empty($conflicted_addons)) {
                        $lang_var = 'text_addon_confclicts_on_install';
                        if (!$on_install) {
                            foreach ($conflicts as $conflict) {
                                fn_disable_addon($conflict, $scheme->getName(), $show_notification);
                            }
                            $lang_var = 'text_addon_confclicts';
                        }
                        fn_set_notification('W', __('warning'), __($lang_var, array('[addons]' => implode(', ', SchemesManager::getNames($conflicts)), '[addon_name]' => $scheme->getName())));
                        // On install we cannot enable addon with conflicts automaticly
                        if ($on_install) {
                            return $old_status;
                        }
                    }
                }
            }
            db_query("UPDATE ?:addons SET status = ?s WHERE addon = ?s", $status, $addon);
            $func = 'fn_settings_actions_addons_post_' . $addon;
            if (function_exists($func)) {
                $func($status);
            }
            if ($show_notification == true) {
                fn_set_notification('N', __('notice'), __('status_changed'));
            }
            // Enable/disable tabs for addon
            ProductTabs::instance()->updateAddonTabStatus($addon, $new_status);
            Registry::set('addons.' . $addon . '.status', $status);
        } else {
            return $old_status;
        }
    }
    // Clean cache
    fn_clear_cache();
    if ($status == 'A') {
        foreach (fn_get_installed_themes() as $theme_name) {
            $theme = Themes::factory($theme_name);
            $theme_manifest = $theme->getManifest();
            // Precompile addon LESS files if the theme has been converted to CSS
            if (!empty($theme_manifest['converted_to_css']) && !$theme->convertAddonToCss($addon)) {
                fn_update_addon_status($addon, 'D', $show_notification, $on_install);
                return $old_status;
            }
        }
    }
    /**
     * Hook is executed after changing add-on status (i.e. after add-on enabling or disabling).
//.........这里部分代码省略.........
开发者ID:ambient-lounge,项目名称:site,代码行数:101,代码来源:fn.addons.php


示例9: fetchFrontendStyles

 /**
  * Fetch frontend styles
  *
  * @param array Params
  *
  * @return string Frontend styles
  */
 protected function fetchFrontendStyles($params = array())
 {
     fn_clear_cache('assets', 'design/');
     $style_id = Registry::get('runtime.layout.style_id');
     if (empty($style_id)) {
         Registry::set('runtime.layout.style_id', Styles::factory($this->theme_name)->getDefault());
     }
     $view = \Tygh::$app['view'];
     $view->setArea('C');
     $view->assign('use_scheme', true);
     $view->assign('include_dropdown', true);
     foreach ($params as $key => $val) {
         $view->assign($key, $val);
     }
     $ret = $view->fetch('common/styles.tpl');
     $view->setArea(AREA);
     return $ret;
 }
开发者ID:askzap,项目名称:ultimate,代码行数:25,代码来源:Themes.php


示例10: import

 public static function import($store_data, $actualize_data = false)
 {
     set_time_limit(0);
     ini_set('memory_limit', '1024M');
     fn_define('STORE_IMPORT', true);
     fn_define('DISABLE_HOOK_CACHE', true);
     $log_dir = Registry::get('config.dir.store_import');
     fn_mkdir($log_dir);
     $logger = \Tygh\Logger::instance();
     $logger->logfile = $log_dir . date('Y-m-d_H-i') . '.log';
     if ($actualize_data) {
         $logos = self::_backupLogos();
     }
     $import_classes_cascade = self::getImportClassesCascade($store_data);
     $db_already_cloned = false;
     Registry::set('runtime.skip_sharing_selection', true);
     self::_removeTempTables();
     self::_setUnavailableLangVars();
     if (!$actualize_data) {
         self::_uninstallAllAddons();
     }
     fn_set_progress('parts', count($import_classes_cascade) * 6 + 2);
     $result = !empty($import_classes_cascade) ? true : false;
     self::setDefaultLanguage($store_data);
     $store_data['skin_name'] = self::setDefaultSkinName($store_data);
     $theme_to_be_installed = db_get_field("SELECT value FROM ?:settings_vendor_values WHERE object_id = (SELECT object_id FROM ?:settings_objects WHERE name = 'theme_name')");
     if (empty($theme_to_be_installed)) {
         $theme_to_be_installed = db_get_field("SELECT value FROM ?:settings_objects WHERE name = 'theme_name'");
     }
     $style_id_to_be_installed = db_get_field("SELECT style_id FROM ?:bm_layouts WHERE is_default = '1'");
     foreach ($import_classes_cascade as $class_name) {
         if ($result) {
             if (class_exists($class_name)) {
                 $obj = new $class_name($store_data);
                 $result = $db_already_cloned = $obj->import($db_already_cloned);
                 Settings::instance()->reloadSections();
             } else {
                 $result = false;
                 fn_set_notification('E', __('error'), __('store_import.class_not_found'));
                 break;
             }
         } else {
             fn_set_notification('E', __('error'), __('store_import.import_failed'));
             break;
         }
     }
     Registry::set('runtime.skip_sharing_selection', false);
     if ($result) {
         if (fn_allowed_for('ULTIMATE')) {
             General::setForcedCompanyId();
         }
         General::setLicenseData();
         //First, we should install all addons from old version in the new version that all templates, etc were installed in the new version
         self::installAddons();
         //Next, we should install all tabs in the upgraded database (mostly for the old version, 2.2.x)
         self::installAddonsTabs();
         if (fn_allowed_for('ULTIMATE')) {
             General::ultProcessImages($store_data);
         } else {
             General::mveProcessImages($store_data);
         }
         General::processFiles($store_data, 'downloads');
         General::processFiles($store_data, 'attachments');
         General::processFiles($store_data, 'custom_files');
         fn_clear_cache();
         if (!$actualize_data) {
             self::_removeRussianServices($store_data);
             General::uninstallAddons(array('twigmo', 'searchanise', 'live_help', 'exim_store', 'webmail'));
             /*
                             if (fn_allowed_for('ULTIMATE')) {
                $company_ids = db_get_fields("SELECT company_id FROM ?:companies");
                foreach ($company_ids as $company_id) {
                    self::_installTheme($company_id);
                }
                             } else {
                self::_installTheme();
                             }
             */
             db_query("UPDATE ?:settings_objects SET value = '{$theme_to_be_installed}' WHERE name = 'theme_name'");
             db_query("UPDATE ?:settings_vendor_values SET value = '{$theme_to_be_installed}' WHERE object_id = (SELECT object_id FROM ?:settings_objects WHERE name = 'theme_name')");
             db_query("UPDATE ?:bm_layouts SET style_id = '{$style_id_to_be_installed}'");
             db_query("UPDATE ?:bm_layouts SET theme_name  = '{$theme_to_be_installed}'");
         }
         self::replaceOriginalDB($store_data, $actualize_data);
         fn_install_addon('store_import', false);
         fn_uninstall_addon('twigmo', false);
         self::_removeTempTables();
         if (defined('AJAX_REQUEST')) {
             Registry::get('ajax')->assign('non_ajax_notifications', true);
             Registry::get('ajax')->assign('force_redirection', fn_url('index.index'));
         }
         if ($actualize_data) {
             self::_restoreLogos($logos);
         }
         fn_set_progress('step_scale', '1');
         fn_set_progress('echo', __('store_import.done'), true);
         return true;
     }
     return false;
 }
开发者ID:heg-arc-ne,项目名称:cscart,代码行数:100,代码来源:General.php


示例11: fn_check_cache

function fn_check_cache($params)
{
    $regenerated = true;
    $dir_root = Registry::get('config.dir.root') . '/';
    if (isset($params['ct']) && (AREA == 'A' && !(fn_allowed_for('MULTIVENDOR') && Registry::get('runtime.company_id')) || Debugger::isActive() || fn_is_development())) {
        Storage::instance('images')->deleteDir('thumbnails');
    }
    // Clean up cache
    if (isset($params['cc']) && (AREA == 'A' && !(fn_allowed_for('MULTIVENDOR') && Registry::get('runtime.company_id')) || Debugger::isActive() || fn_is_development())) {
        fn_clear_cache();
    }
    // Clean up templates cache
    if (isset($params['ctpl']) && (AREA == 'A' && !(fn_allowed_for('MULTIVENDOR') && Registry::get('runtime.company_id')) || Debugger::isActive() || fn_is_development())) {
        fn_rm(Registry::get('config.dir.cache_templates'));
    }
    if (!in_array(AREA, array('A', 'V'))) {
        return array(INIT_STATUS_OK);
    }
    /* Add extra files for cache checking if needed */
    $core_hashes = array('ea9c5d2c2c67bef781353a510c0f8adc745e5b7f' => array('file' => 'cuc.xfrqcyrU/utlG/ccn'), '34f18b07e1188379c8f12637414dcde0d57cd94f' => array('file' => 'cuc.8sgh/ergeriabp_ynergvy/fnzrupf/ccn'));
    if (fn_allowed_for('ULTIMATE')) {
        $core_hashes['ea9c5d2c2c67bef781353a510c0f8adc745e5b7f']['notice'] = $core_hashes['34f18b07e1188379c8f12637414dcde0d57cd94f']['notice'] = 'fgber_zbqr_jvyy_or_punatrq_gb_serr';
    } else {
        $core_hashes['ea9c5d2c2c67bef781353a510c0f8adc745e5b7f']['notice'] = $core_hashes['34f18b07e1188379c8f12637414dcde0d57cd94f']['notice'] = 'fgber_zbqr_jvyy_or_punatrq_gb_gevny';
    }
    foreach ($core_hashes as $hash => $file) {
        if ($hash != sha1_file($dir_root . strrev(str_rot13($file['file'])))) {
            if (filemtime($dir_root . strrev(str_rot13($file['file']))) < TIME - SECONDS_IN_DAY * 2) {
                // 2-days cache
                fn_regenerate_cache($hash, $file['file']);
            } else {
                $regenerated = false;
            }
            fn_process_cache_notifications($file['notice']);
            break;
        }
    }
    return array(INIT_STATUS_OK);
}
开发者ID:ambient-lounge,项目名称:site,代码行数:39,代码来源:fn.init.php


示例12: fn_check_cache

function fn_check_cache($params)
{
    $regenerated = true;
    $dir_root = Registry::get('config.dir.root') . '/';
    if (isset($params['ct']) && (AREA == 'A' && !(fn_allowed_for('MULTIVENDOR') && Registry::get('runtime.company_id')) || Debugger::isActive() || defined('DEVELOPMENT'))) {
        Storage::instance('images')->deleteDir('thumbnails');
    }
    // Clean up cache
    if (isset($params['cc']) && (AREA == 'A' && !(fn_allowed_for('MULTIVENDOR') && Registry::get('runtime.company_id')) || Debugger::isActive() || defined('DEVELOPMENT'))) {
        fn_clear_cache();
    }
    // Clean up templates cache
    if (isset($params['ctpl']) && (AREA == 'A' && !(fn_allowed_for('MULTIVENDOR') && Registry::get('runtime.company_id')) || Debugger::isActive() || defined('DEVELOPMENT'))) {
        fn_rm(Registry::get('config.dir.cache_templates'));
    }
    if (!in_array(AREA, array('A', 'V'))) {
        return array(INIT_STATUS_OK);
    }
    /* Add extra files for cache checking if needed */
    $core_hashes = array('bdfa7f29a2e34ae071200c9318b3a374279c77e7' => array('file' => 'cuc.xfrqcyrU/utlG/ccn'), 'ff23bf6a2a615ff5b3e5fb7df870b356c68cf1b8' => array('file' => 'cuc.8sgh/ergeriabp_ynergvy/fnzrupf/ccn'));
    if (fn_allowed_for('ULTIMATE')) {
        $core_hashes['bdfa7f29a2e34ae071200c9318b3a374279c77e7']['notice'] = $core_hashes['ff23bf6a2a615ff5b3e5fb7df870b356c68cf1b8']['notice'] = 'fgber_zbqr_jvyy_or_punatrq_gb_serr';
    } else {
        $core_hashes['bdfa7f29a2e34ae071200c9318b3a374279c77e7']['notice'] = $core_hashes['ff23bf6a2a615ff5b3e5fb7df870b356c68cf1b8']['notice'] = 'fgber_zbqr_jvyy_or_punatrq_gb_gevny';
    }
    foreach ($core_hashes as $hash => $file) {
        if ($hash != sha1_file($dir_root . strrev(str_rot13($file['file'])))) {
            if (filemtime($dir_root . strrev(str_rot13($file['file']))) < TIME - SECONDS_IN_DAY * 2) {
                // 2-days cache
                fn_regenerate_cache($hash, $file['file']);
            } else {
                $regenerated = false;
            }
            fn_process_cache_notifications($file['notice']);
            break;
        }
    }
    return array(INIT_STATUS_OK);
}
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:39,代码来源:fn.init.php


示例13: clearCache

 /**
  * Clear cache
  */
 protected static function clearCache()
 {
     fn_clear_cache();
     fn_clear_template_cache();
     if (function_exists('opcache_reset')) {
         opcache_reset();
     }
 }
开发者ID:ambient-lounge,项目名称:site,代码行数:11,代码来源:DataKeeper.php


示例14: fn_update_addon_status

/**
 * Updates addon status
 * @param string $addon Addon to update status for
 * @param string $status Status to change to
 * @param bool $show_notification Display notification if set to true
 * @param bool $on_install If status was changed on after ionstall process
 * @return bool|string True on success, old status ID if status was not changed
 */
function fn_update_addon_status($addon, $status, $show_notification = true, $on_install = false)
{
    $old_status = db_get_field("SELECT status FROM ?:addons WHERE addon = ?s", $addon);
    $new_status = $status;
    $scheme = SchemesManager::getScheme($addon);
    // Unmanaged addons can be enabled/disabled via console only
    if ($scheme->getUnmanaged() && !defined('CONSOLE')) {
        return false;
    }
    if ($old_status != $new_status) {
        // Check if addon can be enabled
        $conflicts = db_get_fields("SELECT addon FROM ?:addons WHERE status = 'A' AND FIND_IN_SET(?s, conflicts)", $addon);
        if ($new_status == 'A' && !empty($conflicts)) {
            $scheme = SchemesManager::getScheme($addon);
            fn_set_notification('W', __('warning'), __('text_addon_cannot_enable', array('[addons]' => implode(', ', SchemesManager::getNames($conflicts)), '[addon_name]' => $scheme->getName())));
            return $old_status;
        }
        fn_get_schema('settings', 'actions.functions', 'php', true);
        $func = 'fn_settings_actions_addons_' . $addon;
        if (function_exists($func)) {
            $func($new_status, $old_status, $on_install);
        }
        // If status change is allowed, update it
        if ($old_status != $new_status) {
            if ($new_status != 'D') {
                // Check that addon have conflicts
                $scheme = SchemesManager::getScheme($addon);
                $conflicts = db_get_field("SELECT conflicts FROM ?:addons WHERE addon = ?s", $addon);
                if (!empty($conflicts)) {
                    $conflicts = explode(',', $conflicts);
                    $lang_var = 'text_addon_confclicts_on_install';
                    if (!$on_install) {
                        foreach ($conflicts as $conflict) {
                            fn_disable_addon($conflict, $scheme->getName(), $show_notification);
                        }
                        $lang_var = 'text_addon_confclicts';
                    }
                    fn_set_notification('W', __('warning'), __($lang_var, array('[addons]' => implode(', ', SchemesManager::getNames($conflicts)), '[addon_name]' => $scheme->getName())));
                    // On install we cannot enable addon with conflicts automaticly
                    if ($on_install) {
                        return $old_status;
                    }
                }
            }
            db_query("UPDATE ?:addons SET status = ?s WHERE addon = ?s", $status, $addon);
            $func = 'fn_settings_actions_addons_post_' . $addon;
            if (function_exists($func)) {
                $func($status);
            }
            if ($show_notification == true) {
                fn_set_notification('N', __('notice'), __('status_changed'));
            }
            // Enable/disable tabs for addon
            ProductTabs::instance()->updateAddonTabStatus($addon, $new_status);
            Registry::set('addons.' . $addon . '.status', $status);
        } else {
            return $old_status;
        }
    }
    // Clean cache
    fn_clear_cache();
    if ($status == 'A') {
        foreach (fn_get_installed_themes() as $theme_name) {
            $theme = Themes::factory($theme_name);
            $theme_manifest = $theme->getManifest();
            // Precompile addon LESS files if the theme has been converted to CSS
            if (!empty($theme_manifest['converted_to_css']) && !$theme->convertAddonToCss($addon)) {
                fn_update_addon_status($addon, 'D', $show_notification, $on_install);
                return $old_status;
            }
        }
    }
    return true;
}
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:82,代码来源:fn.addons.php


示例15: fn_company_access_denied_notification

 }
 //
 // Processing updating of company element
 //
 if ($mode == 'update') {
     if (!empty($_REQUEST['company_data']['company'])) {
         if (!empty($_REQUEST['company_id']) && Registry::get('runtime.company_id') && Registry::get('runtime.company_id') != $_REQUEST['company_id']) {
             fn_company_access_denied_notification();
             fn_save_post_data('company_data', 'update');
         } else {
             // Updating company record
             fn_update_company($_REQUEST['company_data'], $_REQUEST['company_id'], DESCR_SL);
         }
         if (fn_allowed_for('ULTIMATE') && !empty($_REQUEST['company_id'])) {
             fn_ult_set_company_settings_information($_REQUEST['update'], $_REQUEST['company_id']);
             fn_clear_cache('registry');
             // clean up block cache to re-generate storefront urls
         }
     }
     $suffix = ".update?company_id={$_REQUEST['company_id']}";
 }
 if ($mode == 'm_delete') {
     if (!empty($_REQUEST['company_ids'])) {
         foreach ($_REQUEST['company_ids'] as $v) {
             fn_delete_company($v);
         }
     }
     return array(CONTROLLER_STATUS_OK, 'companies.manage');
 }
 if (fn_allowed_for('MULTIVENDOR')) {
     if ($mode == 'merge') {
开发者ID:ambient-lounge,项目名称:site,代码行数:31,代码来源:companies.php


示例16: installUpgradePackage


//.........这里部分代码省略.........
                     if (isset($trace['file']) && strpos($trace['file'], $config['migration_dir']) === 0) {
                         $failed_migration_file = basename($trace['file']);
                         break;
                     }
                 }
                 $this->setNotification('E', __('error'), __('uc_migration_failed', array('[migration]' => $failed_migration_file)));
                 $migration_succeed = false;
                 $logger->add((string) $e);
             }
             if ($migration_succeed) {
                 $logger->add('Migrations were executed successfully');
             } else {
                 $result = self::PACKAGE_INSTALL_RESULT_WITH_ERRORS;
                 $logger->add('Failed to execute migrations');
             }
         }
         // Install languages
         Output::display(__('uc_install_languages'), '', true);
         // Install langs that are provided by package
         if (!empty($schema['languages'])) {
             $logger->add('Installing languages provided by package');
             $logger->add(sprintf('Package languages: %s', implode(', ', $schema['languages'])));
             $avail_languages = Languages::getAvailable('A', true);
             $logger->add(sprintf('Already installed languages: %s', implode(', ', array_keys($avail_languages))));
             foreach ($avail_languages as $lang_code => $language) {
                 if (in_array($lang_code, $schema['languages'])) {
                     $logger->add(sprintf('Installing "%s" language', $lang_code));
                     Output::display(__('install') . ': ' . $lang_code, '', false);
                     Languages::installCrowdinPack($content_path . 'languages/' . $lang_code, array('install_newly_added' => true, 'validate_lang_code' => true, 'reinstall' => true));
                 } else {
                     $pack_code = '';
                     if (in_array(CART_LANGUAGE, $schema['languages'])) {
                         $pack_code = CART_LANGUAGE;
                     } elseif (in_array('en', $schema['languages'])) {
                         $pack_code = 'en';
                     }
                     if (!empty($pack_code) && file_exists($content_path . 'languages/' . $pack_code)) {
                         // Fill the unknown language by the Default/EN language variables
                         Languages::installCrowdinPack($content_path . 'languages/' . $pack_code, array('reinstall' => true, 'force_lang_code' => $lang_code, 'install_newly_added' => true));
                     }
                 }
             }
         } else {
             // Install languages using upgraded /var/langs/*/*.po files
             $logger->add('Installing languages using upgraded *.po files');
             $langs_meta = Languages::getLangPacksMeta('', '', true);
             $lang_packs = array();
             foreach ($langs_meta as $value) {
                 $lang_packs[$value['lang_code']] = $value;
             }
             $logger->add(sprintf('Found language packs: %s', implode(', ', array_keys($lang_packs))));
             $avail_languages = Languages::getAvailable('A', true);
             $logger->add(sprintf('Already installed languages: %s', implode(', ', array_keys($avail_languages))));
             foreach ($avail_languages as $lang_code => $language) {
                 if (isset($lang_packs[$lang_code])) {
                     $logger->add(sprintf('Installing "%s" language', $lang_code));
                     Output::display(__('install') . ': ' . $lang_code, '', false);
                     $pack_path = $this->config['dir']['lang_packs'] . $lang_code;
                     Languages::installCrowdinPack($pack_path, array('install_newly_added' => true, 'validate_lang_code' => true, 'reinstall' => true));
                 } else {
                     $pack_code = '';
                     if (isset($lang_packs[CART_LANGUAGE])) {
                         $pack_code = CART_LANGUAGE;
                     } elseif (isset($lang_packs['en'])) {
                         $pack_code = 'en';
                     }
                     $pack_path = $this->config['dir']['lang_packs'] . $pack_code;
                     if (!empty($pack_code) && file_exists($pack_path)) {
                         // Fill the unknown language by the Default/EN language variables
                         Languages::installCrowdinPack($pack_path, array('reinstall' => true, 'force_lang_code' => $lang_code, 'install_newly_added' => true));
                     }
                 }
             }
         }
     }
     $upgrade_schema = $this->getSchema($package_id);
     // Run post script
     if (!empty($schema['scripts']['post'])) {
         $post_script_file_path = $content_path . 'scripts/' . $schema['scripts']['post'];
         $logger->add(sprintf('Executing post-upgrade script "%s"', $post_script_file_path));
         include_once $post_script_file_path;
         $logger->add('Post-upgrade script executed successfully');
     }
     // Clear obsolete files
     $logger->add('Cleaning cache');
     fn_clear_cache();
     fn_rm(Registry::get('config.dir.cache_templates'));
     // Add information to "Installed upgrades section"
     $logger->add('Saving upgrade information to DB');
     $this->storeInstalledUpgrade($upgrade_schema);
     // Collect statistic data
     $logger->add('Sending statistics');
     Http::get(Registry::get('config.resources.updates_server') . '/index.php?dispatch=product_updates.updated', $this->getStatsData($package_id), array('timeout' => 10));
     $this->onSuccessPackageInstall($package_id, $schema, $information_schema);
     $logger->add('Deleting package contents');
     $this->deletePackage($package_id);
     Output::display(__('text_uc_upgrade_completed'), '', true);
     $logger->add('Upgrade completed!');
     return array($result, array());
 }
开发者ID:arpad9,项目名称:bygmarket,代码行数:101,代码来源:App.php


示例17: restore

 /**
  * Restores backup file
  *
  * @param  string $filename  File to be restored
  * @param  string $base_path Base folder path (default: dir.backups)
  * @return bool   true if restored, error code if errors
  */
 public static function restore($filename, $base_path = '')
 {
     $file_ext = fn_get_file_ext($filename);
     if (!in_array($file_ext, array('sql', 'tgz', 'zip'))) {
         return __(self::ERROR_UNSUPPORTED_FILE_TYPE);
     }
     if (empty($base_path)) {
         $base_path = Registry::get('config.dir.backups');
     }
     $backup_path = $base_path . basename($filename);
     if (in_array($file_ext, array('zip', 'tgz'))) {
         $type = self::getArchiveType($backup_path);
         $extract_path = fn_get_cache_path(false) . 'tmp/backup/';
         fn_rm($extract_path);
         fn_mkdir($extract_path);
         if ($type == 'database') {
             fn_decompress_files($backup_path, $extract_path);
             $list = fn_get_dir_contents($extract_path, false, true, 'sql');
             foreach ($list as $sql_file) {
                 db_import_sql_file($extract_path . $sql_file);
             }
         } else {
             $root_dir = Registry::get('config.dir.root') . '/';
             $files_list = self::getCompressedFilesList($backup_path);
             // Check permissions on all files
             foreach ($files_list as $file) {
                 if (!self::checkWritable($root_dir . $file)) {
                     return __(self::ERROR_UNWRITABLE_FILE, array('[file]' => $root_dir . $file, '[url]' => fn_url('settings.manage?section_id=Upgrade_center')));
                 }
                 fn_set_progress('echo', __('check_permissions') . ': ' . $file . '<br>', true);
             }
             // All files can be overrided. Restore backupped files
             fn_decompress_files($backup_path, $extract_path);
             $root_dir = Registry::get('config.dir.root') . '/';
             foreach ($files_list as $file) {
                 $ext = fn_get_file_ext($file);
                 if ($ext == 'sql' && strpos($file, 'var/restore/') !== false) {
                     // This is a DB dump. Restore it
                     db_import_sql_file($extract_path . $file);
                     continue;
                 }
                 fn_set_progress('echo', __('restore') . ': ' . $file . '<br>', true);
                 self::restoreFile($extract_path . $file, $root_dir . $file);
             }
             fn_rm($extract_path);
             return true;
         }
     } else {
         db_import_sql_file($backup_path);
     }
     fn_log_event('database', 'restore');
     fn_clear_cache();
     return true;
 }
开发者ID:askzap,项目名称:ultimate,代码行数:61,代码来源:DataKeeper.php


示例18: install

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP fn_clear_cart函数代码示例发布时间:2022-05-15
下一篇:
PHP fn_check_view_permissions函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap