/** * Fills the $images array with available images * * @internal */ private static function loadImages() { if (!empty($images)) { return; } // Get the vendor base dir $images_dir = dirname(dirname(dirname(dirname(__FILE__)))) . '/resources/images'; // Quick sanity check if (!is_dir($images_dir) || !is_readable($images_dir)) { return; } StoragePath::recurseCallback($images_dir, array(__CLASS__, '_doLoadImages'), array(), false, true); }
/** * Clears (purges) any plugin-wide managed caches * * @param bool $delete If set to `true`, the cache is deleted instead of only cleared * @return bool Returns `true` if the operation was successful, `false` otherwise * @api */ public function clearCache($delete = false) { $cache_dir = $this->getPluginDir() . static::VIEWS_CACHE_DIR; $result = StoragePath::delete($cache_dir) !== false; if ($result && !$delete) { $result = StoragePath::validate($cache_dir) !== false; } return $result; }