git.cweiske.de
/
shpub.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add "json" option
[shpub.git]
/
src
/
shpub
/
Command
/
Like.php
diff --git
a/src/shpub/Command/Like.php
b/src/shpub/Command/Like.php
index fb396be6c7eaf93519d86373615ec8579da2c79a..ad19b8f529838a4014f50bc70420bff4eb1932b1 100644
(file)
--- a/
src/shpub/Command/Like.php
+++ b/
src/shpub/Command/Like.php
@@
-3,16
+3,6
@@
namespace shpub;
class Command_Like extends Command_AbstractProps
{
class Command_Like extends Command_AbstractProps
{
- /**
- * @var Config
- */
- protected $cfg;
-
- public function __construct($cfg)
- {
- $this->cfg = $cfg;
- }
-
public static function opts(\Console_CommandLine $optParser)
{
$cmd = $optParser->addCommand('like');
public static function opts(\Console_CommandLine $optParser)
{
$cmd = $optParser->addCommand('like');
@@
-34,8
+24,8
@@
class Command_Like extends Command_AbstractProps
}
$req = new Request($this->cfg->host, $this->cfg);
}
$req = new Request($this->cfg->host, $this->cfg);
- $req->
req->addPostParameter('h',
'entry');
- $req->
req->addPostParameter
('like-of', $url);
+ $req->
setType(
'entry');
+ $req->
addProperty
('like-of', $url);
$this->handleGenericOptions($cmdRes, $req);
$res = $req->send();
$this->handleGenericOptions($cmdRes, $req);
$res = $req->send();
@@
-46,8
+36,8
@@
class Command_Like extends Command_AbstractProps
Log::err($res->getBody());
exit(20);
} else {
Log::err($res->getBody());
exit(20);
} else {
-
echo "Like created at server\n"
;
-
echo $postUrl . "\n"
;
+
Log::info('Like created at server')
;
+
Log::msg($postUrl)
;
}
}
}
}
}
}