FreshCommand.php
3 weeks ago
MakeClassCommand.php
3 weeks ago
MakeControllerCommand.php
3 weeks ago
MakeMigrationCommand.php
3 weeks ago
MakeModelCommand.php
3 weeks ago
MakeProviderCommand.php
3 weeks ago
MakeRequestCommand.php
3 weeks ago
MakeSeederCommand.php
3 weeks ago
MigrateCommand.php
3 weeks ago
SeedCommand.php
3 weeks ago
MigrateCommand.php
35 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Runs all registered migrations that have not yet been applied. |
| 5 | * Delegates to the Migrator service and reports success via WP-CLI. |
| 6 | * The primary entry point for applying schema changes in a WordPress plugin context. |
| 7 | * |
| 8 | * @package Framework |
| 9 | * @subpackage Console\Commands |
| 10 | * @since 1.0.0 |
| 11 | */ |
| 12 | namespace Kirki\Framework\Console\Commands; |
| 13 | |
| 14 | \defined('ABSPATH') || exit; |
| 15 | use Kirki\Framework\Console\CommandBase; |
| 16 | use function Kirki\Framework\migrator; |
| 17 | class MigrateCommand extends CommandBase |
| 18 | { |
| 19 | /** |
| 20 | * Run the command |
| 21 | * |
| 22 | * @param mixed $args The positional arguments. |
| 23 | * @param mixed $assoc The associative arguments. |
| 24 | * |
| 25 | * @return void |
| 26 | * |
| 27 | * @since 1.0.0 |
| 28 | */ |
| 29 | public function run($args, $assoc) |
| 30 | { |
| 31 | migrator()->run(); |
| 32 | \WP_CLI::success('Migrations run successfully.'); |
| 33 | } |
| 34 | } |
| 35 |