Exemplo n.º 1
0
 function execute()
 {
     // Make views
     $files = new files($this->files->getClass());
     $files->setFeature("photo");
     $files->makeFile("crud/view.images", $this->directory . "/views/images.blade.php");
     // Change mainFoto input on read
     $analyzeFile = new analyzeFile($this->directory . "/views/create.blade.php");
     $analyzeFile->waitForFunctions();
     $search = 'name = \'{{$mainFoto}}\'';
     $search = $files->replace($search);
     $line = $analyzeFile->getLineWhere($search);
     $analyzeFile->changeLine($line, "");
     // Remove line
     $analyzeFile->changeLine($line + 1, "");
     $analyzeFile->changeLine($line - 1, "");
     $analyzeFile->changeLine($line - 2, "");
     $res = $analyzeFile->finishWait();
     $analyzeFile = new analyzeFile($this->directory . "/controllers/" . ucfirst($this->files->getClass()->id) . "Controller.php");
     $analyzeFile->waitForFunctions();
     $search = 'Input::get(\'{{$mainFoto}}\')';
     $search = $files->replace($search);
     $analyzeFile->replaceLineWhere($search, "");
     $res = $analyzeFile->finishWait();
     $analyzeFile = new analyzeFile($this->directory . "/views/edit.blade.php");
     $analyzeFile->waitForFunctions();
     $search = '{{$data->{{$mainFoto}}}}';
     $search = $files->replace($search);
     $line = $analyzeFile->getLineWhere($search);
     $analyzeFile->changeLine($line, "");
     // Remove line
     $analyzeFile->changeLine($line + 1, "");
     $analyzeFile->changeLine($line - 1, "");
     $analyzeFile->changeLine($line - 2, "");
     $res = $analyzeFile->finishWait();
     // add in Menu
     $analyzeFile = new analyzeFile("result/theme/views/layouts/master.blade.php");
     $analyzeFile->waitForFunctions();
     $search = '@if(Request::is(\'{{$id}}/*\') && isset($id))';
     $search = $files->replace($search);
     $add = '						<a href="{{url(\'{{$id}}/images\'.\'/\'.$id)}}">Images</a>';
     $add = $files->replace($add);
     $analyzeFile->addAfterLine($search, $add);
     $res = $analyzeFile->finishWait();
 }
Exemplo n.º 2
0
    function execute()
    {
        // Make  files
        $files = new files($this->files->getClass());
        $files->setFeature("user");
        $files->makeFile("crud/filters.user", $this->directory . "/filters.php");
        $files->makeFile("crud/view.login", $this->directory . "/views/login.blade.php");
        // replace texts
        $analyzeFile = new analyzeFile($this->directory . "/models/" . ucfirst($this->files->getClass()->id) . ".php");
        $analyzeFile->waitForFunctions();
        // Change models text
        $replace = 'class {{$name}} extends Eloquent {';
        $replace = $files->replace($replace);
        $for = "use Illuminate\\Auth\\UserInterface;\nuse Illuminate\\Auth\\Reminders\\RemindableInterface;\n\nclass User extends Eloquent implements UserInterface, RemindableInterface {";
        $analyzeFile->replace($replace, $for);
        $res = $analyzeFile->finishWait();
        // Change controllers text
        $analyzeFile = new analyzeFile($this->directory . "/controllers/" . ucfirst($this->files->getClass()->id) . "Controller.php");
        $analyzeFile->waitForFunctions();
        $replace = '{{$name}}::';
        $replace = $files->replace($replace);
        $for = 'User::';
        $for = $files->replace($for);
        $analyzeFile->replace($replace, $for);
        $replace = 'new {{$name}}';
        $replace = $files->replace($replace);
        $for = 'new User';
        $for = $files->replace($for);
        $analyzeFile->replace($replace, $for);
        $res = $analyzeFile->finishWait();
        // Change password input on read
        $analyzeFile = new analyzeFile($this->directory . "/views/read.blade.php");
        $analyzeFile->waitForFunctions();
        $search = '{{$data->{{$password}}}}';
        $search = $files->replace($search);
        $line = $analyzeFile->getLineWhere($search);
        $analyzeFile->changeLine($line, "");
        // Remove line
        $analyzeFile->changeLine($line + 1, "");
        $analyzeFile->changeLine($line - 1, "");
        $analyzeFile->changeLine($line - 2, "");
        $res = $analyzeFile->finishWait();
        // Change password input on update
        $analyzeFile = new analyzeFile($this->directory . "/views/edit.blade.php");
        $analyzeFile->waitForFunctions();
        $search = 'value = \'{{$data->{{$password}}}}\'';
        $search = $files->replace($search);
        $analyzeFile->replace($search, "");
        $res = $analyzeFile->finishWait();
        // add in Menu
        $analyzeFile = new analyzeFile("result/theme/views/layouts/master.blade.php");
        $analyzeFile->waitForFunctions();
        $search = '<a href="#">{{$title}}</a>';
        $search = $files->replace($search);
        $line = $analyzeFile->getLineWhere($search);
        $add = '			    <div class="w3-dropdown-content w3-card-4">
					@if(Auth::check())
				  		<a href="{{url(\'{{$id}}/logout\')}}">Logout</a>
				  	@else
				  		<a href="{{url(\'{{$id}}/login\')}}">Login</a>
				  	@endif
';
        $add = $files->replace($add);
        $analyzeFile->changeLine($line + 1, $add);
        $res = $analyzeFile->finishWait();
    }
Exemplo n.º 3
0
$files->makeFile("explorer/routes", $directorio . "/routes.php");
// Make the json
$files->makeFile("json", $directorio . "/module.json");
// Make the views
$files->makeDirectory($directorio . "/views");
$files->makeFile("explorer/view.home", $directorio . "/views/home.blade.php");
foreach ($classes as $class) {
    // Make models folder and files
    $files = new files($class);
    // Make general directory
    $directorio = $directoriofinal . "/" . $class->id;
    $files->makeDirectory($directorio);
    $name = ucfirst($class->id);
    // Make the model
    $files->makeDirectory($directorio . "/models");
    $files->makeFile("crud/model", $directorio . "/models/" . $name . ".php");
    // Make the controllers
    $files->makeDirectory($directorio . "/controllers");
    $files->makeFile("crud/controller", $directorio . "/controllers/" . $name . "Controller.php");
    // Make the routes
    $files->makeFile("crud/routes", $directorio . "/routes.php");
    // Make the json
    $files->makeFile("json", $directorio . "/module.json");
    // Make the views
    $files->makeDirectory($directorio . "/views");
    foreach ($class->make as $make) {
        $files->makeFile("crud/view.{$make}", $directorio . "/views/{$make}.blade.php");
    }
    $files->addFeatures($directorio);
}
header("Location: index3.html");