|
|
@@ -99,7 +99,7 @@ class MigratorController {
|
|
|
$rdi = new \RecursiveDirectoryIterator(DIR_APP);
|
|
|
|
|
|
foreach (new \RecursiveIteratorIterator($rdi) as $file) {
|
|
|
- if (strpos($file, 'version.php')) {
|
|
|
+ if (strpos($file, 'version.php') && ! strpos($file, '.versi') ) {
|
|
|
$module_configs[] = str_replace('version.php', '', $file);
|
|
|
}
|
|
|
}
|
|
|
@@ -150,21 +150,12 @@ class MigratorController {
|
|
|
|
|
|
public function execute_plan() {
|
|
|
$status = false;
|
|
|
+
|
|
|
while (!$status) {
|
|
|
$this->sort_plugins();
|
|
|
$status = true;
|
|
|
|
|
|
foreach ($this->install as $key => $item) {
|
|
|
- /*
|
|
|
- *
|
|
|
- *
|
|
|
- *
|
|
|
- */
|
|
|
-
|
|
|
- $funname = explode('_', $item->name);
|
|
|
- if(sizeof($funname) > 1){ unset($funname[0]); }
|
|
|
- $funname = implode('_', $funname);
|
|
|
-
|
|
|
if (isset($item->require)) {
|
|
|
if (!self::is_satisfy_array($item->require)) {
|
|
|
$status = false;
|
|
|
@@ -172,22 +163,19 @@ class MigratorController {
|
|
|
}
|
|
|
}
|
|
|
if (!self::is_satisfy($item->name, $item->version)) {
|
|
|
- if (!function_exists($funname . '_upgrade')) {
|
|
|
- echo 'adsdsadasdsadassad';
|
|
|
+ if (!function_exists($item->name . '_upgrade')) {
|
|
|
$this->update_plugin_version($item->name, $item->version);
|
|
|
$this->upgrade[] = $item;
|
|
|
- $this->instaled[$item->name] = $item;
|
|
|
unset($this->install[$key]);
|
|
|
continue;
|
|
|
}
|
|
|
- $this->instaled[$item->name] = $item;
|
|
|
- call_user_func($funname . '_upgrade', '0');
|
|
|
+ call_user_func($item->name . '_upgrade', "0.0.0");
|
|
|
$this->upgrade[] = $this->instaled[$item->name];
|
|
|
unset($this->install[$key]);
|
|
|
$status = false;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
foreach ($this->upgrade as $item) {
|
|
|
if (isset($item->require)) {
|
|
|
if (!self::is_satisfy_array($item->require)) {
|
|
|
@@ -195,12 +183,12 @@ class MigratorController {
|
|
|
continue;
|
|
|
}
|
|
|
}
|
|
|
- if (!self::is_satisfy($funname, $item->version)) {
|
|
|
+ if (!self::is_satisfy($item->name, $item->version)) {
|
|
|
if (!function_exists($item->name . '_upgrade')) {
|
|
|
$this->update_plugin_version($item->name, $item->version);
|
|
|
continue;
|
|
|
}
|
|
|
- call_user_func($funname . '_upgrade', $this->instaled[$item->name]->version);
|
|
|
+ call_user_func($item->name . '_upgrade', $this->instaled[$item->name]->version);
|
|
|
$status = false;
|
|
|
}
|
|
|
}
|