summaryrefslogtreecommitdiff
path: root/src/helpers.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/helpers.php')
-rw-r--r--src/helpers.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/helpers.php b/src/helpers.php
new file mode 100644
index 00000000..aeb256e9
--- /dev/null
+++ b/src/helpers.php
@@ -0,0 +1,24 @@
+<?php
+// Some useful functions
+
+use Engelsystem\Config\Config;
+
+/**
+ * Get or set config values
+ *
+ * @param string|array $key
+ * @param mixed $default
+ * @return mixed|Config
+ */
+function config($key = null, $default = null)
+{
+ if (empty($key)) {
+ return Config::getInstance();
+ }
+
+ if (is_array($key)) {
+ Config::getInstance()->set($key);
+ }
+
+ return Config::getInstance()->get($key, $default);
+}