diff options
author | nashe <thomas@chauchefoin.fr> | 2017-07-16 17:16:49 +0200 |
---|---|---|
committer | nashe <thomas@chauchefoin.fr> | 2017-07-16 17:16:49 +0200 |
commit | 8ba18b9ff7f0b9a258d258722eb3a5222fdf6abd (patch) | |
tree | 20e4aaffab5229a1dd1ece3a53bdcc4b4e40c344 /app | |
parent | 662f5fa67d03520215a0334318b3afe95d51c2d3 (diff) | |
download | planet-8ba18b9ff7f0b9a258d258722eb3a5222fdf6abd.tar planet-8ba18b9ff7f0b9a258d258722eb3a5222fdf6abd.tar.gz planet-8ba18b9ff7f0b9a258d258722eb3a5222fdf6abd.tar.bz2 planet-8ba18b9ff7f0b9a258d258722eb3a5222fdf6abd.tar.xz planet-8ba18b9ff7f0b9a258d258722eb3a5222fdf6abd.zip |
Move helper functions to a separate file
This will be useful to use it in the tests.
Diffstat (limited to 'app')
-rwxr-xr-x | app/app.php | 14 | ||||
-rw-r--r-- | app/helpers.php | 33 |
2 files changed, 33 insertions, 14 deletions
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 @@ +<?php + +/** + * Path to the _custom_ directory. + * + * @param string $file Append this filename to the returned path. + * @return string + */ +function custom_path($file = '') +{ + return __DIR__.'/../custom' . (!empty($file) ? '/'.$file : ''); +} + +/** + * Is moonmoon installed? + * + * @return bool + */ +function is_installed() +{ + return file_exists(custom_path('config.yml')) && file_exists(custom_path('people.opml')); +} + +/** + * Shortcut to Simplel10n::getString(). + * + * @param string $str + * @param string $comment + * @return string + */ +function _g($str, $comment='') { + return Simplel10n::getString($str, $comment); +}
\ No newline at end of file |