|
@@ -3,25 +3,36 @@
|
3
|
3
|
namespace Logipro\Phoenix\DoctrineMigrations;
|
4
|
4
|
|
5
|
5
|
use Doctrine\DBAL\Schema\Schema;
|
6
|
|
-use Symfony\Component\Finder\Finder;
|
7
|
6
|
use Doctrine\Migrations\AbstractMigration;
|
8
|
7
|
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
9
|
|
-use Liip\ImagineBundle\Imagine\Cache\CacheManager;
|
10
|
8
|
use Symfony\Component\DependencyInjection\ContainerInterface;
|
|
9
|
+use Symfony\Component\Console\Input\ArrayInput;
|
|
10
|
+use Symfony\Component\Console\Output\BufferedOutput;
|
|
11
|
+use Symfony\Bundle\FrameworkBundle\Console\Application;
|
11
|
12
|
|
12
|
13
|
final class Version20191209165250 extends AbstractMigration
|
13
|
14
|
implements ContainerAwareInterface
|
14
|
15
|
{
|
15
|
|
- private $cacheManager;
|
|
16
|
+ private $kernel;
|
16
|
17
|
|
17
|
18
|
public function setContainer(ContainerInterface $container = null)
|
18
|
19
|
{
|
19
|
|
- $this->cacheManager = $container->get('liip_imagine.cache.manager');
|
|
20
|
+ $this->kernel = $container->get('kernel');
|
20
|
21
|
}
|
21
|
22
|
|
22
|
23
|
public function up(Schema $schema): void
|
23
|
24
|
{
|
24
|
|
- $this->cacheManager->remove();
|
|
25
|
+ $application = new Application($this->kernel);
|
|
26
|
+ $application->setAutoExit(false);
|
|
27
|
+
|
|
28
|
+ $input = new ArrayInput([
|
|
29
|
+ 'command' => 'phoenix:thumb:clear'
|
|
30
|
+ ]);
|
|
31
|
+
|
|
32
|
+ $output = new BufferedOutput();
|
|
33
|
+ $application->run($input, $output);
|
|
34
|
+
|
|
35
|
+ $this->write($output->fetch());
|
25
|
36
|
}
|
26
|
37
|
|
27
|
38
|
public function down(Schema $schema): void
|