public function getKeys($routingPath = '') { $parser = new YAMLParser($this->logger); $parser->setFilePath(__SITE_PATH . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . $routingPath); $retval = array(); $config = $parser->loadConfig(); if (is_array($config)) { $retval = $this->parseKeys($config); } $subdirectories = getDirectoryList(); foreach ($subdirectories as $folder) { $parser->setFilePath($folder . '/config/routing.yml'); $config = $parser->loadConfig(); if (is_array($config)) { $retval = array_merge($retval, $this->parseKeys($config)); } } return $retval; }
private function loadConfigurations(YAMLParser $parser) { $subdirectories = $this->getDirectoryList(); $serviceBootstraps = array(); //first load the system service configurations $parser->setFilePath(__SITE_PATH . '/app/config/services.yml'); $config = $parser->loadConfig(); if (is_array($config)) { $this->config[] = $config; } //now load all the component configurations foreach ($subdirectories as $folder) { $parser->setFilePath($folder . '/config/services.yml'); $config = $parser->loadConfig(); if (is_array($config)) { $this->config[] = $config; } } }
private function buildDatasourceInstance($sourceName, Logger $logger) { $parser = new YAMLParser($logger); $ymlFilePath = __SITE_PATH . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'credentials.yml'; $parser->setFilePath($ymlFilePath); $dsConfig = $parser->loadConfig(); $sourceName = trim($sourceName, "<br>"); $datasourceClass = $dsConfig[$sourceName]['class']; $datasource = new $datasourceClass($logger); unset($parser); return $datasource; }
private function iterateComponentConfigurations(Logger $logger, $filename, $node, $uriPattern) { $retval = array(); $parser = new YAMLParser($logger); $parser->setFilePath(__SITE_PATH . '/app/config/' . $filename . '.yml'); if (strlen($uriPattern) == 0) { $retval[] = $parser->findNodeByURI('all', $node); //just in case it's a usercommand (not component) load any config for it here also $retval[] = $parser->findNodeByURI(__YML_KEY, $node); } else { //just in case it's a usercommand (not component) load any config for it here also $retval[] = $parser->findNodeByURIPattern($uriPattern, $node); } $subdirectories = $this->getDirectoryList(); foreach ($subdirectories as $folder) { $parser->setFilePath($folder . '/config/' . $filename . '.yml'); $config = $parser->findNodeByURI(__YML_KEY, $node); if (is_array($config)) { $retval[] = $config; } } $this->configs = $retval; }
private function loadNodeConfig() { $loader = new YAMLParser($this->logger); $loader->setFilePath(__SITE_PATH . '/app/config/firewall.yml'); $config = $loader->loadConfig(); unset($loader); $parser = new URISectionComparator(); $key = $parser->findPattern($config, __URI); unset($parser); if (empty($key)) { return; } $this->node = $config[$key]; }
public function getFirewallKey(YAMLParser $parser) { $parser->setFilePath(__SITE_PATH . '/app/config/firewall.yml'); $config = $parser->loadConfig(); $comparator = new URISectionComparator(); $key = $comparator->findPattern($config, __URI); if ($key === false) { return null; } if (array_key_exists('authentication', $config[$key])) { return $config[$key]['authentication']; } return null; }
private function loadEncodingConfiguration() { $loader = new YAMLParser($this->logger); $loader->setFilePath(__NAMESPACE . DIRECTORY_SEPARATOR . __COMPONENT_FOLDER . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'encodings.yml'); $config = $loader->loadConfig(); unset($loader); return $config; }