diff --git a/app/core/generator/GeneratorController.php b/app/core/generator/GeneratorController.php index cbe624e..9a6dca1 100755 --- a/app/core/generator/GeneratorController.php +++ b/app/core/generator/GeneratorController.php @@ -15,8 +15,7 @@ class GeneratorController { addSoftDelete(); \$table->create(); - Migrator::getInstance()->update_plugin_version("{{SUB_PLUGIN_NAME}}_{{PLUGIN_NAME}}", "1.0.0"); + Migrator::getInstance()->update_plugin_version("{{PLUGIN_NAME}}", "1.0.0"); return; } //if (\$pluginversion < "0.0.2") { //\$table = Wrapper::get_table("{{PLUGIN_NAME}}"); - //Migrator::getInstance()->update_plugin_version("{{SUB_PLUGIN_NAME}}_{{PLUGIN_NAME}}", "1.0.1"); + //Migrator::getInstance()->update_plugin_version("{{PLUGIN_NAME}}", "1.0.1"); //return; //} } function {{PLUGIN_NAME}}_rollback(\$pluginversion) { if(\$pluginversion > "0.0.1"){ - \$table = Wrapper::get_table("{{SUB_PLUGIN_NAME}}_{{PLUGIN_NAME}}"); + \$table = Wrapper::get_table("{{PLUGIN_NAME}}"); \$table->drop(); return; } @@ -285,8 +284,7 @@ class GeneratorController { file_put_contents(DIR_APP.$subname . "/" . $name . "/lang/en.php", $this->langBase); file_put_contents(DIR_APP.$subname . "/" . $name . "/lang/".APP_LANG.".php", $this->langBase); - $this->migrationBase = str_replace("{{PLUGIN_NAME}}", $plugin_name, $this->migrationBase); - $this->migrationBase = str_replace("{{SUB_PLUGIN_NAME}}", $subname, $this->migrationBase); + $this->migrationBase = str_replace("{{PLUGIN_NAME}}", $plugin_name, $this->migrationBase); file_put_contents(DIR_APP.$subname . "/" . $name . "/db/Migrate.php", $this->migrationBase); $this->routeBase = str_replace("{{NAMESPACE}}", $namespace, $this->routeBase); diff --git a/app/core/lang/en.php b/app/core/lang/en.php deleted file mode 100755 index e38514b..0000000 --- a/app/core/lang/en.php +++ /dev/null @@ -1,5 +0,0 @@ -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; } }