17 use Symfony\Component\Console\Input\ArgvInput;
18 use Zend\ServiceManager\ServiceManager;
28 private $serviceManager;
38 private $filesystemDriver;
43 private $generationDirectoryAccess;
51 ServiceManager $serviceManager,
53 File $filesystemDriver
55 $this->serviceManager = $serviceManager;
56 $this->input = $input;
57 $this->filesystemDriver = $filesystemDriver;
68 $compilationCommands = $this->getCompilerInvalidationCommands();
69 $cmdName = $this->input->getFirstArgument();
70 $isHelpOption = $this->input->hasParameterOption(
'--help') || $this->input->hasParameterOption(
'-h');
71 if (!in_array($cmdName, $compilationCommands) || $isHelpOption) {
75 if (!$this->getGenerationDirectoryAccess()->check()) {
89 foreach ($compileDirList as $compileDir) {
90 if ($this->filesystemDriver->isExists($compileDir)) {
91 $this->filesystemDriver->deleteDirectory($compileDir);
101 private function getCompilerInvalidationCommands()
116 private function getGenerationDirectoryAccess()
118 if (
null === $this->generationDirectoryAccess) {
119 $this->generationDirectoryAccess =
new GenerationDirectoryAccess($this->serviceManager);
122 return $this->generationDirectoryAccess;
__construct(ServiceManager $serviceManager, ArgvInput $input, File $filesystemDriver)
const INIT_PARAM_FILESYSTEM_DIR_PATHS
handleCompilerEnvironment()