1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-13 08:34:19 +02:00

Using clean JSON instead of YAML #123 #117

This commit is contained in:
Awilum
2019-04-24 10:59:40 +03:00
parent 68a049fadd
commit 5a507cfae2
5 changed files with 65 additions and 125 deletions

View File

@@ -103,8 +103,8 @@ $flextype['registry'] = function($container) {
$flextype['registry']->set('settings', []);
// Set settings files path
$default_settings_file_path = PATH['config']['default'] . '/settings.yaml';
$site_settings_file_path = PATH['config']['site'] . '/settings.yaml';
$default_settings_file_path = PATH['config']['default'] . '/settings.json';
$site_settings_file_path = PATH['config']['site'] . '/settings.json';
// Set settings if Flextype settings and Site settings config files exist
if (Filesystem::has($default_settings_file_path) && Filesystem::has($site_settings_file_path)) {
@@ -112,13 +112,13 @@ if (Filesystem::has($default_settings_file_path) && Filesystem::has($site_settin
if (($content = Filesystem::read($default_settings_file_path)) === false) {
throw new \RuntimeException('Load file: ' . $default_settings_file_path . ' - failed!');
} else {
$default_settings = YamlParser::decode($content);
$default_settings = JsonParser::decode($content);
}
if (($content = Filesystem::read($site_settings_file_path)) === false) {
throw new \RuntimeException('Load file: ' . $site_settings_file_path . ' - failed!');
} else {
$site_settings = YamlParser::decode($content);
$site_settings = JsonParser::decode($content);
}
// Merge settings

View File

@@ -0,0 +1,60 @@
{
"title": "Flextype",
"description": "Build fast, flexible, easier to manage websites with Flextype.",
"keywords": "flextype, php, cms, flat-file cms, flat cms, flatfile cms, html",
"robots": "index, follow",
"author": {
"email": "",
"name": ""
},
"timezone": "UTC",
"charset": "UTF-8",
"date_format": "F d Y H:i:s",
"theme": "default",
"locale": "en_US",
"entries": {
"main": "home",
"media": {
"upload_images_quality": 70,
"upload_images_width": 1600,
"upload_images_height": 0,
"accept_file_types": "gif, jpg, jpeg, png, ico, zip, tgz, txt, md, doc, docx, pdf, epub, xls, xlsx, ppt, pptx, mp3, ogg, wav, m4a, mp4, m4v, ogv, wmv, avi, webm, svg"
},
"error404": {
"title": "Error 404",
"description": "We're sorry but the page you are looking for doesn't appear to exist!",
"content": "We're sorry but the page you are looking for doesn't appear to exist!",
"template": "default"
}
},
"errors": {
"display": true
},
"cache": {
"enabled": false,
"prefix": "flextype",
"driver": "auto",
"lifetime": 604800,
"memcache": {
"server": "localhost",
"port": 11211
},
"memcached": {
"server": "localhost",
"port": 11211
},
"redis": {
"socket": false,
"password": false,
"server": "localhost",
"port": 6379
},
"sqlite3": {
"database": "flextype",
"table": "flextype"
}
},
"admin_panel": {
"theme": "light"
}
}

View File

@@ -1,121 +0,0 @@
# The title of the website
title: "Flextype"
# The description of the website
description: "Build fast, flexible, easier to manage websites with Flextype."
# The keywords of the website
keywords: "flextype, php, cms, flat-file cms, flat cms, flatfile cms, html"
# The robots of the website
robots: "index, follow"
# The name and email address of the website author
author:
email: ""
name: ""
# Set the timezone to be used on the website.
# For a list of valid timezone settings, see:
# http://php.net/manual/en/timezones.php
timezone: UTC
# Charset
#
# Set internal character encoding.
#
# Currently the following names are supported:
# http://php.net/manual/ru/function.mb-regex-encoding.php#121645
charset: UTF-8
# Valid date format
# see: http://php.net/manual/ru/function.date.php
date_format: "F d Y H:i:s"
# The theme to use.
#
# Don't edit the provided theme templates directly, because they get updated
# in next releases. If you wish to modify a default theme, copy its folder, and
# change the name here accordingly.
theme: default
# The locale that'll be used by the Flextype.
locale: "en_US"
# The entries settings
# Define the file types (extensions to be exact) that are acceptable for upload.
entries:
main: home
media:
upload_images_quality: 70
upload_images_width: 1600
upload_images_height: 0
accept_file_types: "gif, jpg, jpeg, png, ico, zip, tgz, txt, md, doc, docx, pdf, epub, xls, xlsx, ppt, pptx, mp3, ogg, wav, m4a, mp4, m4v, ogv, wmv, avi, webm, svg"
error404:
title: "Error 404"
description: "We're sorry but the page you are looking for doesn't appear to exist!"
content: "We're sorry but the page you are looking for doesn't appear to exist!"
template: "default"
# Display errors
#
# - display: Display errors or not.
errors:
display: true
# Cache
#
# - enabled: Set to true to enable caching
#
# - prefix: Cache prefix string (prevents cache conflicts)
#
# - driver: Available drivers: auto (will get one from installed cache drivers), apcu,
# apc, array, wincache, xcache, memcache, memcached, redis, file.
#
# - lifetime: Lifetime of cached data in seconds
#
# - redis.socket: Path to redis unix socket (e.g. /var/run/redis/redis.sock),
# false = use server and port to connect
#
# - redis.password Redis password
#
# - redis.server Redis server
#
# - redis.port Redis port
#
# - memcache.server Memcache server
#
# - memcache.port Memcache port
#
# - memcached.server Memcached server
#
# - memcached.port Memcached port
#
# - sqlite3.database SQLite3 Database
#
# - sqlite3.table SQLite3 Table
cache:
enabled: false
prefix: flextype
driver: auto
lifetime: 604800
memcache:
server: 'localhost'
port: 11211
memcached:
server: 'localhost'
port: 11211
redis:
socket: false
password: false
server: 'localhost'
port: 6379
sqlite3:
database: flextype
table: flextype
# Admin Panel
#
# - themes: Theme (dark, light)
admin_panel:
theme: light

View File

@@ -0,0 +1 @@
{}