exp:expmigrationcheck
Check migration files without running them: names, headers, order, PHP syntax and classes (the lint for CI).
Script bin/php/expmigrationcheck.php, code in kernel/private/classes/commands/expmigrationcheck.php. Run it from the installation root, as the user the web server runs as:
./console exp:expmigrationcheck --help
./console exp:migration:check --help
php bin/php/expmigrationcheck.php --helpHelp text
Check migration files
The lint for CI, without a database: every migration of the migration directories (or of --path)
is checked for a valid file name, a header of known keys, requirements that exist and no cycle,
active extensions it requires, and, for a PHP migration, its syntax and exactly one class that
extends expMigrationPhp and loads; for a YAML migration, its YAML and every step against the
schema of its step type, with its conditions, loops and references. Nothing of a migration is run.
Exit 1 when something is wrong.
./console exp:migration:check
./console exp:migration:check --path=extension/expnews/migrations --format=json
./console exp:migration:check --environment=productionOptions
| Option | Value | Help |
|---|---|---|
--path | required | Migration files or folders, relative to the root or absolute (a comma list or repeated): migrate and dry-run take only the migrations in them, check checks them instead of the migration directories |
--environment | required | The environment (default the installation's: [AdminEnvironment] Level, or EXP_ENV with Level=auto; check: every environment); only the migrations for it count |
--format | required | text (default) or json (the machine output exp-migration/1) |
Read from the option definitions in the code (startup(), getOptions(), options() or ezcConsoleOption). Every script also takes the standard options of the script framework (--help, --siteaccess, --debug, --quiet, --allow-root-user ...).
Related
Generated by ./console exp:help:examples from bin/php/expmigrationcheck.php, kernel/private/classes/commands/expmigrationcheck.php. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.