- $name = ucfirst($name);
- $pluginclass = "{$name}Plugin";
-
- if (!class_exists($pluginclass)) {
-
- $files = array("local/plugins/{$pluginclass}.php",
- "local/plugins/{$name}/{$pluginclass}.php",
- "local/{$pluginclass}.php",
- "local/{$name}/{$pluginclass}.php",
- "plugins/{$pluginclass}.php",
- "plugins/{$name}/{$pluginclass}.php");
-
- foreach ($files as $file) {
- $fullpath = INSTALLDIR.'/'.$file;
- if (@file_exists($fullpath)) {
- include_once($fullpath);
- break;
- }
- }
- }
-
- $inst = new $pluginclass();
-
- if (!empty($attrs)) {
- foreach ($attrs as $aname => $avalue) {
- $inst->$aname = $avalue;
- }
- }
- return $inst;
-}
-
-// From most general to most specific:
-// server-wide, then vhost-wide, then for a path,
-// finally for a dir (usually only need one of the last two).
-
-if (isset($conffile)) {
- $_config_files = array($conffile);
-} else {
- $_config_files = array('/etc/statusnet/statusnet.php',
- '/etc/statusnet/laconica.php',
- '/etc/laconica/laconica.php',
- '/etc/statusnet/'.$_server.'.php',
- '/etc/laconica/'.$_server.'.php');
-
- if (strlen($_path) > 0) {
- $_config_files[] = '/etc/statusnet/'.$_server.'_'.$_path.'.php';
- $_config_files[] = '/etc/laconica/'.$_server.'_'.$_path.'.php';
- }
-
- $_config_files[] = INSTALLDIR.'/config.php';
-}
-
-global $_have_a_config;
-$_have_a_config = false;
-
-foreach ($_config_files as $_config_file) {
- if (@file_exists($_config_file)) {
- include_once($_config_file);
- $_have_a_config = true;
- }