summaryrefslogtreecommitdiffstats
path: root/app/helpers.php
diff options
context:
space:
mode:
authornashe <thomas@chauchefoin.fr>2017-07-16 17:16:49 +0200
committernashe <thomas@chauchefoin.fr>2017-07-16 17:16:49 +0200
commit8ba18b9ff7f0b9a258d258722eb3a5222fdf6abd (patch)
tree20e4aaffab5229a1dd1ece3a53bdcc4b4e40c344 /app/helpers.php
parent662f5fa67d03520215a0334318b3afe95d51c2d3 (diff)
downloadplanet-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/helpers.php')
-rw-r--r--app/helpers.php33
1 files changed, 33 insertions, 0 deletions
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