]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
add default plugins and load them
authorEvan Prodromou <evan@status.net>
Fri, 8 Jan 2010 00:13:36 +0000 (16:13 -0800)
committerEvan Prodromou <evan@status.net>
Fri, 8 Jan 2010 00:13:36 +0000 (16:13 -0800)
lib/common.php
lib/default.php

index b0e5c4390a9595b3cd67e02b101906c6461d20d5..fb5e5919e054037de16f4c499ef2cd83b3f0be96 100644 (file)
@@ -238,6 +238,27 @@ function __autoload($cls)
     }
 }
 
+// Load default plugins
+
+foreach ($config['plugins']['default'] as $name => $params) {
+    if (is_null($params)) {
+        addPlugin($name);
+    } else if (is_array($params)) {
+        if (count($params) == 0) {
+            addPlugin($name);
+        } else {
+            $keys = array_keys($params);
+            if (is_string($keys[0])) {
+                addPlugin($name, $params);
+            } else {
+                foreach ($params as $paramset) {
+                    addPlugin($name, $paramset);
+                }
+            }
+        }
+    }
+}
+
 // XXX: how many of these could be auto-loaded on use?
 // XXX: note that these files should not use config options
 // at compile time since DB config options are not yet loaded.
index f2e57714905f6681eef4dfba07d6f1ee6aecf881..5acd2fb876d163cf473de3fe31ce2f8ffa692429 100644 (file)
@@ -230,4 +230,21 @@ $default =
         array('timeout' => 5), // HTTP request timeout in seconds when contacting remote hosts for OMB updates
         'logincommand' =>
         array('disabled' => true),
+        'plugins' =>
+        array('default' => array('LilUrl' => array('shortenerName'=>'ur1.ca',
+                                                   'freeService' => true,
+                                                   'serviceUrl'=>'http://ur1.ca/'),
+                                 'PtitUrl' => array('shortenerName' => 'ptiturl1.com',
+                                                    'serviceUrl' => 'http://ptiturl.com/?creer=oui&action=Reduire&url=%1$s'),
+                                 'SimpleUrl' => array(array('shortenerName' => 'is.gd', 'serviceUrl' => 'http://is.gd/api.php?longurl=%1$s'),
+                                                      array('shortenerName' => 'snipr.com', 'serviceUrl' => 'http://snipr.com/site/snip?r=simple&link=%1$s'),
+                                                      array('shortenerName' => 'metamark.net', 'serviceUrl' => 'http://metamark.net/api/rest/simple?long_url=%1$s'),
+                                                      array('shortenerName' => 'tinyurl.com', 'serviceUrl' => 'http://tinyurl.com/api-create.php?url=%1$s')),
+                                 'TightUrl' => array('shortenerName' => '2tu.us', 'freeService' => true,'serviceUrl'=>'http://2tu.us/?save=y&url=%1$s'),
+                                 'Geonames' => null,
+                                 'Mapstraction' => null,
+                                 'Linkback' => null,
+                                 'WikiHashtags' => null,
+                                 'OpenID' => null),
+              )
         );