Ajusting core modules

This commit is contained in:
2022-01-23 19:15:33 +00:00
parent 1bbfcb3a89
commit a98e31ba9f
4 changed files with 12 additions and 38 deletions
+5 -7
View File
@@ -15,8 +15,7 @@ class GeneratorController {
<?php
use Schema\Wrapper as Wrapper;
use \App\Core\Sanity\MigratorController as Migrator;
function {{PLUGIN_NAME}}_upgrade(\$pluginversion) {
if (\$pluginversion < "0.0.1") {
\$table = Wrapper::get_table("{{PLUGIN_NAME}}");
@@ -27,20 +26,20 @@ class GeneratorController {
\$table->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);