From 3ef859856c34f9db91ec039b86f6989a3911dcb8 Mon Sep 17 00:00:00 2001 From: Awilum Date: Wed, 14 Mar 2018 19:57:53 +0300 Subject: [PATCH] Code cleanup and refactoring #5 --- .htaccess | 5 +++-- CHANGELOG.md | 2 +- index.php | 10 +++++----- rawilum/Cache.php | 8 ++++---- rawilum/Config.php | 8 ++++---- rawilum/Events.php | 9 +++++---- rawilum/Filters.php | 9 ++++----- rawilum/I18n.php | 8 ++++---- rawilum/Pages.php | 8 ++++---- rawilum/Plugins.php | 9 +++++---- rawilum/Rawilum.php | 22 ++++++++++++++++------ rawilum/RawilumTrait.php | 13 +++++++++++-- rawilum/Shortcodes.php | 8 ++++---- rawilum/Themes.php | 8 ++++---- rawilum/boot/defines.php | 5 +++-- 15 files changed, 77 insertions(+), 55 deletions(-) diff --git a/.htaccess b/.htaccess index 3e931ddc..932a6272 100755 --- a/.htaccess +++ b/.htaccess @@ -1,7 +1,8 @@ ## -# This file is part of the Rawilum. +# @package Rawilum # -# (c) Romanenko Sergey / Awilum +# @author Sergey Romanenko +# @link http://rawilum.org # # For the full copyright and license information, please view the LICENSE # file that was distributed with this source code. diff --git a/CHANGELOG.md b/CHANGELOG.md index c103a2bd..c310732d 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,2 +1,2 @@ -# Rawilum 1.0.0, 2018-XX-XX +# Rawilum 0.1.0, 2018-XX-XX * Initial Release diff --git a/index.php b/index.php index c2a02719..001ef050 100755 --- a/index.php +++ b/index.php @@ -1,15 +1,15 @@ - + * @author Sergey Romanenko + * @link http://rawilum.org * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ -namespace Rawilum; - // Define the application minimum supported PHP version. define('RAWILUM_MINIMUM_PHP', '7.1.3'); diff --git a/rawilum/Cache.php b/rawilum/Cache.php index a29701b4..6234bd9d 100755 --- a/rawilum/Cache.php +++ b/rawilum/Cache.php @@ -1,10 +1,10 @@ - + * @author Sergey Romanenko + * @link http://rawilum.org * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/rawilum/Config.php b/rawilum/Config.php index 9a258bb2..cb9b3fe9 100755 --- a/rawilum/Config.php +++ b/rawilum/Config.php @@ -1,13 +1,13 @@ - + * @author Sergey Romanenko + * @link http://rawilum.org * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/rawilum/Events.php b/rawilum/Events.php index 0d52bfc2..18f06a12 100644 --- a/rawilum/Events.php +++ b/rawilum/Events.php @@ -1,16 +1,17 @@ - + * @author Sergey Romanenko + * @link http://rawilum.org * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + class Events { /** diff --git a/rawilum/Filters.php b/rawilum/Filters.php index 98182214..df4e98b5 100755 --- a/rawilum/Filters.php +++ b/rawilum/Filters.php @@ -1,16 +1,15 @@ - + * @author Sergey Romanenko + * @link http://rawilum.org * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - class Filters { diff --git a/rawilum/I18n.php b/rawilum/I18n.php index 162491bb..87b2e852 100644 --- a/rawilum/I18n.php +++ b/rawilum/I18n.php @@ -1,12 +1,12 @@ - + * @author Sergey Romanenko + * @link http://rawilum.org * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/rawilum/Pages.php b/rawilum/Pages.php index d2b113ea..2eec55e7 100755 --- a/rawilum/Pages.php +++ b/rawilum/Pages.php @@ -1,5 +1,4 @@ - + * @author Sergey Romanenko + * @link http://rawilum.org * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/rawilum/Plugins.php b/rawilum/Plugins.php index ead8aeac..ccca2737 100755 --- a/rawilum/Plugins.php +++ b/rawilum/Plugins.php @@ -1,16 +1,17 @@ - + * @author Sergey Romanenko + * @link http://rawilum.org * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + class Plugins { /** diff --git a/rawilum/Rawilum.php b/rawilum/Rawilum.php index 077bf1e8..556202cd 100755 --- a/rawilum/Rawilum.php +++ b/rawilum/Rawilum.php @@ -1,5 +1,4 @@ - * @link http://rawilum.org * @@ -33,7 +31,7 @@ class Rawilum extends Container * * @var string */ - const VERSION = 'X.X.X'; + const VERSION = '0.0.0'; /** * Init Rawilum Application @@ -45,50 +43,62 @@ class Rawilum extends Container // Create container $container = new static(); + // Define markdown service $container['markdown'] = function ($c) { return new ParsedownExtra(); }; + // Define filesystem service $container['filesystem'] = function ($c) { return new Filesystem(); }; + // Define finder service $container['finder'] = function ($c) { return new Finder(); }; + // Define cache service $container['cache'] = function ($c) { return new Cache($c); }; + // Define config service $container['config'] = function ($c) { return new Config($c); }; + // Define shortcodes service $container['shortcodes'] = function ($c) { return new Shortcodes($c); }; + // Define events service $container['events'] = function ($c) { return new Events($c); }; + // Define filters service $container['filters'] = function ($c) { return new Filters($c); }; + // Define i18n service $container['i18n'] = function ($c) { return new I18n($c); }; + // Define plugins service $container['plugins'] = function ($c) { return new Plugins($c); }; + // Define pages service $container['pages'] = function ($c) { return new Pages($c); }; + // Define themes service $container['themes'] = function ($c) { return new Themes($c); }; diff --git a/rawilum/RawilumTrait.php b/rawilum/RawilumTrait.php index 952db895..dd0a3688 100755 --- a/rawilum/RawilumTrait.php +++ b/rawilum/RawilumTrait.php @@ -1,5 +1,14 @@ - + * @link http://rawilum.org + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ trait RawilumTrait { diff --git a/rawilum/Shortcodes.php b/rawilum/Shortcodes.php index 2ec99414..12c454bf 100644 --- a/rawilum/Shortcodes.php +++ b/rawilum/Shortcodes.php @@ -1,10 +1,10 @@ - + * @author Sergey Romanenko + * @link http://rawilum.org * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/rawilum/Themes.php b/rawilum/Themes.php index a4669190..c9aef679 100644 --- a/rawilum/Themes.php +++ b/rawilum/Themes.php @@ -1,10 +1,10 @@ - + * @author Sergey Romanenko + * @link http://rawilum.org * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/rawilum/boot/defines.php b/rawilum/boot/defines.php index 2a40d95a..7ce3cc88 100755 --- a/rawilum/boot/defines.php +++ b/rawilum/boot/defines.php @@ -1,9 +1,10 @@ + * @author Sergey Romanenko + * @link http://rawilum.org * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code.