mirror of
https://github.com/ZeroDream-CN/PHPMC7
synced 2024-11-30 17:52:52 +08:00
修复重复加载插件的bug
人生就是在不断地修复bug...
This commit is contained in:
parent
577f59708b
commit
f4eb01463d
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
// PHPMC 7 Version define
|
||||
// Don't change this, because it will interfere your update.
|
||||
define("PHPMC_VERSION", "7.3.3199");
|
||||
define("PHPMC_VERSION", "7.3.3200");
|
||||
|
||||
include(ROOT . "/include/core/PHPMC/Event.php");
|
||||
include(ROOT . "/include/core/PHPMC/User.php");
|
||||
|
@ -1,6 +1,8 @@
|
||||
<?php
|
||||
class Plugin {
|
||||
|
||||
public $plugins;
|
||||
|
||||
public function __construct() {
|
||||
if(!file_exists("plugins/")) {
|
||||
mkdir("plugins/", 0775);
|
||||
@ -21,7 +23,11 @@ class Plugin {
|
||||
if(!$info) {
|
||||
PHPMC::Error()->Println("Error when load plugin: " . $files . ": No such plugin info file: " . $target . "<br>" . $data);
|
||||
}
|
||||
if(stristr($this->plugins, $info['package'] . ";")) {
|
||||
continue;
|
||||
}
|
||||
include("{$realpath}/{$file}/{$files}");
|
||||
$this->plugin .= $info['package'] . ";";
|
||||
eval('$' . $info['main'] . ' = new ' . $info['main'] . '();');
|
||||
eval('$' . $info['main'] . '->onload();');
|
||||
} else {
|
||||
@ -36,7 +42,11 @@ class Plugin {
|
||||
if(!$info) {
|
||||
PHPMC::Error()->Println("Error when load plugin: " . $file . ": No such plugin info file: " . $target . "<br>" . $data);
|
||||
}
|
||||
if(stristr($this->plugins, $info['package'] . ";")) {
|
||||
continue;
|
||||
}
|
||||
include("{$realpath}/{$file}");
|
||||
$this->plugin .= $info['package'] . ";";
|
||||
eval('$' . $info['main'] . ' = new ' . $info['main'] . '();');
|
||||
eval('$' . $info['main'] . '->onload();');
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user