]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - plugins/wallabag/wallabag.php
New init function for plugins, supports errors reporting
[github/shaarli/Shaarli.git] / plugins / wallabag / wallabag.php
index ec09c8a14d03dc89e2865efb794756d5ee199102..641e4cc237ed4f20a44fafda7eae1b871bf2e118 100644 (file)
@@ -6,10 +6,21 @@
 
 require_once 'WallabagInstance.php';
 
-$wallabagUrl = $conf->get('plugins.WALLABAG_URL');
-if (empty($wallabagUrl)) {
-    $GLOBALS['plugin_errors'][] = 'Wallabag plugin error: '.
-        'Please define the "WALLABAG_URL" setting in the plugin administration page.';
+/**
+ * Init function, return an error if the server is not set.
+ *
+ * @param $conf ConfigManager instance.
+ *
+ * @return array Eventual error.
+ */
+function wallabag_init($conf)
+{
+    $wallabagUrl = $conf->get('plugins.WALLABAG_URL');
+    if (empty($wallabagUrl)) {
+        $error = 'Wallabag plugin error: '.
+            'Please define the "WALLABAG_URL" setting in the plugin administration page.';
+        return array($error);
+    }
 }
 
 /**