Получает список настроек из yaml файла.

@param string $pathToYaml

@return array
166937
protected static function getOptionsFromYaml($pathToYaml)
    {
        $raw = (new SymfonyYaml)->parseFromFile($pathToYaml) ?: [];

        return self::setReplacesToArray($raw, [
            '@currFile' => $pathToYaml,
            '@currDir' => pathinfo($pathToYaml, PATHINFO_DIRNAME),
        ]);
    }
365633
public function parse($payload)
    {
        if ($payload) {
            try {
                $flags = (defined('Symfony\Component\Yaml\Yaml::PARSE_DATETIME')) ? (SFYaml::PARSE_EXCEPTION_ON_INVALID_TYPE | SFYaml::PARSE_DATETIME) : true;
                return SFYaml::parse(trim(preg_replace('/\t+/', '', $payload)), $flags);
            } catch (\Exception $ex) {
                throw new ParserException('Failed To Parse YAML');
            }
        }

        return [];
    }
699694
protected function loadSymfonyRoutes($path)
    {
        if ($this->routes === null) {
            $loader = new YamlFileLoader(new FileLocator(array(dirname($path))));
            $loader->setDefaults(array('_module' => $this->getName()));

            $routesCollection = $loader->load(pathinfo($path, PATHINFO_FILENAME) . '.' . pathinfo($path, PATHINFO_EXTENSION));
            $this->routes     = $routesCollection;
        }

        return $this->routes;
    }
1278746
public function getMappingFiles($path)
    {
        $files = $this->files->glob($path.'/*_*.php');

        if ($files === false) {
            return [];
        }

        $files = array_map(function ($file) {
            return str_replace('.php', '', basename($file));
        }, $files);

        return $files;
    }
955180
public function toYaml()
    {
        return Yaml::dump(json_decode($this->toJson(0)), 10, 2, Yaml::DUMP_OBJECT_AS_MAP ^ Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE);
    }
198064
public function getItems()
  {
    $namespaces = $this->xml->getDocNamespaces();
    foreach($namespaces as $namespace => $url)
    {
      $this->xml->registerXPathNamespace($namespace, $url);
    }

    foreach ($this->xml->xpath($this->itemXpath) as $item)
    {
      $this->items[] = new Item
      (
        $this->itemtitleXpath ? (string) $item->xpath($this->itemtitleXpath)[0] : NULL,
        $this->itemtorrenturlXpath ? (string) $item->xpath($this->itemtorrenturlXpath)[0] : NULL,
        $this->itemmagnetXpath ? (string) $item->xpath($this->itemmagnetXpath)[0] : NULL
      );
    }

    return $this->items;
  }
141679
public function getAppRoutes(string $module = null): array
    {
        if ($module === null) {
            $module = Yii::$app;
        } else {
            $module = Yii::$app->getModule($module);
        }

        $key = [__METHOD__, $module->getUniqueId()];
        $result = (($this->cache !== null) ? $this->cache->get($key) : false);

        if ($result === false) {
            $result = [];
            $this->getRouteRecursive($module, $result);
            if ($this->cache !== null) {
                $this->cache->set($key, $result, $this->cacheDuration, new TagDependency([
                    'tags' => self::CACHE_TAG,
                ]));
            }
        }

        return $result;
    }
471838
private function getAllClassesFromPhpFiles($pathToPhpFiles)
    {
        return $this->getFlatArray(array_map(function ($pathToPhpFile) {
            return $this->getAllClassesFromPhpFile($pathToPhpFile);
        }, $pathToPhpFiles));
    }
292400
protected function loadConfiguration($path)
    {
        try {
            $configuration = Yaml::parse(file_get_contents($path));
            if (!is_array($configuration)) {
                throw new ParseException('Invalid content.', 1);
            }

            return $configuration;
        } catch (ParseException $e) {
            $this->output->writeln(sprintf('<error>Unable to parse the YAML string: %s</error>', $e->getMessage()));

            return [];
        }
    }
953338
public function getSamlSettings() {
        $settings = new Maestrano_Saml_Settings();

        // Configure SAML
        $settings->idpPublicCertificate = Maestrano::with($this->_preset)->param('sso.x509_certificate');
        $settings->spIssuer = Maestrano::with($this->_preset)->param('api.id');
        // TODO: default value?
        // $settings->requestedNameIdFormat = Maestrano::with($this->_preset)->param('sso.name_id_format');
        $settings->idpSingleSignOnUrl = $this->getIdpUrl();
        $settings->spReturnUrl = $this->getConsumeUrl();

        return $settings;
    }
