public static function purgeStaticCache($modelNames = array(), $cacheDir = false, $messageBag = array()) {
        if (!Zend_Registry::get('CacheFrontend')->getOption('caching')) {
            // caching is disabled (yes, this particular frontend is not in charge of static
            // cache, but in practice this toggle is used to enable/disable caching globally, so
            // this matches developer expectations better, probably)
            $messageBag[] = 'Static cache: No caching enabled';
            return $messageBag;
        }

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

        $cacheDir = $cacheDir ?: self::_getStaticCacheDir();
        if (!$cacheDir) {
            $messageBag[] = 'Static cache: No cache directory configured';
            return $messageBag;
        }
        $cacheDir = str_replace(' ', '\ ', $cacheDir);
        $cacheDir = rtrim($cacheDir, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;

        // Destroy all if no model names are given
        if (empty($modelNames)) {
            $allPath = $cacheDir . '*';
            $response = self::_deleteStaticCacheFile($allPath);
            $messageBag[] = $response
                ? 'Static cache: Deleted all static cache files'
                : 'Static cache: There was a problem with deleting the static cache files';
            return $messageBag;
        }
        // Fetch model names from configuration
        if (!$tagList = self::_getTagList()) {
            $messageBag[] = 'Static cache: No cache tags found';
            return $messageBag;
        }
        $_purged = array();
        foreach ($modelNames as $tag) {
            if (!$tagList->{$tag}) {
                continue;
            }
            foreach ($tagList->{$tag} as $path) {
                while (strpos($path, '..') !== false) {
                    $path = str_replace('..', '.', $path);
                }
                $filePath = $cacheDir . $path;
                // Keep track of purged paths, forget about duplicates
                if (in_array($filePath, $_purged)) {
                    continue;
                }
                self::_deleteStaticCacheFile($filePath);
                $_purged[] = $filePath;
            }
        }
        $messageBag[] = 'Static cache: purged';
        return $messageBag;
    }