Some updates

This commit is contained in:
ArkQuark 2022-10-20 20:23:05 +03:00
parent 8d454e5ec9
commit e6c04861a4
5 changed files with 34 additions and 26 deletions

View file

@ -134,6 +134,7 @@ class PluginAPI extends stdClass{
}
private function loadAll(){
$pharCnt = 0;
$dir = dir($this->pluginsPath());
while(false !== ($file = $dir->read())){
if($file[0] !== "."){
@ -143,6 +144,7 @@ class PluginAPI extends stdClass{
$this->load($dir->path . $file);
}
if($ext2 === "phar"){
++$pharCnt;
$pluginInfo = []; //TODO: A PluginInfo class?
$filePath = $this->pluginsPath().$file;
$p = new Phar($this->pluginsPath().$file, 0);
@ -154,8 +156,7 @@ class PluginAPI extends stdClass{
break;
}
}
console("[INFO] Loading {$pluginInfo["name"]} by {$pluginInfo["author"]}...");
console("[WARNING] PHAR Plugin format is experemental and might cause bugs.");
console("[INFO] Loading PHAR plugin \"".FORMAT_GREEN.$pluginInfo["name"].FORMAT_RESET."\" ".FORMAT_AQUA.$pluginInfo["version"].FORMAT_RESET." by ".FORMAT_AQUA.$pluginInfo["author"].FORMAT_RESET);
$aver = CURRENT_API_VERSION;
if($pluginInfo["api"] != $aver){
@ -182,6 +183,9 @@ class PluginAPI extends stdClass{
}
}
}
if($pharCnt > 0){
console("[WARNING] PHAR Plugin format is experemental and might cause bugs.");
}
}
public function load($file){