]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - plugins/demo_plugin/demo_plugin.php
New init function for plugins, supports errors reporting
[github/shaarli/Shaarli.git] / plugins / demo_plugin / demo_plugin.php
index 8f675cc443d36a4576fb04596cba4120467d5cac..15482fe0fb867c8bfe05674de05333041f024deb 100644 (file)
  * and check user status with _LOGGEDIN_.
  */
 
+/**
+ * Initialization function.
+ * It will be called when the plugin is loaded.
+ * This function can be used to return a list of initialization errors.
+ *
+ * @param $conf ConfigManager instance.
+ *
+ * @return array List of errors (optional).
+ */
+function demo_plugin_init($conf)
+{
+    $conf->get('toto', 'nope');
+
+    $errors[] = 'This a demo init error.';
+    return $errors;
+}
+
 /**
  * Hook render_header.
  * Executed on every page redering.