27 private $componentRegistrar;
52 private function getPatchFolder($modulePath)
64 private function getModuleNameForNamespace($moduleName)
66 return str_replace(
'_',
'\\', $moduleName);
74 private function getTypeFolder()
76 return ucfirst($this->type);
86 private function getPatchClassesPerModule($moduleName, $modulePath)
89 $patchesPath = $this->getPatchFolder($modulePath);
90 $specificPatchPath = $patchesPath . DIRECTORY_SEPARATOR . $this->getTypeFolder();
91 $patchesMask = $specificPatchPath . DIRECTORY_SEPARATOR .
'*.php';
93 foreach (
Glob::glob($patchesMask) as $patchPath) {
94 $moduleName = $this->getModuleNameForNamespace($moduleName);
95 $patchClasses[] = $moduleName .
'\\Setup\\' .
96 self::SETUP_PATCH_FOLDER .
'\\' .
97 $this->getTypeFolder() .
'\\' .
98 basename($patchPath,
'.php');
101 return $patchClasses;
108 public function read($moduleName)
111 $patches = $this->getPatchClassesPerModule($moduleName, $modulePath);
__construct(ComponentRegistrar $componentRegistrar, $type)
static glob($pattern, $flags=0, $forceFallback=false)