/** * index * * @return RendererInterface */ public function index() { $instanceConfig = InstanceConfig::instance(); $instanceId = $instanceConfig->getInstanceId(); $configName = $this->getConfigKeyString($instanceId); $includePath = $this->configManager->getVal($configName); return XePresenter::make('show', ['includePath' => $includePath]); }
/** * getSiteConfigValue * * @param string $key value key * @param string|null $siteKey site key * * @return string */ public function getSiteConfigValue($key, $siteKey = null) { if (is_null($siteKey)) { $siteKey = $this->currentSite->siteKey; } return $this->config->getVal(sprintf("site.%s.%s", $siteKey, $key)); }
public function testGetValReturnsValueWhenExists() { list($repo, $validator) = $this->getMocks(); $mockConfig = m::mock('Xpressengine\\Config\\ConfigEntity'); $mockConfig->name = 'board.notice'; $mockConfig->shouldReceive('get')->with('listCount', null)->andReturn(10); $ancestor = m::mock('Xpressengine\\Config\\ConfigEntity'); $ancestor->name = 'board'; $mockConfig->shouldReceive('setParent')->once()->with($ancestor)->andReturnNull(); $repo->shouldReceive('find')->once()->with('default', 'board.notice')->andReturn($mockConfig); $repo->shouldReceive('fetchParent')->with('default', 'board.notice')->andReturn([$ancestor]); $instance = new ConfigManager($repo, $validator); $val = $instance->getVal('board.notice.listCount'); $this->assertEquals(10, $val); }
/** * 플러그인들의 상태정보를 조회한다. * * @return mixed */ protected function getPluginsStatus() { $configs = $this->config->getVal($this->configKey, []); return $configs; }