loader = $loader; } public function canLoadPlugin(string $path) : bool{ $ext = ".phar"; return is_file($path) and substr($path, -strlen($ext)) === $ext; } /** * Loads the plugin contained in $file */ public function loadPlugin(string $file) : void{ $this->loader->addPath("$file/src"); } /** * Gets the PluginDescription from the file */ public function getPluginDescription(string $file) : ?PluginDescription{ $phar = new \Phar($file); if(isset($phar["plugin.yml"])){ return new PluginDescription($phar["plugin.yml"]->getContent()); } return null; } public function getAccessProtocol() : string{ return "phar://"; } }