library/Garp/Cache/Manager.php
public static function purgeMemcachedCache($modelNames = array(), $messageBag = array()) {
        if (!Zend_Registry::isRegistered('CacheFrontend')) {
            $messageBag[] = 'Memcached: No caching enabled';
            return $messageBag;
        }

        if (!Zend_Registry::get('CacheFrontend')->getOption('caching')) {
            $messageBag[] = 'Memcached: No caching enabled';
            return $messageBag;;
        }

        if ($modelNames instanceof Garp_Model_Db) {
            $modelNames = self::getTagsFromModel($modelNames);
        }

        if (empty($modelNames)) {
            $cacheFront = Zend_Registry::get('CacheFrontend');
            $cacheFront->clean(Zend_Cache::CLEANING_MODE_ALL);
            $messageBag[] = 'Memcached: Purged All';
            return $messageBag;
        }

        foreach ($modelNames as $modelName) {
            $model = new $modelName();
            self::_incrementMemcacheVersion($model);
            if (!$model->getObserver('Translatable')) {
                continue;
            }
            // Make sure cache is cleared for all languages.
            $locales = Garp_I18n::getLocales();
            foreach ($locales as $locale) {
                try {
                    $modelFactory = new Garp_I18n_ModelFactory($locale);
                    $i18nModel = $modelFactory->getModel($model);
                    self::_incrementMemcacheVersion($i18nModel);
                } catch (Garp_I18n_ModelFactory_Exception_ModelAlreadyLocalized $e) {
                    // all good in the hood  ｡^‿^｡
                }
            }
        }
        $messageBag[] = 'Memcached: Purged all given models';
        return $messageBag;
    }
public static function purgeMemcachedCache($modelNames = array(), $messageBag = array()) {
        if (!Zend_Registry::isRegistered('CacheFrontend')) {
            $messageBag[] = 'Memcached: No caching enabled';
            return $messageBag;
        }

        if (!Zend_Registry::get('CacheFrontend')->getOption('caching')) {
            $messageBag[] = 'Memcached: No caching enabled';
            return $messageBag;;
        }

        if ($modelNames instanceof Garp_Model_Db) {
            $modelNames = self::getTagsFromModel($modelNames);
        }

        if (empty($modelNames)) {
            $cacheFront = Zend_Registry::get('CacheFrontend');
            $cacheFront->clean(Zend_Cache::CLEANING_MODE_ALL);
            $messageBag[] = 'Memcached: Purged All';
            return $messageBag;
        }

        foreach ($modelNames as $modelName) {
            $model = new $modelName();
            self::_incrementMemcacheVersion($model);
            if (!$model->getObserver('Translatable')) {
                continue;
            }
            // Make sure cache is cleared for all languages.
            $locales = Garp_I18n::getLocales();
            foreach ($locales as $locale) {
                try {
                    $modelFactory = new Garp_I18n_ModelFactory($locale);
                    $i18nModel = $modelFactory->getModel($model);
                    self::_incrementMemcacheVersion($i18nModel);
                } catch (Garp_I18n_ModelFactory_Exception_ModelAlreadyLocalized $e) {
                    // all good in the hood  ｡^‿^｡
                }
            }
        }
        $messageBag[] = 'Memcached: Purged all given models';
        return $messageBag;
    }
public static function purgeMemcachedCache ( $ modelNames = array ( ) , $ messageBag = array ( ) ) { if ( ! Zend_Registry :: isRegistered ( 'CacheFrontend' ) ) { $ messageBag [ ] = 'Memcached: No caching enabled' ; return $ messageBag ; } if ( ! Zend_Registry :: get ( 'CacheFrontend' ) -> getOption ( 'caching' ) ) { $ messageBag [ ] = 'Memcached: No caching enabled' ; return $ messageBag ; ; } if ( $ modelNames instanceof Garp_Model_Db ) { $ modelNames = self :: getTagsFromModel ( $ modelNames ) ; } if ( empty ( $ modelNames ) ) { $ cacheFront = Zend_Registry :: get ( 'CacheFrontend' ) ; $ cacheFront -> clean ( Zend_Cache :: CLEANING_MODE_ALL ) ; $ messageBag [ ] = 'Memcached: Purged All' ; return $ messageBag ; } foreach ( $ modelNames as $ modelName ) { $ model = new $ modelName ( ) ; self :: _incrementMemcacheVersion ( $ model ) ; if ( ! $ model -> getObserver ( 'Translatable' ) ) { continue ; } // Make sure cache is cleared for all languages. $ locales = Garp_I18n :: getLocales ( ) ; foreach ( $ locales as $ locale ) { try { $ modelFactory = new Garp_I18n_ModelFactory ( $ locale ) ; $ i18nModel = $ modelFactory -> getModel ( $ model ) ; self :: _incrementMemcacheVersion ( $ i18nModel ) ; } catch ( Garp_I18n_ModelFactory_Exception_ModelAlreadyLocalized $ e ) { // all good in the hood  ｡^‿^｡ } } } $ messageBag [ ] = 'Memcached: Purged all given models' ; return $ messageBag ; }
Clear the Memcached cache that stores queries and ini files and whatnot.

@param Array|Garp_Model_Db $modelNames
@param Array $messageBag
@return Void
Clear the Memcached cache that stores queries and ini files and whatnot .