X-Git-Url: https://git.cweiske.de/shpub.git/blobdiff_plain/c40d4e6c6349b98c90e8bbb79b361e08e60c0dba..059c6ab77b8e63210b9afc266d62c9f543d4d7ae:/src/shpub/Command/Article.php diff --git a/src/shpub/Command/Article.php b/src/shpub/Command/Article.php index b51740d..8445af4 100644 --- a/src/shpub/Command/Article.php +++ b/src/shpub/Command/Article.php @@ -3,16 +3,6 @@ namespace shpub; class Command_Article extends Command_AbstractProps { - /** - * @var Config - */ - protected $cfg; - - public function __construct($cfg) - { - $this->cfg = $cfg; - } - public static function opts(\Console_CommandLine $optParser) { $cmd = $optParser->addCommand('article'); @@ -48,14 +38,14 @@ class Command_Article extends Command_AbstractProps public function run(\Console_CommandLine_Result $cmdRes) { $req = new Request($this->cfg->host, $this->cfg); - $req->req->addPostParameter('h', 'entry'); - $req->req->addPostParameter('name', $cmdRes->args['title']); + $req->setType('entry'); + $req->addProperty('name', $cmdRes->args['title']); if ($cmdRes->options['html']) { - $req->req->addPostParameter( - 'content[html]', $cmdRes->args['text'] + $req->addProperty( + 'content', ['html' => $cmdRes->args['text']] ); } else { - $req->req->addPostParameter('content', $cmdRes->args['text']); + $req->addProperty('content', $cmdRes->args['text']); } $this->handleGenericOptions($cmdRes, $req);