|
|
<?php |
|
|
|
|
|
namespace Kanboard\Core\Plugin; |
|
|
|
|
|
use Kanboard\Core\Base as BaseCore; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Directory extends BaseCore |
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function getAvailablePlugins($url = PLUGIN_API_URL) |
|
|
{ |
|
|
$plugins = $this->httpClient->getJson($url); |
|
|
$plugins = array_filter($plugins, array($this, 'isCompatible')); |
|
|
$plugins = array_filter($plugins, array($this, 'isInstallable')); |
|
|
return $plugins; |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function isCompatible(array $plugin, $appVersion = APP_VERSION) |
|
|
{ |
|
|
return Version::isCompatible($plugin['compatible_version'], $appVersion); |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function isInstallable(array $plugin) |
|
|
{ |
|
|
return $plugin['remote_install']; |
|
|
} |
|
|
} |
|
|
|