*/
public function onAutoload($cls) {
$cls = basename($cls);
- $basedir = INSTALLDIR . '/plugins/' . mb_substr(get_called_class(), 0, -6);
+ $basedir = INSTALLDIR . '/local/plugins/' . mb_substr(get_called_class(), 0, -6);
+ if (!file_exists($basedir)) {
+ $basedir = INSTALLDIR . '/plugins/' . mb_substr(get_called_class(), 0, -6);
+ }
+
$file = null;
if (preg_match('/^(\w+)(Action|Form)$/', $cls, $type)) {
// @fixme this will fail for things installed in local/plugins
// ... but then so will web links so far.
$path = INSTALLDIR . "/plugins/$name/locale";
+ if (!file_exists($path)) {
+ $path = INSTALLDIR . "/local/plugins/$name/locale";
+ }
}
if (file_exists($path) && is_dir($path)) {
bindtextdomain($name, $path);
. ' (' . get_class($this) . ' v' . $this->version() . ')';
}
- function onPluginVersion(&$versions)
+ function onPluginVersion(array &$versions)
{
$name = $this->name();
static function staticPath($plugin, $relative)
{
- $isHTTPS = StatusNet::isHTTPS();
-
- if ($isHTTPS) {
+ if (GNUsocial::useHTTPS()) {
$server = common_config('plugins', 'sslserver');
} else {
$server = common_config('plugins', 'server');
}
if (empty($server)) {
- if ($isHTTPS) {
+ if (GNUsocial::useHTTPS()) {
$server = common_config('site', 'sslserver');
}
if (empty($server)) {
}
}
- if ($isHTTPS) {
+ if (GNUsocial::useHTTPS()) {
$path = common_config('plugins', 'sslpath');
} else {
$path = common_config('plugins', 'path');
$path = '/'.$path;
}
- $protocol = ($isHTTPS) ? 'https' : 'http';
+ $protocol = GNUsocial::useHTTPS() ? 'https' : 'http';
return $protocol.'://'.$server.$path.$plugin.'/'.$relative;
}