X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fstatusnet.php;h=7212a4a47d5ebc7db124580ccb110ff7a30ef5f4;hb=6c7262c8ca9f0895584ef5b73fddafb3182582a2;hp=257bd861da61ff881af67e781049178b7d299cba;hpb=84fa3776e28ed438169e732327616208c89837e2;p=quix0rs-gnu-social.git diff --git a/lib/statusnet.php b/lib/statusnet.php index 257bd861da..7212a4a47d 100644 --- a/lib/statusnet.php +++ b/lib/statusnet.php @@ -30,6 +30,8 @@ global $config, $_server, $_path; class StatusNet { protected static $have_config; + protected static $is_api; + protected static $plugins = array(); /** * Configure and instantiate a plugin into the current configuration. @@ -73,9 +75,22 @@ class StatusNet $inst->$aname = $avalue; } } + + // Record activated plugins for later display/config dump + self::$plugins[] = array($name, $attrs); + return true; } + /** + * Get a list of activated plugins in this process. + * @return array of (string $name, array $args) pairs + */ + public static function getActivePlugins() + { + return self::$plugins; + } + /** * Initialize, or re-initialize, StatusNet global configuration * and plugins. @@ -126,7 +141,7 @@ class StatusNet return true; } - $sn = Status_network::staticGet($nickname); + $sn = Status_network::staticGet('nickname', $nickname); if (empty($sn)) { return false; throw new Exception("No such site nickname '$nickname'"); @@ -201,6 +216,16 @@ class StatusNet return self::$have_config; } + public function isApi() + { + return self::$is_api; + } + + public function setApi($mode) + { + self::$is_api = $mode; + } + /** * Build default configuration array * @return array @@ -221,6 +246,7 @@ class StatusNet global $_server, $_path, $config; Event::clearHandlers(); + self::$plugins = array(); // try to figure out where we are. $server and $path // can be set by including module, else we guess based @@ -343,10 +369,10 @@ class StatusNet class NoConfigException extends Exception { - public $config_files; + public $configFiles; - function __construct($msg, $config_files) { + function __construct($msg, $configFiles) { parent::__construct($msg); - $this->config_files = $config_files; + $this->configFiles = $configFiles; } }