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