| @@ -6,8 +6,21 @@ | ||
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | namespace Activitypub; |
| 9 | 9 | |
| 10 | +use Activitypub\Cli\Actor_Command; | |
| 11 | +use Activitypub\Cli\Blurhash_Command; | |
| 12 | +use Activitypub\Cli\Cache_Command; | |
| 13 | +use Activitypub\Cli\Command; | |
| 14 | +use Activitypub\Cli\Comment_Command; | |
| 15 | +use Activitypub\Cli\Fetch_Command; | |
| 16 | +use Activitypub\Cli\Follow_Command; | |
| 17 | +use Activitypub\Cli\Move_Command; | |
| 18 | +use Activitypub\Cli\Outbox_Command; | |
| 19 | +use Activitypub\Cli\Post_Command; | |
| 20 | +use Activitypub\Cli\Self_Destruct_Command; | |
| 21 | +use Activitypub\Cli\Stats_Command; | |
| 22 | + | |
| 10 | 23 | /** |
| 11 | 24 | * ActivityPub CLI command registry. |
| 12 | 25 | * |
| 13 | 26 | * Registers all ActivityPub CLI subcommands with WP-CLI. |
| @@ -32,14 +45,15 @@ | ||
| 32 | 45 | * - wp activitypub move <from> <to> |
| 33 | 46 | * - wp activitypub follow <remote_user> |
| 34 | 47 | * - wp activitypub stats <collect|compile|send> |
| 35 | 48 | * - wp activitypub fetch <url> |
| 49 | + * - wp activitypub blurhash backfill [--dry-run] [--limit=<n>] [--force] | |
| 36 | 50 | */ |
| 37 | 51 | public static function register() { |
| 38 | 52 | // Register parent command with version subcommand. |
| 39 | 53 | \WP_CLI::add_command( |
| 40 | 54 | 'activitypub', |
| 41 | - '\Activitypub\Cli\Command', | |
| 55 | + Command::class, | |
| 42 | 56 | array( |
| 43 | 57 | 'shortdesc' => 'Manage ActivityPub plugin functionality and federation.', |
| 44 | 58 | ) |
| 45 | 59 | ); |
| @@ -45,9 +59,9 @@ | ||
| 45 | 59 | ); |
| 46 | 60 | |
| 47 | 61 | \WP_CLI::add_command( |
| 48 | 62 | 'activitypub post', |
| 49 | - '\Activitypub\Cli\Post_Command', | |
| 63 | + Post_Command::class, | |
| 50 | 64 | array( |
| 51 | 65 | 'shortdesc' => 'Manage ActivityPub posts (delete or update).', |
| 52 | 66 | ) |
| 53 | 67 | ); |
| @@ -53,9 +67,9 @@ | ||
| 53 | 67 | ); |
| 54 | 68 | |
| 55 | 69 | \WP_CLI::add_command( |
| 56 | 70 | 'activitypub comment', |
| 57 | - '\Activitypub\Cli\Comment_Command', | |
| 71 | + Comment_Command::class, | |
| 58 | 72 | array( |
| 59 | 73 | 'shortdesc' => 'Manage ActivityPub comments (delete or update).', |
| 60 | 74 | ) |
| 61 | 75 | ); |
| @@ -61,9 +75,9 @@ | ||
| 61 | 75 | ); |
| 62 | 76 | |
| 63 | 77 | \WP_CLI::add_command( |
| 64 | 78 | 'activitypub actor', |
| 65 | - '\Activitypub\Cli\Actor_Command', | |
| 79 | + Actor_Command::class, | |
| 66 | 80 | array( |
| 67 | 81 | 'shortdesc' => 'Manage ActivityPub actors (delete or update).', |
| 68 | 82 | ) |
| 69 | 83 | ); |
| @@ -69,9 +83,9 @@ | ||
| 69 | 83 | ); |
| 70 | 84 | |
| 71 | 85 | \WP_CLI::add_command( |
| 72 | 86 | 'activitypub outbox', |
| 73 | - '\Activitypub\Cli\Outbox_Command', | |
| 87 | + Outbox_Command::class, | |
| 74 | 88 | array( |
| 75 | 89 | 'shortdesc' => 'Manage ActivityPub outbox items (undo or reschedule).', |
| 76 | 90 | ) |
| 77 | 91 | ); |
| @@ -77,9 +91,9 @@ | ||
| 77 | 91 | ); |
| 78 | 92 | |
| 79 | 93 | \WP_CLI::add_command( |
| 80 | 94 | 'activitypub self-destruct', |
| 81 | - '\Activitypub\Cli\Self_Destruct_Command', | |
| 95 | + Self_Destruct_Command::class, | |
| 82 | 96 | array( |
| 83 | 97 | 'shortdesc' => 'Remove the entire blog from the Fediverse.', |
| 84 | 98 | ) |
| 85 | 99 | ); |
| @@ -85,9 +99,9 @@ | ||
| 85 | 99 | ); |
| 86 | 100 | |
| 87 | 101 | \WP_CLI::add_command( |
| 88 | 102 | 'activitypub move', |
| 89 | - '\Activitypub\Cli\Move_Command', | |
| 103 | + Move_Command::class, | |
| 90 | 104 | array( |
| 91 | 105 | 'shortdesc' => 'Move the blog to a new URL.', |
| 92 | 106 | ) |
| 93 | 107 | ); |
| @@ -93,9 +107,9 @@ | ||
| 93 | 107 | ); |
| 94 | 108 | |
| 95 | 109 | \WP_CLI::add_command( |
| 96 | 110 | 'activitypub follow', |
| 97 | - '\Activitypub\Cli\Follow_Command', | |
| 111 | + Follow_Command::class, | |
| 98 | 112 | array( |
| 99 | 113 | 'shortdesc' => 'Follow a remote ActivityPub user.', |
| 100 | 114 | ) |
| 101 | 115 | ); |
| @@ -101,9 +115,9 @@ | ||
| 101 | 115 | ); |
| 102 | 116 | |
| 103 | 117 | \WP_CLI::add_command( |
| 104 | 118 | 'activitypub cache', |
| 105 | - '\Activitypub\Cli\Cache_Command', | |
| 119 | + Cache_Command::class, | |
| 106 | 120 | array( |
| 107 | 121 | 'shortdesc' => 'Manage remote media cache (clear or show status).', |
| 108 | 122 | ) |
| 109 | 123 | ); |
| @@ -109,9 +123,9 @@ | ||
| 109 | 123 | ); |
| 110 | 124 | |
| 111 | 125 | \WP_CLI::add_command( |
| 112 | 126 | 'activitypub fetch', |
| 113 | - '\Activitypub\Cli\Fetch_Command', | |
| 127 | + Fetch_Command::class, | |
| 114 | 128 | array( |
| 115 | 129 | 'shortdesc' => 'Fetch a remote URL with a signed ActivityPub request.', |
| 116 | 130 | ) |
| 117 | 131 | ); |
| @@ -117,11 +131,19 @@ | ||
| 117 | 131 | ); |
| 118 | 132 | |
| 119 | 133 | \WP_CLI::add_command( |
| 120 | 134 | 'activitypub stats', |
| 121 | - '\Activitypub\Cli\Stats_Command', | |
| 135 | + Stats_Command::class, | |
| 122 | 136 | array( |
| 123 | 137 | 'shortdesc' => 'Manage ActivityPub statistics (collect, compile or send).', |
| 138 | + ) | |
| 139 | + ); | |
| 140 | + | |
| 141 | + \WP_CLI::add_command( | |
| 142 | + 'activitypub blurhash', | |
| 143 | + Blurhash_Command::class, | |
| 144 | + array( | |
| 145 | + 'shortdesc' => 'Backfill Blurhash placeholders for image attachments.', | |
| 124 | 146 | ) |
| 125 | 147 | ); |
| 126 | 148 | } |
| 127 | 149 | } |