|
|
@@ -125,15 +125,15 @@ class GeneratorController {
|
|
|
EOL;
|
|
|
|
|
|
function createPluginFromTemplate($subname, $name){
|
|
|
- if (is_dir( DIR_MODULE.$subname . '/' . $name )){
|
|
|
+ if (is_dir( DIR_APP.$subname . '/' . $name )){
|
|
|
echo 'Treco ja existe';
|
|
|
return;
|
|
|
}else{
|
|
|
- mkdir(DIR_MODULE.$subname . '/' . $name, 0755, true);
|
|
|
- mkdir(DIR_MODULE.$subname . '/' . $name . '/lang', 0755, true);
|
|
|
- mkdir(DIR_MODULE.$subname . '/' . $name . '/classes', 0755, true);
|
|
|
- mkdir(DIR_MODULE.$subname . '/' . $name . '/db', 0755, true);
|
|
|
- mkdir(DIR_MODULE.$subname . '/' . $name . '/views', 0755, true);
|
|
|
+ mkdir(DIR_APP.$subname . '/' . $name, 0755, true);
|
|
|
+ mkdir(DIR_APP.$subname . '/' . $name . '/lang', 0755, true);
|
|
|
+ mkdir(DIR_APP.$subname . '/' . $name . '/classes', 0755, true);
|
|
|
+ mkdir(DIR_APP.$subname . '/' . $name . '/db', 0755, true);
|
|
|
+ mkdir(DIR_APP.$subname . '/' . $name . '/views', 0755, true);
|
|
|
}
|
|
|
|
|
|
$plugin_name = $name;
|
|
|
@@ -143,23 +143,23 @@ class GeneratorController {
|
|
|
|
|
|
$this->langBase = str_replace("{{PLUGIN_NAME}}", $plugin_name, $this->langBase);
|
|
|
$this->langBase = str_replace("{{PLUGIN_NAME_PRETTY}}", $plugin_name_pretty, $this->langBase);
|
|
|
- file_put_contents(DIR_MODULE.$subname . '/' . $name . '/lang/en.php', $this->langBase);
|
|
|
- file_put_contents(DIR_MODULE.$subname . '/' . $name . '/lang/'.APP_LANG.'.php', $this->langBase);
|
|
|
+ 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);
|
|
|
- file_put_contents(DIR_MODULE.$subname . '/' . $name . '/db/Migrate.php', $this->migrationBase);
|
|
|
+ file_put_contents(DIR_APP.$subname . '/' . $name . '/db/Migrate.php', $this->migrationBase);
|
|
|
|
|
|
$this->routeBase = str_replace("{{PLUGIN_NAME}}", $plugin_name, $this->routeBase);
|
|
|
$this->routeBase = str_replace("{{CONTROLLER}}", $controller, $this->routeBase);
|
|
|
- file_put_contents(DIR_MODULE.$subname . '/' . $name . '/Routes.php', $this->routeBase);
|
|
|
+ file_put_contents(DIR_APP.$subname . '/' . $name . '/Routes.php', $this->routeBase);
|
|
|
|
|
|
$this->objectBase = str_replace("{{OBJECT}}", $object, $this->objectBase);
|
|
|
$this->objectBase = str_replace("{{TABLE_NAME}}", $name, $this->objectBase);
|
|
|
- file_put_contents(DIR_MODULE.$subname . '/' . $name . "/classes/$object.php", $this->objectBase);
|
|
|
+ file_put_contents(DIR_APP.$subname . '/' . $name . "/classes/$object.php", $this->objectBase);
|
|
|
|
|
|
$this->controllerBase = str_replace("{{OBJECT}}", $object, $this->controllerBase);
|
|
|
$this->controllerBase = str_replace("{{CONTROLLER}}", $controller, $this->controllerBase);
|
|
|
- file_put_contents(DIR_MODULE.$subname . '/' . $name . "/$controller.php", $this->controllerBase);
|
|
|
+ file_put_contents(DIR_APP.$subname . '/' . $name . "/$controller.php", $this->controllerBase);
|
|
|
|
|
|
|
|
|
}
|