From a4dd0c40edc29fdee72d11d63145f073949f54c5 Mon Sep 17 00:00:00 2001 From: Ilya Bakhlin Date: Wed, 29 Dec 2021 21:56:43 +0100 Subject: [PATCH] Removing all the caching and external dependencies. --- chandler/procedural/yaml.php | 38 +++++------------------------------- 1 file changed, 5 insertions(+), 33 deletions(-) diff --git a/chandler/procedural/yaml.php b/chandler/procedural/yaml.php index 47263e4..2ab8cca 100644 --- a/chandler/procedural/yaml.php +++ b/chandler/procedural/yaml.php @@ -1,39 +1,11 @@ - * @param string $filename Path to file - * @return array Array + * @param string $filePath + * + * @return array */ -function chandler_parse_yaml(string $filename): array +function chandler_parse_yaml(string $filePath): array { - $cache = $GLOBALS["ymlCa"]; - $id = sha1($filename); - - $result = $cache->load($id); - if(!$result) { - if(function_exists("yaml_parse_file")) - $result = yaml_parse_file($filename); - else - $result = Yaml::parseFile($filename); - - $cache->save($id, $result, [ - Cache::EXPIRE => "1 day", - Cache::SLIDING => TRUE, - Cache::FILES => $filename, - ]); - } - - return $result; + return yaml_parse_file($filePath); }