/** * Returns the external path of the application. For example http://www.xxx.com/base_path * * @return string */ public function getExternalPath() { if (true === $this->_config->getConfigData('development_environment')) { $extPath = EXT_ROOT . $this->_config->getConfigData('base_path_dev'); } else { $extPath = EXT_ROOT . $this->_config->getConfigData('base_path'); } return $extPath; }
/** * Creates a controller * * @param string $controllerName The controller's name (used to load correct model) * @param \pff\App $app * @param string $action Action to perform * @param array $params An array with parameters passed to the action * @internal param \pff\Config $cfg App configuration */ public function __construct($controllerName, App $app, $action = 'index', $params = array()) { $this->_controllerName = $controllerName; $this->_action = $action; $this->_app = $app; $this->_config = $app->getConfig(); //Even if we have an \pff\App reference we keep this for legacy reasons. $this->_params = $params; $this->_moduleManager = $this->_app->getModuleManager(); $this->_helperManager = $this->_app->getHelperManager(); $this->_layout = null; $this->_view = array(); if ($this->_config->getConfigData('orm')) { $this->initORM(); } else { $this->_em = null; } // Set default output to HTML $this->_output = new HTMLOut(); $this->initController(); }
public function testLoadConfigFailsWithInexistantFile() { $this->setExpectedException('\\pff\\Exception\\ConfigException'); $this->object->loadConfig('nonono', 'config'); }