| | |
| | | } |
| | | |
| | | // plugin already loaded |
| | | if ($this->plugins[$plugin_name] || class_exists($plugin_name, false)) { |
| | | if ($this->plugins[$plugin_name]) { |
| | | return true; |
| | | } |
| | | |
| | |
| | | . DIRECTORY_SEPARATOR . $plugin_name . '.php'; |
| | | |
| | | if (file_exists($fn)) { |
| | | include $fn; |
| | | if (!class_exists($plugin_name, false)) { |
| | | include $fn; |
| | | } |
| | | |
| | | // instantiate class if exists |
| | | if (class_exists($plugin_name, false)) { |
| | |
| | | $composer = INSTALL_PATH . "/plugins/$plugin_name/composer.json"; |
| | | if (file_exists($composer) && ($json = @json_decode(file_get_contents($composer), true))) { |
| | | list($info['vendor'], $info['name']) = explode('/', $json['name']); |
| | | $info['version'] = $json['version']; |
| | | $info['license'] = $json['license']; |
| | | if ($license_uri = $license_uris[$info['license']]) |
| | | $info['license_uri'] = $license_uri; |