From 8ba18b9ff7f0b9a258d258722eb3a5222fdf6abd Mon Sep 17 00:00:00 2001 From: nashe Date: Sun, 16 Jul 2017 17:16:49 +0200 Subject: Move helper functions to a separate file This will be useful to use it in the tests. --- app/app.php | 14 -------------- app/helpers.php | 33 +++++++++++++++++++++++++++++++++ composer.json | 1 + 3 files changed, 34 insertions(+), 14 deletions(-) create mode 100644 app/helpers.php diff --git a/app/app.php b/app/app.php index 5cda95c..a6232cf 100755 --- a/app/app.php +++ b/app/app.php @@ -28,17 +28,3 @@ if (is_installed()) { $l10n = new Simplel10n($conf['locale']); -// this is an helper function. We will usually use that function and not Simplel10n::getString() -function _g($str, $comment='') { - return Simplel10n::getString($str); -} - -function custom_path($file = '') -{ - return __DIR__.'/../custom' . (!empty($file) ? '/'.$file : ''); -} - -function is_installed() -{ - return file_exists(custom_path('config.yml')) && file_exists(custom_path('people.opml')); -} diff --git a/app/helpers.php b/app/helpers.php new file mode 100644 index 0000000..6ec55c1 --- /dev/null +++ b/app/helpers.php @@ -0,0 +1,33 @@ +