PHP code example of mpeter-php / phpmig-mysqli-adapter
1. Go to this page and download the library: Download mpeter-php/phpmig-mysqli-adapter library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?phprequire_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
mpeter-php / phpmig-mysqli-adapter example snippets
hpmig\Adapter\MysqlIAdapter;
usePhpmig\Api\PhpmigApplication;
useSymfony\Component\Console\Output\NullOutput;
$mysqli = new mysqli('db_host', 'db_user', 'db_pass', 'my_database');
(new PhpmigApplication(
new ArrayObject(
[
'phpmig.migrations_path' => __DIR__ . DIRECTORY_SEPARATOR . 'migrations',
'phpmig.adapter' => new MysqlIAdapter($mysqli, 'migrations'),
'db' => $mysqli
]
), new NullOutput()
))->up();