X-Git-Url: https://git.cweiske.de/shpub.git/blobdiff_plain/940e99e237daa66bbe9f5f07f5f6958dca12bd26..059c6ab77b8e63210b9afc266d62c9f543d4d7ae:/src/shpub/Command/Note.php diff --git a/src/shpub/Command/Note.php b/src/shpub/Command/Note.php index de67948..c7683f3 100644 --- a/src/shpub/Command/Note.php +++ b/src/shpub/Command/Note.php @@ -3,16 +3,6 @@ namespace shpub; class Command_Note extends Command_AbstractProps { - /** - * @var Config - */ - protected $cfg; - - public function __construct($cfg) - { - $this->cfg = $cfg; - } - public static function opts(\Console_CommandLine $optParser) { $cmd = $optParser->addCommand('note'); @@ -30,14 +20,14 @@ class Command_Note 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('content', $cmdRes->args['text']); + $req->setType('entry'); + $req->addProperty('content', $cmdRes->args['text']); $this->handleGenericOptions($cmdRes, $req); $res = $req->send(); $postUrl = $res->getHeader('Location'); - echo "Post created at server\n"; - echo $postUrl . "\n"; + Log::info('Post created at server'); + Log::msg($postUrl); } } ?>