xref: /dokuwiki/inc/pluginutils.php (revision f6af1fe63a13b2734d1b69817ec800c51e6def9c)
1<?php
2/**
3 * Utilities for handling plugins
4 *
5 * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
6 * @author     Andreas Gohr <andi@splitbrain.org>
7 */
8
9// plugin related constants
10if(!defined('DOKU_PLUGIN'))  define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
11// note that only [a-z0-9]+ is officially supported, this is only to support plugins that don't follow these conventions, too
12if(!defined('DOKU_PLUGIN_NAME_REGEX')) define('DOKU_PLUGIN_NAME_REGEX', '[a-zA-Z0-9\x7f-\xff]+');
13
14/**
15 * Original plugin functions, remain for backwards compatibility
16 */
17function plugin_list($type='',$all=false) {
18    global $plugin_controller;
19    return $plugin_controller->getList($type,$all);
20}
21function plugin_load($type,$name,$new=false,$disabled=false) {
22    global $plugin_controller;
23    return $plugin_controller->load($type,$name,$new,$disabled);
24}
25function plugin_isdisabled($plugin) {
26    global $plugin_controller;
27    return $plugin_controller->isdisabled($plugin);
28}
29function plugin_enable($plugin) {
30    global $plugin_controller;
31    return $plugin_controller->enable($plugin);
32}
33function plugin_disable($plugin) {
34    global $plugin_controller;
35    return $plugin_controller->disable($plugin);
36}
37function plugin_directory($plugin) {
38    global $plugin_controller;
39    return $plugin_controller->get_directory($plugin);
40}
41function plugin_getcascade() {
42    global $plugin_controller;
43    return $plugin_controller->getCascade();
44}
45