-
Notifications
You must be signed in to change notification settings - Fork 0
/
d
40 lines (29 loc) · 1.03 KB
/
d
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
38
39
#!/usr/bin/env php
<?php declare(strict_types=1);
use App\Console\Kernel as ConsoleKernel;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Tools\Console\ConsoleRunner;
use Doctrine\ORM\Tools\Console\EntityManagerProvider\SingleManagerProvider;
use Illuminate\Contracts\Container\BindingResolutionException;
use Illuminate\Contracts\Foundation\Application;
require_once 'vendor/autoload.php';
/** @var $app Application */
$app = require_once __DIR__ . DIRECTORY_SEPARATOR . '/bootstrap/app.php';
try {
/** @var $kernel ConsoleKernel */
$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);
$kernel->bootstrap();
/** @var $entityManager EntityManagerInterface */
$entityManager = $app->make(EntityManagerInterface::class);
} catch (BindingResolutionException $exception) {
echo $exception->getMessage();
exit;
}
try {
ConsoleRunner::run(
new SingleManagerProvider($entityManager)
);
} catch (Exception $exception) {
echo "Exception!";
echo $exception->getMessage();
}