コード例 #1
0
ファイル: App.php プロジェクト: stonedz/pff2
 /**
  * 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;
 }
コード例 #2
0
ファイル: AController.php プロジェクト: stonedz/pff2
 /**
  * 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();
 }
コード例 #3
0
ファイル: ConfigTest.php プロジェクト: stonedz/pff2
 public function testGetConfigReturnsArrayWithNoParamaters()
 {
     //$this->assertTrue(is_array($this->object->getConfig()));
     $this->assertInternalType('array', $this->object->getConfigData());
 }