PHP code example of fiisoft / phinx

1. Go to this page and download the library: Download fiisoft/phinx library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

fiisoft / phinx example snippets


$config = new PhinxConfig([
    'local' => [
        'environments' => [
            'dev' => [
                'adapter' => 'pgsql',
                'host' => 'localhost',
                'name' => 'dbname',
                'user' => 'username',
                'pass' => 'password',
            ]
        ],
    ]
]);

$config = new PhinxConfig([
    'local' => [
        'paths_root' => __DIR__ . DIRECTORY_SEPARATOR . 'phinx',
        'environments' => [
            'dev' => [
                'adapter' => 'pgsql',
                'host' => 'localhost',
                'name' => 'dbname',
                'user' => 'username',
                'pass' => 'password',
            ]
        ],
    ]
]);

$config = new PhinxConfig([
    'defaults' => [
        'phinx_files' => __DIR__ . DIRECTORY_SEPARATOR . 'dev',
    ],
    'local' => [
        'environments' => [
            'dev' => [
                'adapter' => 'pgsql',
                'host' => 'localhost',
                'name' => 'dbname',
                'user' => 'username',
                'pass' => 'password',
            ]
        ],
    ]
]);

$config = new PhinxConfig([
    'defaults' => [
        'adapter' => 'pgsql',
        'host' => 'localhost',
        'name' => 'dbname',
        'user' => 'username',
        'pass' => 'password',
    ],
    'alpha' => [
      'environments' => [
          'dev' => [
          ],
      ],
    ],
    'bravo' => [
      'environments' => [
          'dev' => [
          ],
          'default_migration_table' => 'phinx_migrations',
      ],
    ],
];