Skip to content

Commit 66fa671

Browse files
committed
✨ added development cli link for doctrine (needs the migrations to auto run when used as a plugin)
1 parent 80f075e commit 66fa671

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

cli-config.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
use Doctrine\ORM\EntityManagerInterface;
4+
use Doctrine\ORM\Tools\Console\ConsoleRunner;
5+
use Symfony\Component\Console\Input\ArrayInput;
6+
use Tapestry\Console\DefaultInputDefinition;
7+
use Tapestry\Entities\Configuration;
8+
use Tapestry\Tapestry;
9+
10+
// replace with file to your own project bootstrap
11+
require_once 'vendor/autoload.php';
12+
13+
$definitions = new DefaultInputDefinition();
14+
$tapestry = new Tapestry(new ArrayInput([
15+
'--site-dir' => __DIR__ . DIRECTORY_SEPARATOR . 'mock_project',
16+
'--env' => 'cli-config'
17+
], $definitions));
18+
19+
$tapestry->register(\TapestryCloud\Database\ServiceProvider::class);
20+
21+
/** @var Configuration $configuration */
22+
$configuration = $tapestry->getContainer()->get(Configuration::class);
23+
$configuration->merge(include __DIR__ . '/tests/mock_project/config.php');
24+
25+
return ConsoleRunner::createHelperSet($tapestry->getContainer()->get(EntityManagerInterface::class));

0 commit comments

Comments
 (0)