1022250
private static function getAllYamls(string $directory): \Generator
    {
        /** @var \SplFileInfo $file */
        foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($directory)) as $file) {
            if ($file->isFile() && $file->getExtension() === 'yml') {
                $fileName = $file->getPathname();
                yield $fileName => Yaml::parse(file_get_contents($fileName));
            }
        }
    }
1169217
public function getPaths(): array
    {
        $paths = [];
        foreach ($this->finder->getNamespaces() as $namespace) {
            $name = ($namespace !== FileViewFinder::DEFAULT_NAMESPACE) ? $namespace : null;
            foreach ($this->finder->getPaths($namespace) as $path) {
                $paths[] = new TemplatePath($path, $name);
            }
        }

        return $paths;
    }
298988
protected function obtainAppSystemList(): array
    {
        $appSystemList = parent::obtainAppSystemList();
        
        //Remove not used systems
        unset(
            $appSystemList['request'],
            $appSystemList['session'],
            $appSystemList['errors'],
            $appSystemList['ctrlRouterLink']
        );
        
        $appSystemNS = '\BFW\Install\Core\AppSystems\\';
        
        //Change ModuleList class
        $appSystemList['moduleList'] = $appSystemNS.'ModuleList';
        
        //Add new system : module installation system
        $appSystemList['moduleInstall'] = $appSystemNS.'ModuleInstall';
        
        return $appSystemList;
    }
817303
public function toYaml($data = null)
	{
		if ($data == null)
		{
			$data = $this->data;
		}

		if ( ! class_exists('Symfony\Component\Yaml\Yaml'))
		{
			// @codeCoverageIgnoreStart
			throw new \RuntimeException('You need to install the "symfony/yaml" composer package to use Format::toYaml()');
			// @codeCoverageIgnoreEnd
		}

		$parser = new \Symfony\Component\Yaml\Yaml();
		return $parser::dump($data);
	}
522935
private function parseYamlOptions(array $opts = [])
    {
        if (is_file($this->runner->pwd.'/.phillip.yml')) {
            $options = Yaml::parseFile($this->runner->pwd.'/.phillip.yml');

            return array_merge($opts, $options);
        }

        return $opts;
    }
914483
protected function getApiHeaders(): array
    {
        $headers = [
            'Accept' => "application/vnd.KATSANA.{$this->getVersion()}+json",
            'Time-Zone' => $this->requestHeaderTimezoneCode ?? 'UTC',
        ];

        if (! \is_null($accessToken = $this->client->getAccessToken())) {
            $headers['Authorization'] = "Bearer {$accessToken}";
        }

        return $headers;
    }
1239846
public function toArray($complete = true)
    {
        if ($complete) {
            $result = [
                'id' => $this->uuid,
                'nodeType' => $this->nodeType,
                'internal' => $this->internal,
                'shadowLocales' => $this->getShadowLocales(),
                'contentLocales' => $this->getContentLocales(),
                'shadowOn' => $this->getIsShadow(),
                'shadowBaseLanguage' => $this->getShadowBaseLanguage() ?: false,
                'template' => $this->getKey(),
                'hasSub' => $this->hasChildren,
                'creator' => $this->creator,
                'changer' => $this->changer,
                'created' => $this->created,
                'changed' => $this->changed,
            ];

            if (null !== $this->type) {
                $result['type'] = $this->getType()->toArray();
            }

            if (self::NODE_TYPE_INTERNAL_LINK === $this->nodeType) {
                $result['linked'] = 'internal';
            } elseif (self::NODE_TYPE_EXTERNAL_LINK === $this->nodeType) {
                $result['linked'] = 'external';
            }

            $this->appendProperties($this->getProperties(), $result);

            return $result;
        } else {
            $result = [
                'id' => $this->uuid,
                'path' => $this->path,
                'nodeType' => $this->nodeType,
                'internal' => $this->internal,
                'getContentLocales' => $this->getContentLocales(),
                'hasSub' => $this->hasChildren,
                'title' => $this->getProperty('title')->toArray(),
            ];

            if (null !== $this->type) {
                $result['type'] = $this->getType()->toArray();
            }

            if (self::NODE_TYPE_INTERNAL_LINK === $this->nodeType) {
                $result['linked'] = 'internal';
            } elseif (self::NODE_TYPE_EXTERNAL_LINK === $this->nodeType) {
                $result['linked'] = 'external';
            }

            return $result;
        }
    }