/** * Carga el archivo referente al módulo y acción solicitado * @author Julian Lasso <*****@*****.**> * @version 1.0.0 * @throws PDOException */ protected function loadModuleAndAction() { $actions = strtr(self::ACTIONS, array('%path%' => $this->config->getPath(), '%module%' => $this->module)); $action = strtr(self::ACTION, array('%path%' => $this->config->getPath(), '%module%' => $this->module, '%action%' => $this->action)); if (file_exists($action) === true) { require_once $action; $this->actionOractions = true; } else { if (file_exists($actions)) { require_once $actions; $this->actionOractions = false; } else { throw new PDOException('El módulo y acción solicitada, no existe'); } } }
/** * Carga y ejecuta los plugins configurados en el sistema * @author Julian Lasso <*****@*****.**> * @version 1.0.0 * @throws PDOException */ protected function loadAndExecutePlugins() { if (is_array($this->config->getPlugins()) === true and count($this->config->getPlugins()) > 0) { foreach ($this->config->getPlugins() as $pluginName) { $path = $this->config->getPath() . 'libs/plugins/' . $pluginName; if (is_dir($path) === false) { throw new PDOException('El plugin ' . $pluginName . ' no existe'); } $file = $path . '/plugin.class.php'; if (is_file($file) === false) { throw new PDOException('El archivo de inicio (plugin.php) no existe'); } require_once $file; $pluginSpace = '\\' . $pluginName . '\\plugin'; $plugin = new $pluginSpace($this->config); } } }
/** * Obtiene la dirección completa del archivo de la vista a cargar * @author Julian Lasso <*****@*****.**> * @version 1.0.0 * @return string */ private function getFileView() { return $this->config->getPath() . 'view/' . $this->module . '/' . $this->view . '.' . $this->format . '.php'; }