From 7b473ba06fb4aad1829b7fb095ca1b6751308ef1 Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Sun, 17 Nov 2013 13:02:41 +0100 Subject: [PATCH] Low-level refactor to core.php --- config.ini | 1 - lib/chibi-core | 2 +- public_html/dispatch.php | 3 +-- scripts/find-posts.php | 1 - scripts/process-detached-files.php | 10 ++++---- src/Views/layout-normal.phtml | 2 +- src/core.php | 39 +++++------------------------- 7 files changed, 14 insertions(+), 44 deletions(-) diff --git a/config.ini b/config.ini index b7b3d13f..dcd60ff6 100644 --- a/config.ini +++ b/config.ini @@ -1,5 +1,4 @@ [chibi] -userCodeDir=./src/ prettyPrint=1 [main] diff --git a/lib/chibi-core b/lib/chibi-core index 0ec5cbda..bf824e78 160000 --- a/lib/chibi-core +++ b/lib/chibi-core @@ -1 +1 @@ -Subproject commit 0ec5cbda4b34f6273e2e02196cf6c16379623bb3 +Subproject commit bf824e781c520a85a82394622a5fefd5c178379f diff --git a/public_html/dispatch.php b/public_html/dispatch.php index f43c0e39..40413c81 100644 --- a/public_html/dispatch.php +++ b/public_html/dispatch.php @@ -1,7 +1,6 @@ main->filesPath; + $filesPath = $config->main->filesPath; rename($filesPath . DS . $name, $dir . DS . $name); }; break; case '-purge': - $func = function($name) use ($dir) + $func = function($name) use ($dir, $config) { echo $name . PHP_EOL; static $filesPath = null; if ($filesPath == null) - $filesPath = configFactory()->main->filesPath; + $filesPath = $config->main->filesPath; unlink($filesPath . DS . $name); }; break; @@ -62,7 +63,6 @@ foreach (R::findAll('post') as $post) } $names = array_flip($names); -$config = configFactory(); $filesPath = $config->main->filesPath; foreach (glob($filesPath . DS . '*') as $name) { diff --git a/src/Views/layout-normal.phtml b/src/Views/layout-normal.phtml index 7536d9dc..92b5478f 100644 --- a/src/Views/layout-normal.phtml +++ b/src/Views/layout-normal.phtml @@ -96,7 +96,7 @@