| 1 |
<?php |
| 2 |
|
| 3 |
namespace Buddypress\CLI; |
| 4 |
|
| 5 |
// Bail if WP-CLI is not present. |
| 6 |
if ( ! class_exists( 'WP_CLI' ) ) { |
| 7 |
return; |
| 8 |
} |
| 9 |
|
| 10 |
use WP_CLI; |
| 11 |
|
| 12 |
WP_CLI::add_hook( |
| 13 |
'before_wp_load', |
| 14 |
function () { |
| 15 |
require_once __DIR__ . '/src/command.php'; |
| 16 |
require_once __DIR__ . '/src/buddypress.php'; |
| 17 |
require_once __DIR__ . '/src/signup.php'; |
| 18 |
require_once __DIR__ . '/src/activity-fetcher.php'; |
| 19 |
require_once __DIR__ . '/src/activity.php'; |
| 20 |
require_once __DIR__ . '/src/activity-favorite.php'; |
| 21 |
require_once __DIR__ . '/src/activity-meta.php'; |
| 22 |
require_once __DIR__ . '/src/components.php'; |
| 23 |
require_once __DIR__ . '/src/tool.php'; |
| 24 |
require_once __DIR__ . '/src/notification.php'; |
| 25 |
require_once __DIR__ . '/src/email.php'; |
| 26 |
require_once __DIR__ . '/src/member.php'; |
| 27 |
require_once __DIR__ . '/src/friends.php'; |
| 28 |
require_once __DIR__ . '/src/messages.php'; |
| 29 |
require_once __DIR__ . '/src/xprofile.php'; |
| 30 |
require_once __DIR__ . '/src/xprofile-group.php'; |
| 31 |
require_once __DIR__ . '/src/xprofile-field.php'; |
| 32 |
require_once __DIR__ . '/src/xprofile-data.php'; |
| 33 |
require_once __DIR__ . '/src/group-fetcher.php'; |
| 34 |
require_once __DIR__ . '/src/group.php'; |
| 35 |
require_once __DIR__ . '/src/group-member.php'; |
| 36 |
require_once __DIR__ . '/src/group-invite.php'; |
| 37 |
require_once __DIR__ . '/src/group-meta.php'; |
| 38 |
require_once __DIR__ . '/src/sitewide-notice.php'; |
| 39 |
|
| 40 |
// Load only if the Scaffold package is present. |
| 41 |
if ( class_exists( 'Scaffold_Command' ) ) { |
| 42 |
require_once __DIR__ . '/src/scaffold.php'; |
| 43 |
|
| 44 |
WP_CLI::add_command( |
| 45 |
'bp scaffold', |
| 46 |
__NAMESPACE__ . '\\Command\\Scaffold', |
| 47 |
[ 'before_invoke' => __NAMESPACE__ . '\\Command\\Scaffold::check_dependencies' ] |
| 48 |
); |
| 49 |
} |
| 50 |
|
| 51 |
WP_CLI::add_command( |
| 52 |
'bp', |
| 53 |
__NAMESPACE__ . '\\Command\\BuddyPress', |
| 54 |
[ 'before_invoke' => __NAMESPACE__ . '\\Command\\BuddyPress::check_dependencies' ] |
| 55 |
); |
| 56 |
|
| 57 |
WP_CLI::add_command( |
| 58 |
'bp signup', |
| 59 |
__NAMESPACE__ . '\\Command\\Signup', |
| 60 |
[ 'before_invoke' => __NAMESPACE__ . '\\Command\\Signup::check_dependencies' ] |
| 61 |
); |
| 62 |
|
| 63 |
WP_CLI::add_command( |
| 64 |
'bp tool', |
| 65 |
__NAMESPACE__ . '\\Command\\Tool', |
| 66 |
[ 'before_invoke' => __NAMESPACE__ . '\\Command\\Tool::check_dependencies' ] |
| 67 |
); |
| 68 |
|
| 69 |
WP_CLI::add_command( |
| 70 |
'bp notification', |
| 71 |
__NAMESPACE__ . '\\Command\\Notification', |
| 72 |
[ 'before_invoke' => __NAMESPACE__ . '\\Command\\Notification::check_dependencies' ] |
| 73 |
); |
| 74 |
|
| 75 |
WP_CLI::add_command( |
| 76 |
'bp email', |
| 77 |
__NAMESPACE__ . '\\Command\\Email', |
| 78 |
[ 'before_invoke' => __NAMESPACE__ . '\\Command\\Email::check_dependencies' ] |
| 79 |
); |
| 80 |
|
| 81 |
WP_CLI::add_command( |
| 82 |
'bp member', |
| 83 |
__NAMESPACE__ . '\\Command\\Member', |
| 84 |
[ 'before_invoke' => __NAMESPACE__ . '\\Command\\Member::check_dependencies' ] |
| 85 |
); |
| 86 |
|
| 87 |
WP_CLI::add_command( |
| 88 |
'bp message', |
| 89 |
__NAMESPACE__ . '\\Command\\Messages', |
| 90 |
[ 'before_invoke' => __NAMESPACE__ . '\\Command\\Messages::check_dependencies' ] |
| 91 |
); |
| 92 |
|
| 93 |
WP_CLI::add_command( |
| 94 |
'bp component', |
| 95 |
__NAMESPACE__ . '\\Command\\Components', |
| 96 |
[ 'before_invoke' => __NAMESPACE__ . '\\Command\\Components::check_dependencies' ] |
| 97 |
); |
| 98 |
|
| 99 |
WP_CLI::add_command( |
| 100 |
'bp friend', |
| 101 |
__NAMESPACE__ . '\\Command\\Friends', |
| 102 |
[ 'before_invoke' => __NAMESPACE__ . '\\Command\\Friends::check_dependencies' ] |
| 103 |
); |
| 104 |
|
| 105 |
WP_CLI::add_command( |
| 106 |
'bp activity', |
| 107 |
__NAMESPACE__ . '\\Command\\Activity', |
| 108 |
[ 'before_invoke' => __NAMESPACE__ . '\\Command\\Activity::check_dependencies' ] |
| 109 |
); |
| 110 |
|
| 111 |
WP_CLI::add_command( |
| 112 |
'bp activity favorite', |
| 113 |
__NAMESPACE__ . '\\Command\\Activity_Favorite', |
| 114 |
[ 'before_invoke' => __NAMESPACE__ . '\\Command\\Activity::check_dependencies' ] |
| 115 |
); |
| 116 |
|
| 117 |
WP_CLI::add_command( |
| 118 |
'bp activity meta', |
| 119 |
__NAMESPACE__ . '\\Command\\Activity_Meta', |
| 120 |
[ 'before_invoke' => __NAMESPACE__ . '\\Command\\Activity::check_dependencies' ] |
| 121 |
); |
| 122 |
|
| 123 |
WP_CLI::add_command( |
| 124 |
'bp group', |
| 125 |
__NAMESPACE__ . '\\Command\\Group', |
| 126 |
[ 'before_invoke' => __NAMESPACE__ . '\\Command\\Group::check_dependencies' ] |
| 127 |
); |
| 128 |
|
| 129 |
WP_CLI::add_command( |
| 130 |
'bp group member', |
| 131 |
__NAMESPACE__ . '\\Command\\Group_Member', |
| 132 |
[ 'before_invoke' => __NAMESPACE__ . '\\Command\\Group::check_dependencies' ] |
| 133 |
); |
| 134 |
|
| 135 |
WP_CLI::add_command( |
| 136 |
'bp group meta', |
| 137 |
__NAMESPACE__ . '\\Command\\Group_Meta', |
| 138 |
[ 'before_invoke' => __NAMESPACE__ . '\\Command\\Group::check_dependencies' ] |
| 139 |
); |
| 140 |
|
| 141 |
WP_CLI::add_command( |
| 142 |
'bp group invite', |
| 143 |
__NAMESPACE__ . '\\Command\\Group_Invite', |
| 144 |
[ 'before_invoke' => __NAMESPACE__ . '\\Command\\Group::check_dependencies' ] |
| 145 |
); |
| 146 |
|
| 147 |
WP_CLI::add_command( |
| 148 |
'bp notice', |
| 149 |
__NAMESPACE__ . '\\Command\\Sitewide_Notice', |
| 150 |
[ 'before_invoke' => __NAMESPACE__ . '\\Command\\Sitewide_Notice::check_dependencies' ] |
| 151 |
); |
| 152 |
|
| 153 |
WP_CLI::add_command( |
| 154 |
'bp xprofile', |
| 155 |
__NAMESPACE__ . '\\Command\\XProfile', |
| 156 |
[ 'before_invoke' => __NAMESPACE__ . '\\Command\\XProfile::check_dependencies' ] |
| 157 |
); |
| 158 |
|
| 159 |
WP_CLI::add_command( |
| 160 |
'bp xprofile group', |
| 161 |
__NAMESPACE__ . '\\Command\\XProfile_Group', |
| 162 |
[ 'before_invoke' => __NAMESPACE__ . '\\Command\\XProfile::check_dependencies' ] |
| 163 |
); |
| 164 |
|
| 165 |
WP_CLI::add_command( |
| 166 |
'bp xprofile field', |
| 167 |
__NAMESPACE__ . '\\Command\\XProfile_Field', |
| 168 |
[ 'before_invoke' => __NAMESPACE__ . '\\Command\\XProfile::check_dependencies' ] |
| 169 |
); |
| 170 |
|
| 171 |
WP_CLI::add_command( |
| 172 |
'bp xprofile data', |
| 173 |
__NAMESPACE__ . '\\Command\\XProfile_Data', |
| 174 |
[ 'before_invoke' => __NAMESPACE__ . '\\Command\\XProfile::check_dependencies' ] |
| 175 |
); |
| 176 |
} |
| 177 |
); |
| 178 |
|