Skip to content

Commit

Permalink
🔥 Delete ForlderHelper
Browse files Browse the repository at this point in the history
Methods moved to Generator Helper
  • Loading branch information
bjverde committed Mar 18, 2018
1 parent 9d9f066 commit 90662fe
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 62 deletions.
62 changes: 0 additions & 62 deletions classes/FolderHelper.class.php

This file was deleted.

54 changes: 54 additions & 0 deletions classes/TGeneratorHelper.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,60 @@ public static function showMsg($type,$msg){
$msg = $msg.'<br>';
}
return $msg;
}

public static function validateFolderName($nome) {
$is_string = is_string($nome);
$strlen = strlen($nome) > 50;
$preg = preg_match('/^(([a-z]|[0-9]|_)+|)$/', $nome,$matches);
if(!$is_string || $strlen || !$preg){
throw new DomainException(Message::SYSTEM_ACRONYM_INVALID);
}
}

public static function mkDir($path){
if(!is_dir($path)) {
mkdir($path, 0744, true);
}
}

public static function copySystemSkeletonToNewSystem(){
$pathNewSystem = ROOT_PATH.$_SESSION[APLICATIVO]['GEN_SYSTEM_ACRONYM'];
$pathSkeleton = 'system_skeleton';

$list = new RecursiveDirectoryIterator($pathSkeleton);
$it = new RecursiveIteratorIterator($list);

foreach ($it as $file) {
if($it->isFile()){
//echo ' SubPathName: ' . $it->getSubPathName();
//echo ' SubPath: ' . $it->getSubPath()."<br>";
self::mkDir($pathNewSystem.DS.$it->getSubPath());
copy($pathSkeleton.DS.$it->getSubPathName(),$pathNewSystem.DS.$it->getSubPathName());

}
}
}

public static function createFileConstants(){
$file = new TCreateConstants();
$file->saveFile();
}

public static function createFileConfigDataBase(){
$file = new TCreateConfigDataBase();
$file->saveFile();
}

public static function createFileMenu($listTable){
$listTableNames = $listTable['TABLE_NAME'];
$file = new TCreateMenu($listTableNames);
$file->saveFile();
}

public static function createFileIndex(){
$file = new TCreateIndex();
$file->saveFile();
}

public static function getTDAOConect($tableName){
Expand Down

0 comments on commit 90662fe

Please sign in to comment.