Last active
December 14, 2023 04:44
-
-
Save jmny/c957de6984c9d939c059 to your computer and use it in GitHub Desktop.
phinx outside cli
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// see also https://github.com/robmorgan/phinx/issues/364 | |
$phinxApp = new \Phinx\Console\PhinxApplication(); | |
$phinxTextWrapper = new \Phinx\Wrapper\TextWrapper($phinxApp); | |
$phinxTextWrapper->setOption('configuration', '/path/to/phinx.yml'); | |
$phinxTextWrapper->setOption('parser', 'YAML'); | |
$phinxTextWrapper->setOption('environment', 'development'); | |
$log = $phinxTextWrapper->getMigrate(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi
When I run above commands it works but nothing happens in the database. Please see my output
C:/xampp/htdocsstring(266) "Phinx by CakePHP - https://phinx.org. 0.10.6 using config file .\vendor\bin\phinx.php using config parser php using migration paths using seed paths using environment development using adapter mysql using database production_db All Done. Took 0.0841s "
Also i am putting my code here
require DIR . '/vendor/autoload.php';
$phinxApp = new \Phinx\Console\PhinxApplication();
$phinxTextWrapper = new \Phinx\Wrapper\TextWrapper($phinxApp);
$phinxTextWrapper->setOption('configuration', 'C:/xampp/htdocs/CI_PROJECT/phinix/vendor/bin/phinx.php');
$phinxTextWrapper->setOption('parser', 'php');
$phinxTextWrapper->setOption('environment', 'development');
$log = $phinxTextWrapper->getMigrate('development','-t');
var_dump($log);