/** * Retrieves list of classes for given path * * @param string $path path to dir with files * * @return array */ public function getList($path) { $nameList = []; foreach ($this->classesScanner->getList($path) as $className) { try { if (!strpos($path, 'generation')) { // validate all classes except classes in var/generation dir $this->validator->validate($className); } $nameList[] = $className; } catch (\Magento\Framework\Code\ValidationException $exception) { $this->log->add(Log::COMPILATION_ERROR, $className, $exception->getMessage()); } catch (\ReflectionException $e) { $this->log->add(Log::COMPILATION_ERROR, $className, $e->getMessage()); } } $this->log->report(); return $nameList; }
file_put_contents($relationsFile, $serializer->serialize($relations)); // 3. Plugin Definition Compilation $pluginScanner = new Scanner\CompositeScanner(); $pluginScanner->addChild(new Scanner\PluginScanner(), 'di'); $pluginDefinitions = []; $pluginList = $pluginScanner->collectEntities($files); $pluginDefinitionList = new \Magento\Framework\Interception\Definition\Runtime(); foreach ($pluginList as $type => $entityList) { foreach ($entityList as $entity) { $pluginDefinitions[ltrim($entity, '\\')] = $pluginDefinitionList->getMethodList($entity); } } $output = $serializer->serialize($pluginDefinitions); if (!file_exists(dirname($pluginDefFile))) { mkdir(dirname($pluginDefFile), 0777, true); } file_put_contents($pluginDefFile, $output); //Reporter $log->report(); if ($log->hasError()) { exit(1); } echo 'On *nix systems, verify the Magento application has permissions to modify files created by the compiler' . ' in the "var" directory. For instance, if you run the Magento application using Apache,' . ' the owner of the files in the "var" directory should be the Apache user (example command:' . ' "chown -R www-data:www-data <MAGENTO_ROOT>/var" where MAGENTO_ROOT is the Magento root directory).' . "\n"; } catch (Zend_Console_Getopt_Exception $e) { echo $e->getUsageMessage(); echo 'Please, use quotes(") for wrapping strings.' . "\n"; exit(1); } catch (Exception $e) { fwrite(STDERR, "Compiler failed with exception: " . $e->getMessage()); throw $e; }