From 70eadd487e7a45ffefa8bff39f2317c2367efbcd Mon Sep 17 00:00:00 2001 From: Awilum Date: Sat, 10 Aug 2019 22:05:00 +0300 Subject: [PATCH] Flextype Core: Add ability to work with different types of content #212 #186 --- flextype/core/Entries.php | 4 ++-- flextype/parsers/Parser.php | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/flextype/core/Entries.php b/flextype/core/Entries.php index 741cf380..ed096091 100755 --- a/flextype/core/Entries.php +++ b/flextype/core/Entries.php @@ -376,7 +376,7 @@ class Entries $entry_file = $this->_file_location($id); if (Filesystem::has($entry_file)) { - return Filesystem::write($entry_file, JsonParser::encode($data)); + return Filesystem::write($entry_file, Parser::encode($data)); } return false; @@ -403,7 +403,7 @@ class Entries // Check if new entry file exists if (! Filesystem::has($entry_file)) { - return Filesystem::write($entry_file, JsonParser::encode($data)); + return Filesystem::write($entry_file, Parser::encode($data)); } return false; diff --git a/flextype/parsers/Parser.php b/flextype/parsers/Parser.php index 824d7a81..79f1b9a7 100644 --- a/flextype/parsers/Parser.php +++ b/flextype/parsers/Parser.php @@ -18,6 +18,12 @@ class Parser ], 'yaml' => [ 'name' => 'yaml', 'ext' => 'yaml', + ], 'md' => [ + 'name' => 'md', + 'ext' => 'md', + ], 'toml' => [ + 'name' => 'toml', + 'ext' => 'toml', ], ];