-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcli-config.php
More file actions
25 lines (17 loc) · 845 Bytes
/
cli-config.php
File metadata and controls
25 lines (17 loc) · 845 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
<?php
require 'vendor/autoload.php';
use Doctrine\DBAL\DriverManager;
use Doctrine\Migrations\Configuration\Connection\ExistingConnection;
use Doctrine\Migrations\Configuration\EntityManager\ExistingEntityManager;
use Doctrine\Migrations\Configuration\Migration\PhpFile;
use Doctrine\Migrations\DependencyFactory;
$config = new PhpFile('migrations.php'); // Or use one of the Doctrine\Migrations\Configuration\Configuration\* loaders
define('APPPATH', dirname(__FILE__) . '/application/');
define('BASEPATH', APPPATH . '/../system/');
define('ENVIRONMENT', 'development');
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__);
$dotenv->safeLoad();
require_once("application/libraries/Doctrine.php");
$doctrine = new Doctrine(false);
$em = $doctrine->em;
return DependencyFactory::fromEntityManager($config, new ExistingEntityManager($em));