diff options
author | Arthur <arthur@hoa.ro> | 2016-10-17 08:50:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-17 08:50:18 +0200 |
commit | 06eec9bf764662cd328627247a1f43e4abd3c5ad (patch) | |
tree | fd66a3e1cb4cd93aa80b6f04c43958623140a008 /plugins/demo_plugin/demo_plugin.php | |
parent | bb70e690598d270951148e003a4dc253b05868b4 (diff) | |
parent | 7fde6de1212323418401c15efba06026c704ca87 (diff) | |
download | Shaarli-06eec9bf764662cd328627247a1f43e4abd3c5ad.tar.gz Shaarli-06eec9bf764662cd328627247a1f43e4abd3c5ad.tar.zst Shaarli-06eec9bf764662cd328627247a1f43e4abd3c5ad.zip |
Merge pull request #659 from ArthurHoaro/plugin-errors
New init function for plugins, supports errors reporting
Diffstat (limited to 'plugins/demo_plugin/demo_plugin.php')
-rw-r--r-- | plugins/demo_plugin/demo_plugin.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/plugins/demo_plugin/demo_plugin.php b/plugins/demo_plugin/demo_plugin.php index 18834e53..7335c9d4 100644 --- a/plugins/demo_plugin/demo_plugin.php +++ b/plugins/demo_plugin/demo_plugin.php | |||
@@ -15,6 +15,23 @@ | |||
15 | */ | 15 | */ |
16 | 16 | ||
17 | /** | 17 | /** |
18 | * Initialization function. | ||
19 | * It will be called when the plugin is loaded. | ||
20 | * This function can be used to return a list of initialization errors. | ||
21 | * | ||
22 | * @param $conf ConfigManager instance. | ||
23 | * | ||
24 | * @return array List of errors (optional). | ||
25 | */ | ||
26 | function demo_plugin_init($conf) | ||
27 | { | ||
28 | $conf->get('toto', 'nope'); | ||
29 | |||
30 | $errors[] = 'This a demo init error.'; | ||
31 | return $errors; | ||
32 | } | ||
33 | |||
34 | /** | ||
18 | * Hook render_header. | 35 | * Hook render_header. |
19 | * Executed on every page redering. | 36 | * Executed on every page redering. |
20 | * | 37 | * |