Skip to content

Commit

Permalink
Better naming DiConsoleSymfony.php to MigrationContainer.php. (#199)
Browse files Browse the repository at this point in the history
  • Loading branch information
terabytesoftw authored Sep 4, 2023
1 parent 77b83eb commit d786d55
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion bin/DiConsoleSymfony.php → bin/MigrationContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use Yiisoft\Db\Migration\Command\RedoCommand;
use Yiisoft\Db\Migration\Command\UpdateCommand;

final class DiConsoleSymfony
final class MigrationContainer
{
public static function definitions(): array
{
Expand Down
4 changes: 2 additions & 2 deletions bin/migration
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
declare(strict_types=1);

require './vendor/autoload.php';
require 'DiConsoleSymfony.php';
require 'MigrationContainer.php';

use Psr\SimpleCache\CacheInterface;
use Symfony\Component\Console\Application;
use Yiisoft\Db\Connection\ConnectionInterface;
use Yiisoft\Di\Container;
use Yiisoft\Di\ContainerConfig;

$containerConfig = ContainerConfig::create()->withDefinitions(DiConsoleSymfony::definitions());
$containerConfig = ContainerConfig::create()->withDefinitions(MigrationContainer::definitions());
$container = new Container($containerConfig);

if ($container->has(CacheInterface::class) === false) {
Expand Down
8 changes: 4 additions & 4 deletions docs/en/usage-with-symfony-console.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Symfony Console

1. Copy configuration file `./vendor/yiisoft/db-migration/bin/DiConsoleSymfony.php` to `root` folder of your project.
1. Copy configuration file `./vendor/yiisoft/db-migration/bin/MigrationContainer.php` to `root` folder of your project.

```shell
cp ./vendor/yiisoft/db-migration/bin/DiConsoleSymfony.php ./
cp ./vendor/yiisoft/db-migration/bin/MigrationContainer.php ./
```

2. Edit `./DiConsoleSymfony.php` and add definitions for `Psr\SimpleCache\CacheInterface`
2. Edit `./MigrationContainer.php` and add definitions for `Psr\SimpleCache\CacheInterface`
and `Yiisoft\Db\Connection\ConnectionInterface`.

Also, configure `MigrationService::class` and `MigrationInformerInterface::class`.
Expand Down Expand Up @@ -35,7 +35,7 @@ use Yiisoft\Db\Sqlite\Connection;
use Yiisoft\Db\Sqlite\Driver;
use Yiisoft\Definitions\ReferencesArray;

final class Di
final class MigrationContainer
{
public static function definitions(): array
{
Expand Down

0 comments on commit d786d55

Please sign in to comment.