-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcli-config.php
More file actions
37 lines (25 loc) · 905 Bytes
/
Copy pathcli-config.php
File metadata and controls
37 lines (25 loc) · 905 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
31
32
33
34
35
36
37
<?php
require_once __DIR__.'/vendor/autoload.php';
use Doctrine\ORM\Tools\Console\ConsoleRunner;
use Doctrine\ORM\Tools\Setup;
use Doctrine\ORM\EntityManager;
$smModuleArg = false;
foreach ($_SERVER['argv'] as $key => $val) {
if (preg_match('/--sm-module/', $val)) {
$smModuleArg = $val;
unset( $_SERVER['argv'][$key] );
$_SERVER['argc'] = $_SERVER['argc']-1;
}
}
if ($smModuleArg) {
$paths = array(__DIR__ . '/src/' . explode(':', $smModuleArg)[1]);
} else {
$paths = array(__DIR__ . '/src/');
}
print_r($paths);
$isDevMode = true;
$dbParams = include(__DIR__ . '/src/config.php');
$config = Setup::createAnnotationMetadataConfiguration($paths, $isDevMode);
$entityManager = EntityManager::create($dbParams['database'], $config);
return ConsoleRunner::createHelperSet($entityManager);
//php vendor/bin/doctrine orm:schema-tool:update --force --dump-sql