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


PHP CacheUtil::removeLocalDir方法代码示例

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


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

示例1: updateConfig

 /**
  * Update plugin configuration
  */
 public function updateConfig()
 {
     $this->checkCsrfToken();
     $oldVars = $this->plugin->getVars();
     $thumb_dir = $this->request->getPost()->get('thumb_dir');
     if (!empty($thumb_dir) && $thumb_dir !== $oldVars['thumb_dir']) {
         $result = $this->plugin->setupThumbDir($thumb_dir);
         if ($result) {
             $this->plugin->getManager()->cleanupThumbs(true);
             CacheUtil::removeLocalDir($oldVars['thumb_dir']);
             $this->plugin->setVar('thumb_dir', $thumb_dir);
         } else {
             LogUtil::registerError($this->__('Error! Could not change thumbnails storage directory.'));
         }
     }
     $thumb_auto_cleanup = (bool) $this->request->request->get('thumb_auto_cleanup');
     $this->plugin->setVar('thumb_auto_cleanup', $thumb_auto_cleanup);
     $thumb_auto_cleanup_period = $this->request->request->get('thumb_auto_cleanup_period');
     $this->plugin->setVar('thumb_auto_cleanup_period', $thumb_auto_cleanup_period);
     $presets = $this->request->getPost()->get('presets', array());
     $presetsToSave = array();
     foreach ($presets as $preset) {
         // validate jpeg qual and png_compression
         if (!is_numeric($preset['options']['jpeg_quality']) || $preset['options']['jpeg_quality'] < 0 || $preset['options']['jpeg_quality'] > 100) {
             $preset['options']['jpeg_quality'] = 75;
             // default 75%
         }
         if (!is_numeric($preset['options']['png_compression_level']) || $preset['options']['png_compression_level'] < 0 || $preset['options']['png_compression_level'] > 9) {
             $preset['options']['png_compression_level'] = 7;
             // default 7
         }
         $name = $preset['name'];
         if (!empty($name)) {
             $presetsToSave[$name] = new SystemPlugin_Imagine_Preset($name, $preset);
         }
     }
     $this->plugin->setVar('presets', $presetsToSave);
     $this->registerStatus($this->__('Done! Saved plugin configuration.'));
     $this->redirect(ModUtil::url('ZikulaExtensionsModule', 'adminplugin', 'dispatch', array('_plugin' => 'Imagine', '_action' => 'configure')));
 }
开发者ID:Silwereth,项目名称:core,代码行数:43,代码来源:Configuration.php

示例2: updateConfig

    /**
     * Update plugin configuration
     */
    public function updateConfig()
    {
        $this->checkCsrfToken();
        $oldVars = $this->plugin->getVars();

        $thumb_dir = $this->request->getPost()->get('thumb_dir');
        if (!empty($thumb_dir) && $thumb_dir !== $oldVars['thumb_dir']) {
            $result = $this->plugin->setupThumbDir($thumb_dir);
            if ($result) {
                $this->plugin->getManager()->cleanupThumbs(true);
                CacheUtil::removeLocalDir($oldVars['thumb_dir']);
                $this->plugin->setVar('thumb_dir', $thumb_dir);
            } else {
                LogUtil::registerError($this->__('Error! Could not change thumbnails storage directory.'));
            }
        }

        $thumb_auto_cleanup = (bool)$this->request->getPost()->get('thumb_auto_cleanup');
        $this->plugin->setVar('thumb_auto_cleanup', $thumb_auto_cleanup);

        $presets = $this->request->getPost()->get('presets', array());

        $presetsToSave = array();
        foreach ($presets as $preset) {
            $name = $preset['name'];
            if (!empty($name)) {
                $presetsToSave[$name] = new SystemPlugin_Imagine_Preset($name, $preset);
            }
        }

        $this->plugin->setVar('presets', $presetsToSave);

        LogUtil::registerStatus($this->__('Done! Saved plugin configuration.'));

        $this->redirect(ModUtil::url('Extensions', 'adminplugin', 'dispatch', array(
            '_plugin' => 'Imagine',
            '_action' => 'configure'
        )));
    }
开发者ID:projectesIF,项目名称:Sirius,代码行数:42,代码来源:Configuration.php

示例3: deleteGeneratedCategoryModelsOnModuleRemove

 /**
  * On an module remove hook call this listener deletes all cached (generated) doctrine models for the module.
  *
  * Listens for the 'installer.module.uninstalled' event.
  *
  * @param Zikula_Event $event Event.
  *
  * @return void
  */
 public function deleteGeneratedCategoryModelsOnModuleRemove(Zikula_Event $event)
 {
     $moduleName = $event['name'];
     // remove generated category models for this record
     $dir = 'doctrinemodels/GeneratedDoctrineModel/' . $moduleName;
     if (file_exists(CacheUtil::getLocalDir($dir))) {
         CacheUtil::removeLocalDir($dir, true);
     }
     // remove saved data about the record
     $modelsInfo = ModUtil::getVar('ZikulaCategoriesModule', 'EntityCategorySubclasses', array());
     foreach ($modelsInfo as $class => $info) {
         if ($info['module'] == $moduleName) {
             unset($modelsInfo[$class]);
         }
     }
     ModUtil::setVar('ZikulaCategoriesModule', 'EntityCategorySubclasses', $modelsInfo);
 }
开发者ID:Silwereth,项目名称:core,代码行数:26,代码来源:SystemListeners.php

示例4: uninstall

    /**
     * delete the Feeds module
     */
    public function uninstall()
    {
        if (!DBUtil::dropTable('feeds')) {
            return false;
        }

        // remove cache directory incl. content
        CacheUtil::removeLocalDir('feeds');

        // delete any module variables
        $this->delVars();

        // delete entries from category registry
        ModUtil::dbInfoLoad('Categories');
        DBUtil::deleteWhere('categories_registry', "modname = 'Feeds'");
        DBUtil::deleteWhere('categories_mapobj', "modname = 'Feeds'");

        // deletion successful
        return true;
    }
开发者ID:projectesIF,项目名称:Sirius,代码行数:23,代码来源:Installer.php


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