Download the PHP package pinkcrab/perique-migration without Composer

On this page you can find all versions of the php package pinkcrab/perique-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 perique-migration

Perique - Migrations

A wrapper around various PinkCrab libraries which make it easier to run DB migrations from a plugin created using the Perique Framework.

Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require GitHub contributors GitHub issues WordPress 5.9 Test Suite [PHP7.4-8.1] WordPress 6.0 Test Suite [PHP7.4-8.1] WordPress 6.1 Test Suite [PHP7.4-8.2] WordPress 6.2 Test Suite [PHP7.4-8.2] codecov Scrutinizer Code Quality Maintainability


Why?

There already exists a WPDB Migrations system written by PinkCrab for use in any WordPress plugin or even theme. However working this into Perique required building a small little isolated workflow due to the nature of how the Perique Registration Process works and how WordPress handles plugin events such as Activation, Deactivation and Uninstalling.

So to make it more seamless adding Database Migrations to Perique, we have created this library to help.

Depends on

As mentioned this library acts more of a bridge for the following packages.


Setup

Creation of Migrations

To create database migrations, the Migration abstract class must be extended.

Full Migration model references below Example Plugin

Example of table using Perique App Config for table names.

Create the Migrations service

The Perique Migrations Module requires the Plugin Life Cycle to be added to the Perique App. This is to ensure that the migrations are run at the correct time.

Migration Model

All models must extend from the ( abstract ) PinkCrab\Perique\Migration\Migration class

Methods


__construct(...$deps)

@param mixed ...$deps Injected via the DI Container

You can inject any dependencies you need, so long as they either be inferred by the Type or has the rules define in the DI Rules. See the di container docs for more details


table_name(): string

@return string
@required method

This should return the final name for the table. This can be defined as a string literal or via an injected dependency (such as 'App_Config')


schema( Schema $schema_config ): void

@param PinkCrab\Table_Builder\Schema $schema
@return null @required method

This allows for the definition of the tables schema. Please see the WPDB Migration and WPDB Table Builder libraries for more details


seed( array $seeds ): array

@param array<int, array<string, mixed>> $seeds
@return array<int, array<string, mixed>>

Returns the data used to populate the table with. Should be returned as an array or arrays with matching column (key) and value pairs.


drop_on_deactivation(): bool

@return bool

Depending on the return value, the table can be dropped on deactivation. Defaults to FALSE


drop_on_uninstall(): bool

@return bool

Depending on the return value, the table can be dropped on uninstall. Defaults to FALSE


seed_on_inital_activation(): bool

@return bool

Depending on the return value, will populate tables with defined seeded data Defaults to TRUE

Tables are only seeded once, even in the event of a later update.

Change Log


All versions of perique-migration with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4.0
pinkcrab/perique-framework-core Version 2.0.*
pinkcrab/wp-db-migrations Version ^1.0
pinkcrab/perique-plugin-lifecycle Version 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 pinkcrab/perique-migration contains the following files

Loading the files please wait ....