public function getAppCfg($key = null) { if ($this->_appCfg) { return $key ? $this->_appCfg[$key] : $this->_appCfg; } // get from filesystem $configPath = array('sencha-workspace', $this->_name, 'app.json'); if (!($configNode = Site::resolvePath($configPath, true, false))) { return null; } $json = file_get_contents($configNode->RealPath); // patch invalid json $json = Sencha::cleanJson($json); $this->_appCfg = json_decode($json, true); return $key ? $this->_appCfg[$key] : $this->_appCfg; }