From b78801becbd963a57e3a5b5db9c2f71c0f078e14 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 9 Jul 2009 18:19:13 -0400 Subject: correct the newuser default setting in common.php --- lib/common.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/common.php') diff --git a/lib/common.php b/lib/common.php index 14be747bc..5bfb35583 100644 --- a/lib/common.php +++ b/lib/common.php @@ -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', -- cgit v1.2.3-54-g00ecf From efd94b4e5423c72a65cdd6acd252e5d00ec98967 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 9 Jul 2009 18:22:10 -0400 Subject: change version number to 0.8.0 --- lib/common.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/common.php') diff --git a/lib/common.php b/lib/common.php index 5bfb35583..832667d81 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); -- cgit v1.2.3-54-g00ecf From 15f6309deacf64e6b408d45a4eb19852d36f9f72 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 9 Jul 2009 23:12:53 -0700 Subject: add a little syntactical sugar for adding plugins --- lib/common.php | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'lib/common.php') diff --git a/lib/common.php b/lib/common.php index 832667d81..c47702779 100644 --- a/lib/common.php +++ b/lib/common.php @@ -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). -- cgit v1.2.3-54-g00ecf