diff --git a/CacheAdmin.php b/CacheAdmin.php deleted file mode 100755 index d2a5d4e..0000000 --- a/CacheAdmin.php +++ /dev/null @@ -1,32 +0,0 @@ -getInstance("navBar"); -/*$htmlString = new HtmlString(); -$htmlString->htmlString = '';*/ -$navbar->children[] = new HtmlFromFile("../../../vendor/mouf/utils.cache.cache-interface/src/views/purgebutton.php"); - -// Controller declaration -$moufManager->declareComponent('purgeCaches', 'Mouf\\Utils\\Cache\\Admin\\Controllers\\PurgeCacheController', true); -$moufManager->bindComponents('purgeCaches', 'template', 'moufTemplate'); -$moufManager->bindComponents('purgeCaches', 'content', 'block.content'); - - -unset($moufManager); diff --git a/composer.json b/composer.json index 850012d..3a0ce7c 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,8 @@ ], "require": { "php": ">=5.3.0", - "mouf/utils.composite-exception": "~1.0" + "mouf/utils.composite-exception": "^1", + "mouf/utils.cache.purge-ui": "^1" }, "autoload": { "psr-0": { @@ -23,9 +24,6 @@ }, "extra": { "mouf": { - "require-admin": [ - "CacheAdmin.php" - ], "logo": "logo.png" } } diff --git a/package.xml b/package.xml deleted file mode 100755 index 29b035d..0000000 --- a/package.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - Cache Interface - This package only contains the interface that must be implemented by caching - classes. Unless you want to implement your own caching method, you should import a cache - package that will use this interface. For instance, common/utils/session-cache, or common/utils/file-cache. - - - - - logo.png - - - - CacheInterface.php - - - admin/CacheAdmin.php - admin/controllers/PurgeCacheController.php - - - \ No newline at end of file diff --git a/src/Mouf/Utils/Cache/Admin/Controllers/PurgeCacheController.php b/src/Mouf/Utils/Cache/Admin/Controllers/PurgeCacheController.php deleted file mode 100755 index 9572f62..0000000 --- a/src/Mouf/Utils/Cache/Admin/Controllers/PurgeCacheController.php +++ /dev/null @@ -1,102 +0,0 @@ -getInstance('utilsCacheInterfacePurgeAllCachesMenuItem'); - $menu->setIsActive(true); - - $this->selfedit = $selfedit; - $this->done = $done; - $this->content->addFile(dirname(__FILE__)."/../../../../../views/purge.php", $this); - $this->template->toHtml(); - } - - /** - * Admin page used to purge a single instance. - * - * @URL /purgeCacheInstance/ - * @Logged - */ - public function purgeCacheInstance($name, $selfedit = "false") { - $menu = MoufManager::getMoufManager()->getInstance('utilsCacheInterfacePurgeOneCacheMenuItem'); - $menu->setIsActive(true); - $this->name = $name; - $cacheService = new InstanceProxy($name, $selfedit == "true"); - $cacheService->purgeAll(); - - $this->selfedit = $selfedit; - $this->content->addFile(dirname(__FILE__)."/../../../../../views/purgeInstanceDone.php", $this); - $this->template->toHtml(); - } - - /** - * Finds all the instances implementing the CacheInterface, and calls the "purge" method on them. - * - * @Action - * @param string $selfedit - */ - public function purge($selfedit = "false") { - $this->doPurge($selfedit); - - header("Location: .?done=true&selfedit=".urlencode($selfedit)); - } - - - - /** - * Finds all the instances implementing the CacheInterface, and calls the "purge" method on them. - * - * @Action - * @param string $selfedit - */ - public function doPurge($selfedit = "false") { - $purgeCacheService = new ClassProxy("Mouf\\Utils\\Cache\\Service\\PurgeCacheService"); - $purgeCacheService->purgeAll(); - } - -} - -?> \ No newline at end of file diff --git a/src/Mouf/Utils/Cache/CacheInterface.php b/src/Mouf/Utils/Cache/CacheInterface.php index d96268b..85c02f8 100755 --- a/src/Mouf/Utils/Cache/CacheInterface.php +++ b/src/Mouf/Utils/Cache/CacheInterface.php @@ -1,6 +1,9 @@ findInstances("Mouf\\Utils\\Cache\\CacheInterface"); - - $compositeException = new CompositeException(); - - foreach ($instances as $instanceName) { - try { - $cacheService = $moufManager->getInstance($instanceName); - /* @var $cacheService CacheInterface */ - - $cacheService->purgeAll(); - } catch (\Exception $e) { - $compositeException->add($e); - } - } - - if (!$compositeException->isEmpty()) { - throw $compositeException; - } - } - -} - -?> \ No newline at end of file diff --git a/src/views/purge.php b/src/views/purge.php deleted file mode 100755 index 7a16fd5..0000000 --- a/src/views/purge.php +++ /dev/null @@ -1,18 +0,0 @@ -

Purge all caches

- -done == "true"):?> -
All caches have successfully been purged.
- - - - -

Click the button below to purge all caches whose instances are defined in Mouf.

- -
- - -
\ No newline at end of file diff --git a/src/views/purgeInstanceDone.php b/src/views/purgeInstanceDone.php deleted file mode 100644 index 3f914c0..0000000 --- a/src/views/purgeInstanceDone.php +++ /dev/null @@ -1,3 +0,0 @@ -

Done

- -

Cache instance 'name ?>' has been successfully purged.

diff --git a/src/views/purgebutton.php b/src/views/purgebutton.php deleted file mode 100644 index d73ed45..0000000 --- a/src/views/purgebutton.php +++ /dev/null @@ -1,37 +0,0 @@ - - \ No newline at end of file