[img] allow CLI image deletion
This commit is contained in:
parent
7e017ded3b
commit
fddc1fd453
1 changed files with 13 additions and 0 deletions
|
@ -196,6 +196,19 @@ class ImageIO extends Extension
|
||||||
$event->image->delete();
|
$event->image->delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function onCommand(CommandEvent $event)
|
||||||
|
{
|
||||||
|
if ($event->cmd == "help") {
|
||||||
|
print "\tdelete <post id>\n";
|
||||||
|
print "\t\tdelete a specific post\n\n";
|
||||||
|
}
|
||||||
|
if ($event->cmd == "delete") {
|
||||||
|
$post_id = (int)$event->args[0];
|
||||||
|
$image = Image::by_id($post_id);
|
||||||
|
send_event(new ImageDeletionEvent($image));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function onImageReplace(ImageReplaceEvent $event)
|
public function onImageReplace(ImageReplaceEvent $event)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
|
Reference in a new issue