PHP code example of qifen / phinx

1. Go to this page and download the library: Download qifen/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/ */

    

qifen / phinx example snippets

 php
//config/plugin/qifen/phinx/phinx.php


//读取当前系统设置

return [
    "paths" => [
        "migrations" => "database/migrations", //在项目根目录下创建此路径
        "seeds" => "database/seeds" //在项目根目录下创建此路径
    ],
    "environments" => [
        "default_migration_table" => "phinxlog",
        "default_database" => "dev",
        "default_environment" => "dev",
        "dev" => [
            "adapter" => config('database.connections.mysql.driver'),
            "host" => config('database.connections.mysql.host'),
            "name" => config('database.connections.mysql.database'),
            "user" => config('database.connections.mysql.username'),
            "pass" => config('database.connections.mysql.password'),
            "port" => config('database.connections.mysql.port'),
            'charset' => 'utf8mb4',
            'collation' => 'utf8mb4_0900_ai_ci'
        ]
    ],
    "migration_base_class" => \Qifen\phinx\Commands\MigrationBaseClass::class,
    "seeder_base_class" => \Qifen\phinx\Commands\SeederBaseClass::class
];

php phinx