'StrictTransportSecurity' => null,
),
'default' => array(
- 'Activity' => null,
- 'Bookmark' => null,
- 'ClientSideShorten' => null,
- 'Event' => null,
- 'OpenID' => null,
- 'Poll' => null,
- 'QnA' => null,
- 'SearchSub' => null,
- 'TagSub' => null,
+ 'Activity' => array(),
+ 'Bookmark' => array(),
+ 'ClientSideShorten' => array(),
+ 'Event' => array(),
+ 'OpenID' => array(),
+ 'Poll' => array(),
+ 'QnA' => array(),
+ 'SearchSub' => array(),
+ 'TagSub' => array(),
),
'locale_path' => false, // Set to a path to use *instead of* each plugin's own locale subdirectories
'server' => null,
require_once(INSTALLDIR.'/lib/event.php');
require_once(INSTALLDIR.'/lib/plugin.php');
-function addPlugin($name, $attrs = null)
+function addPlugin($name, array $attrs=array())
{
return StatusNet::addPlugin($name, $attrs);
}
*
* @throws ServerException if plugin can't be found
*/
- public static function addPlugin($name, $attrs = null)
+ public static function addPlugin($name, array $attrs=array())
{
$name = ucfirst($name);
}
}
+ // Doesn't this $inst risk being garbage collected or something?
+ // TODO: put into a static array that makes sure $inst isn't lost.
$inst = new $pluginclass();
- if (!empty($attrs)) {
- foreach ($attrs as $aname => $avalue) {
- $inst->$aname = $avalue;
- }
+ foreach ($attrs as $aname => $avalue) {
+ $inst->$aname = $avalue;
}
// Record activated plugins for later display/config dump
foreach (StatusNet::getActivePlugins() as $plugin=>$args) {
echo "$plugin: ";
- if ($args === null) {
+ if (empty($args)) {
echo "(no args)\n";
} else {
foreach ($args as $arg => $val) {