]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - inc/poche/Poche.class.php
[add] link to empty cache in config screen, #454
[github/wallabag/wallabag.git] / inc / poche / Poche.class.php
index a786c8df5a97a37a079636cd9289da9afa7ddd68..d0e2de1f15eeae11898d9277482ed3e4d4bc0a16 100644 (file)
@@ -101,7 +101,7 @@ class Poche
         $passTheme = TRUE;
         # Twig is an absolute requirement for Poche to function. Abort immediately if the Composer installer hasn't been run yet
         if (! self::$canRenderTemplates) {
-            $this->notInstalledMessage[] = 'Twig does not seem to be installed. Please initialize the Composer installation to automatically fetch dependencies. Have a look at <a href="http://doc.wallabag.org/doku.php?id=users:begin:install">the documentation.</a>';
+            $this->notInstalledMessage[] = 'Twig does not seem to be installed. Please initialize the Composer installation to automatically fetch dependencies. You can also download <a href="http://wllbg.org/vendor">vendor.zip</a> and extract it in your wallabag folder.';
             $passTheme = FALSE;
         }
 
@@ -1031,10 +1031,10 @@ class Poche
         // Check the token
 
         $feed = new FeedWriter(RSS2);
-        $feed->setTitle('poche - ' . $type . ' feed');
+        $feed->setTitle('wallabag — ' . $type . ' feed');
         $feed->setLink(Tools::getPocheUrl());
         $feed->setChannelElement('updated', date(DATE_RSS , time()));
-        $feed->setChannelElement('author', 'poche');
+        $feed->setChannelElement('author', 'wallabag');
 
         if ($type == 'tag') {
             $entries = $this->store->retrieveEntriesByTag($tag_id);
@@ -1057,4 +1057,20 @@ class Poche
         $feed->genarateFeed();
         exit;
     }
+
+    public function emptyCache() {
+        $files = new RecursiveIteratorIterator(
+            new RecursiveDirectoryIterator(CACHE, RecursiveDirectoryIterator::SKIP_DOTS),
+            RecursiveIteratorIterator::CHILD_FIRST
+        );
+
+        foreach ($files as $fileinfo) {
+            $todo = ($fileinfo->isDir() ? 'rmdir' : 'unlink');
+            $todo($fileinfo->getRealPath());
+        }
+
+        Tools::logm('empty cache');
+        $this->messages->add('s', _('Cache deleted.'));
+        Tools::redirect();
+    }
 }