Download the PHP package apinstein/mp without Composer

On this page you can find all versions of the php package apinstein/mp. 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 mp

MP: Migrations for PHP

MP is a generic migrations architecture for managing migrations between versions of a web application.

It can be used to migration database schemas as well as perform arbitary code during upgrades and downgrades.

INSTALLATION

pear install apinstein.pearfarm.org/mp

HOW IT WORKS MP keeps track of the current version of your application. You can then request to migrate to any version.

MP also has a "clean" function which allows you to reset your application to "version 0". There is a clean() callback which allows you to programmatically return your application to a pristine state when migrating with the "clean" option.

By default you can implement your "clean" functionality in the MigrationClean::clean() method of migrations/clean.php:

public function clean($migrator) { $migrator->getDbCon()->exec("drop database foo;"); }

NOTE: If you prefer you can also create your baseline schema in clean. However, I usually set up the baseline schema in the first migration.

Each migration for your application is defined by a class in the migrations directory.

EXAMPLE CLI USAGE $ mp -f # Use file-based version tracking; If no args will just print version.

NOTE: First run of MP will create the migrations directory,

                                    create a stub clean script, and set the version to 0.

$ mp -f -n # Create a new migration; will write a stub file in migrations dir $ mp -f -m # Migrate to head (latest revision) $ mp -f -m20090716_204830 # Migrate to revision 20090716_204830 $ mp -f -r # Reset to "clean" state (version 0)

If you need DB access in your migrations, you can bootstrap them yourself, or, if you supply a dsn like so: $ mp -x'pgsql:dbname=mydb;user=mydbuser;host=localhost'

Then in your migrations you can do:

$this->migrator->getDbCon()->exec($sql);

And in the clean() function, it's: $migrator->getDbCon()->exec($sql);

NOTE: If you use Migrator's db connection, it is configured to throw PDOException on error.

EXAMPLE API USAGE $m = new Migrator(); $m->clean(); $m->upgradeToLatest(); $m->downgradeToVersion('20090716_204830'); $m->upgradeToVersion('20090716_205029'); $m->downgradeToVersion('20090716_212141');

NOTE FOR SOURCE CONTROL If you use the file-based version tracking (ie migrations/version.txt) then make sure to have your source control system ignore that file. You definitely don't want your system to think it's been updated when you push new code to production but before you run your migrations! Therefore it is recommended to use DB-based versioning wherever possible.

INTEGRATION While MP can be operated purely via the migrate command line tool, it is also designed to be implemented into your web application or with any framework. You can use the Migrator API to custom-configure MP's behavior for your application or framework.

This is ideal for use with ORMs that may already have an API to manage schemas but don't have a migrations system. It also works well with ORMs that don't have an API to manage schemas, as you can still integrate with them to use their DB connection for executing SQL migrations.

ROADMAP / TODO


All versions of mp with dependencies

PHP Build Version
Package Version
Requires php Version >=5.2.0
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 apinstein/mp contains the following files

Loading the files please wait ....