forked from wmde/fundraising-application
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli-config.php
More file actions
executable file
·30 lines (23 loc) · 1010 Bytes
/
Copy pathcli-config.php
File metadata and controls
executable file
·30 lines (23 loc) · 1010 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
require_once __DIR__ . '/vendor/autoload.php';
use Doctrine\ORM\Tools\Console\ConsoleRunner;
use FileFetcher\SimpleFileFetcher;
use WMDE\Fundraising\Frontend\Factories\FunFunFactory;
use WMDE\Fundraising\Frontend\Infrastructure\EnvironmentBootstrapper;
use WMDE\Fundraising\Frontend\Infrastructure\ConfigReader;
/**
* This is a CLI configuration file for Doctrine
* https://www.doctrine-project.org/projects/doctrine-orm/en/2.7/reference/tools.html
*/
$dotenv = Dotenv\Dotenv::createImmutable( __DIR__ );
$dotenv->load();
$bootstrapper = new EnvironmentBootstrapper( $_ENV['APP_ENV'] ?? 'dev' );
$configReader = new ConfigReader(
new SimpleFileFetcher(),
...$bootstrapper->getConfigurationPathsForEnvironment( __DIR__ . '/app/config' )
);
$config = $configReader->getConfig();
$factory = new FunFunFactory( $config );
$bootstrapper->getEnvironmentSetupInstance()
->setEnvironmentDependentInstances( $factory, $config );
return ConsoleRunner::createHelperSet( $factory->getEntityManager() );