automatically filter tasks when ID/URL is given
[stapibas.git] / src / stapibas / Cli.php
index 02942e4593147f4d1b7e71e2a138f3efa590e508..40d9d17b9612e4d87fe9f0187eedd07a562edba2 100644 (file)
@@ -75,6 +75,15 @@ class Cli
     ) {
         $tasks = array_flip(explode(',', $result->command->options['tasks']));
 
+        //if an ID/url is given, only execute the matching task
+        if (isset($result->command->options['feed'])) {
+            $tasks = array('feeds' => 1);
+        } else if (isset($result->command->options['entry'])) {
+            $tasks = array('entries' => 1);
+        } else if (isset($result->command->options['entryurl'])) {
+            $tasks = array('urls' => 1);
+        }
+
         if (isset($tasks['feeds'])) {
             $this->runFeedUpdateFeeds($deps);
         }
@@ -125,10 +134,11 @@ class Cli
         \Console_CommandLine_Result $command, Dependencies $deps
     ) {
         //fetch content of pingback source pages
-        $cf = new Pingback_ContentFetcher($deps);
+        $cf = new Content_Fetcher($deps);
         $cf->updateAll();
 
-        //FIXME
+        $cx = new Content_Extractor($deps);
+        $cx->updateAll();
     }