Exemple #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();
 }
Exemple #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();
    }