summaryrefslogtreecommitdiff
path: root/lib/common.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-07-11 07:30:26 -0700
committerEvan Prodromou <evan@controlyourself.ca>2009-07-11 07:30:26 -0700
commit55415652382d1f3ae77123d197e01d95da83041e (patch)
tree449ee7e9aebe184583f099e49a7194eb5bbf8543 /lib/common.php
parentbfae5489cb629331f2936b2bf1066adb3976bce1 (diff)
parent7621e0e38467349a89f71e814941932fbacecfa1 (diff)
Merge branch 'testing'
Diffstat (limited to 'lib/common.php')
-rw-r--r--lib/common.php37
1 files changed, 35 insertions, 2 deletions
diff --git a/lib/common.php b/lib/common.php
index 14be747bc..c47702779 100644
--- a/lib/common.php
+++ b/lib/common.php
@@ -19,7 +19,7 @@
if (!defined('LACONICA')) { exit(1); }
-define('LACONICA_VERSION', '0.8.0dev');
+define('LACONICA_VERSION', '0.8.0');
define('AVATAR_PROFILE_SIZE', 96);
define('AVATAR_STREAM_SIZE', 48);
@@ -206,7 +206,7 @@ $config =
'inboxes' =>
array('enabled' => true), # on by default for new sites
'newuser' =>
- array('subscribe' => null,
+ array('default' => null,
'welcome' => null),
'snapshot' =>
array('run' => 'web',
@@ -282,6 +282,39 @@ if (function_exists('date_default_timezone_set')) {
date_default_timezone_set('UTC');
}
+function addPlugin($name, $attrs = null)
+{
+ $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).