4 class Command_Article extends Command_AbstractProps
6 public static function opts(\Console_CommandLine $optParser)
8 $cmd = $optParser->addCommand('article');
9 static::addOptHtml($cmd);
10 static::optsGeneric($cmd);
16 'description' => 'Title/Name',
24 'description' => 'Text content',
29 public function run(\Console_CommandLine_Result $cmdRes)
31 $req = new Request($this->cfg->host, $this->cfg);
32 $req->setType('entry');
33 $req->addProperty('name', $cmdRes->args['title']);
34 $req->addContent($cmdRes->args['text'], $cmdRes->options['html']);
35 $this->handleGenericOptions($cmdRes, $req);
38 $postUrl = $res->getHeader('Location');
39 Log::info('Article created at server');