You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/default.texy
+175Lines changed: 175 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -148,3 +148,178 @@ $controller->addExtension('php', new Extensions\PhpHandler([
148
148
'dibi' => $conn,
149
149
]));
150
150
\--
151
+
152
+
153
+
Using as Phalcon Framework Task
154
+
===============================
155
+
156
+
Migrations come with predefined Phalcon CLI Task. Task uses these two services:
157
+
158
+
* **config** (`\Phalcon\Config`) with key `migrationsDir`. See example config.php below.
159
+
* **driver** (`\Nextras\Migrations\IDriver`). See example in cli.php below.
160
+
161
+
Service `driver` needs `\Nextras\Migrations\Bridges\Phalcon\PhalconAdapter` as argument. Therefore you will probably need to declare other services (see cli.php) or create phalcon adapter inside **driver**'s lambda function.
162
+
163
+
`config/config.php`
164
+
/--code php
165
+
<?php
166
+
declare(strict_types=1);
167
+
168
+
return [
169
+
'migrationsDir' => __DIR__ . '/../migrations',
170
+
'database' => [
171
+
'host' => getenv('DB_HOST'),
172
+
'username' => getenv('DB_NAME'),
173
+
'password' => getenv('DB_USER'),
174
+
'dbname' => getenv('DB_PASS'),
175
+
],
176
+
];
177
+
\--
178
+
179
+
`app/cli.php`
180
+
/--code php
181
+
<?php
182
+
declare(strict_types=1);
183
+
184
+
185
+
// Using the CLI factory default services container
0 commit comments