Changes to the Framework
This commit is contained in:
@@ -155,6 +155,16 @@ class MigratorController {
|
||||
$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;
|
||||
@@ -162,19 +172,22 @@ class MigratorController {
|
||||
}
|
||||
}
|
||||
if (!self::is_satisfy($item->name, $item->version)) {
|
||||
if (!function_exists($item->name . '_upgrade')) {
|
||||
if (!function_exists($funname . '_upgrade')) {
|
||||
echo 'adsdsadasdsadassad';
|
||||
$this->update_plugin_version($item->name, $item->version);
|
||||
$this->upgrade[] = $item;
|
||||
$this->instaled[$item->name] = $item;
|
||||
unset($this->install[$key]);
|
||||
continue;
|
||||
}
|
||||
call_user_func($item->name . '_upgrade', 0);
|
||||
$this->instaled[$item->name] = $item;
|
||||
call_user_func($funname . '_upgrade', '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)) {
|
||||
@@ -182,12 +195,12 @@ class MigratorController {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (!self::is_satisfy($item->name, $item->version)) {
|
||||
if (!self::is_satisfy($funname, $item->version)) {
|
||||
if (!function_exists($item->name . '_upgrade')) {
|
||||
$this->update_plugin_version($item->name, $item->version);
|
||||
continue;
|
||||
}
|
||||
call_user_func($item->name . '_upgrade', $this->instaled[$item->name]->version);
|
||||
call_user_func($funname . '_upgrade', $this->instaled[$item->name]->version);
|
||||
$status = false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user