src/Migrator.php
/**
     * Generate a configuration for Phinx
     *
     * This has to be created at runtime because the contents are dynamic
     * to the WordPress instance and registered package
     *
     * @return array
     */
Generate a configuration for Phinx
This has to be created at runtime because the contents are dynamic
to the WordPress instance and registered package

@return array
Generate a configuration for Phinx This has to be created at runtime because the contents are dynamic to the WordPress instance and registered package @return array
private function generateConfig()
    {
        $host = preg_replace('/:[0-9]+$/', '', DB_HOST); 
        $port = preg_replace('/^.*:([0-9]+)$/', '$1', DB_HOST); 
        return [
            'paths' => [
                'migrations' => [$this->namespace => sprintf('%s/migrations', $this->root)],
                'seeds' => sprintf('%s/seeds', $this->root),
            ],
            'environments' => [
                'default_migration_table' => 'package_migrations',
                'wordpress' => [
                    'host'      => $host,
                    'port'      => $port,
                    'user'      => DB_USER,
                    'pass'      => DB_PASSWORD,
                    'adapter'   => 'wordpress',
                    'wrapper'   => 'wordpress',
                    'name'      => DB_NAME,
                    'package'   => $this->package,
                    'pkgtype'   => $this->type,
                    'slug'      => $this->slug,
                ],
            ],
        ];
    }
private function generateConfig ( ) { $ host = preg_replace ( '/:[0-9]+$/' , '' , DB_HOST ) ; $ port = preg_replace ( '/^.*:([0-9]+)$/' , '$1' , DB_HOST ) ; return [ 'paths' => [ 'migrations' => [ $ this -> namespace => sprintf ( '%s/migrations' , $ this -> root ) ] , 'seeds' => sprintf ( '%s/seeds' , $ this -> root ) , ] , 'environments' => [ 'default_migration_table' => 'package_migrations' , 'wordpress' => [ 'host' => $ host , 'port' => $ port , 'user' => DB_USER , 'pass' => DB_PASSWORD , 'adapter' => 'wordpress' , 'wrapper' => 'wordpress' , 'name' => DB_NAME , 'package' => $ this -> package , 'pkgtype' => $ this -> type , 'slug' => $ this -> slug , ] , ] , ] ; }
Generate a configuration for Phinx
 This has to be created at runtime because the contents are dynamic
 to the WordPress instance and registered package
Generate a configuration for Phinx This has to be created at runtime because the contents are dynamic to the WordPress instance and registered package
// Split WordPress DB host into host and port // Remove port // Isolate port // Custom