]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - application/config/ConfigIO.php
Introduce a configuration manager (not plugged yet)
[github/shaarli/Shaarli.git] / application / config / ConfigIO.php
diff --git a/application/config/ConfigIO.php b/application/config/ConfigIO.php
new file mode 100644 (file)
index 0000000..2b68fe6
--- /dev/null
@@ -0,0 +1,33 @@
+<?php
+
+/**
+ * Interface ConfigIO
+ *
+ * This describes how Config types should store their configuration.
+ */
+interface ConfigIO
+{
+    /**
+     * Read configuration.
+     *
+     * @param string $filepath Config file absolute path.
+     *
+     * @return array All configuration in an array.
+     */
+    function read($filepath);
+
+    /**
+     * Write configuration.
+     *
+     * @param string $filepath Config file absolute path.
+     * @param array  $conf   All configuration in an array.
+     */
+    function write($filepath, $conf);
+
+    /**
+     * Get config file extension according to config type.
+     *
+     * @return string Config file extension.
+     */
+    function getExtension();
+}