1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of EC-CUBE |
5
|
|
|
* |
6
|
|
|
* Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved. |
7
|
|
|
* |
8
|
|
|
* http://www.ec-cube.co.jp/ |
9
|
|
|
* |
10
|
|
|
* For the full copyright and license information, please view the LICENSE |
11
|
|
|
* file that was distributed with this source code. |
12
|
|
|
*/ |
13
|
|
|
|
14
|
|
|
namespace Eccube\Command; |
15
|
|
|
|
16
|
|
|
use Doctrine\Common\Annotations\AnnotationRegistry; |
17
|
|
|
use Eccube\Service\EntityProxyService; |
18
|
|
|
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; |
19
|
|
|
use Symfony\Component\Console\Input\InputInterface; |
20
|
|
|
use Symfony\Component\Console\Output\OutputInterface; |
21
|
|
|
|
22
|
|
|
class GenerateProxyCommand extends ContainerAwareCommand |
23
|
|
|
{ |
24
|
|
|
protected static $defaultName = 'eccube:generate:proxies'; |
25
|
|
|
|
26
|
|
|
/** |
27
|
|
|
* @var EntityProxyService |
28
|
|
|
*/ |
29
|
|
|
private $entityProxyService; |
30
|
|
|
|
31
|
|
|
public function __construct(EntityProxyService $entityProxyService) |
32
|
|
|
{ |
33
|
|
|
parent::__construct(); |
34
|
|
|
$this->entityProxyService = $entityProxyService; |
35
|
|
|
} |
36
|
|
|
|
37
|
|
|
protected function configure() |
38
|
|
|
{ |
39
|
|
|
$this |
40
|
|
|
->setDescription('Generate entity proxies'); |
41
|
|
|
} |
42
|
|
|
|
43
|
|
|
protected function execute(InputInterface $input, OutputInterface $output) |
44
|
|
|
{ |
45
|
|
|
// アノテーションを読み込めるように設定. |
46
|
|
|
AnnotationRegistry::registerAutoloadNamespace('Eccube\Annotation', __DIR__.'/../../../src'); |
|
|
|
|
47
|
|
|
|
48
|
|
|
$container = $this->getContainer(); |
49
|
|
|
$projectDir = $container->getParameter('kernel.project_dir'); |
50
|
|
|
$includeDirs = [$projectDir.'/app/Customize/Entity']; |
51
|
|
|
|
52
|
|
|
$enabledPlugins = $container->getParameter('eccube.plugins.enabled'); |
53
|
|
|
foreach ($enabledPlugins as $code) { |
54
|
|
|
if (file_exists($projectDir.'/app/Plugin/'.$code.'/Entity')) { |
55
|
|
|
$includeDirs[] = $projectDir.'/app/Plugin/'.$code.'/Entity'; |
56
|
|
|
} |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
$this->entityProxyService->generate( |
60
|
|
|
$includeDirs, |
61
|
|
|
[], |
62
|
|
|
$projectDir.'/app/proxy/entity', |
63
|
|
|
$output |
64
|
|
|
); |
65
|
|
|
} |
66
|
|
|
} |
67
|
|
|
|
This method has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.