Download the PHP package elao/command-migration without Composer

On this page you can find all versions of the php package elao/command-migration. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package command-migration

CommandMigration

PHP library to run commands, for example on deployment.

Why

Sometimes, on deployment or when switching to a branch, we need to run some migration commands, for example reindex a database, calculate aggregation, remove whatever uploaded files...

Do not do it manually anymore by connecting to your server in ssh! This library allow you to declare in your feature git branch what command(s) need to be run once deployed.

Install

$ composer require elao/command-migration

Enable the bundle on Symfony <= 3.4 (app/AppKernel.php)

public function registerBundles()
{
    $bundles = array(
        // ...
        new Elao\CommandMigration\Bridge\Symfony\Bundle\CommandMigrationBundle(),
        // ...
    );
}

Enable the bundle on Symfony 4 (config/bundles.php)

return [
    // ...
    Elao\CommandMigration\Bridge\Symfony\Bundle\CommandMigrationBundle::class => ['all' => true],
    // ...
];

Add a elao_command_migration.yaml file (in a not public directory of course!):

Usage

Declare what command(s) need to be run in the migrations entry in your elao_command_migration.yaml file:

Entries in migrations could have whatever identifier, but we recommend to use a date + time format: YYYYMMDDHHMMSS

Run php bin/elao-command-migration path/to/elao_command_migration.yaml to test it.

Integration

Add php bin/elao-command-migration path/to/elao_command_migration.yaml to your deployment process.

Capifony

Set in deploy.rb:

Ansible

With Manala/ansible-role-deploy, add in ansible/group_vars/deploy.yml:

or

How it works

CommandMigration is very inspired by Doctrine Migrations but for running commands.

The elao:command-migration:run command :

Clean old migrations

When the commands have been deployed and ran on production environment, you can (manually) delete the entries in elao_command_migration.migrations.

Who is using it?


All versions of command-migration with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2.0
doctrine/dbal Version ^2.6.0
symfony/console Version ~3.4|~4.1
symfony/event-dispatcher Version ~3.4|~4.1
symfony/process Version ~3.4|~4.1
symfony/yaml Version ~3.4|~4.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package elao/command-migration contains the following files

Loading the files please wait ...