/** * Read list of all available application actions * * @return array */ public function read() { $actionFiles = $this->moduleReader->getActionFiles(); $actions = array(); foreach ($actionFiles as $actionFile) { $action = str_replace('/', '\\', substr($actionFile, 0, -4)); $actions[strtolower($action)] = $action; } return $actions; }
/** * @param \Magento\Framework\Config\CacheInterface $cache * @param ModuleReader $moduleReader * @param string $actionInterface * @param string $cacheKey * @param array $reservedWords */ public function __construct(\Magento\Framework\Config\CacheInterface $cache, ModuleReader $moduleReader, $actionInterface = '\\Magento\\Framework\\App\\ActionInterface', $cacheKey = 'app_action_list', $reservedWords = []) { $this->reservedWords = array_merge($reservedWords, $this->reservedWords); $this->actionInterface = $actionInterface; $data = $cache->load($cacheKey); $this->moduleReader = $moduleReader; if (!$data) { $this->actions = $this->moduleReader->getActionFiles(); $cache->save(serialize($this->actions), $cacheKey); } else { $this->actions = unserialize($data); } }
/** * Read list of all available application actions * * @return array */ public function read() { $actionFiles = $this->moduleReader->getActionFiles(); return $actionFiles; }