diff --git a/app/Console/Commands/RefreshApp.php b/app/Console/Commands/RefreshApp.php deleted file mode 100644 index 9483e1b..0000000 --- a/app/Console/Commands/RefreshApp.php +++ /dev/null @@ -1,162 +0,0 @@ -runPull()) { - - $this->error("An error occurred while executing 'git pull'. \nLogs:"); - - foreach($this->pullLog as $logLine) { - $this->info($logLine); - } - - return; - } - - - if($this->alreadyUpToDate) { - $this->info("The application is already up-to-date"); - return; - } - - - if(!$this->runComposer()) { - - $this->error("Error while updating composer files. \nLogs:"); - - foreach($this->composerLog as $logLine) { - $this->info($logLine); - } - - return; - } - - $this->info("Succesfully updated the application."); - - - } - - - - - /** - * Run git pull process - * - * @return boolean - */ - - private function runPull() - { - $addSafe = Process::fromShellCommandline('git config --global --add safe.directory /var/www/MORBLOX-WEBSITE/morblox-site'); - $addSafe->setWorkingDirectory(base_path()); - $process = Process::fromShellCommandline('git pull'); - $process->setWorkingDirectory(base_path()); - - $this->info("Running 'git pull'"); - - $addSafe->run(function($type, $buffer) { - $this->pullLog[] = $buffer; - }); - - $process->run(function($type, $buffer) { - $this->pullLog[] = $buffer; - - if($buffer == "Already up to date.\n") { - $this->alreadyUpToDate = TRUE; - } - - }); - - return $process->isSuccessful(); - - } - - - - /** - * Run composer install process - * - * @return boolean - */ - - private function runComposer() - { - - $process = new Process(['composer install']); - $this->info("Running 'composer install'"); - - $process->run(function($type, $buffer) { - $this->composerLog[] = $buffer; - }); - - - return $process->isSuccessful(); - - - - } - - -} \ No newline at end of file diff --git a/app/Http/Controllers/AdminController.php b/app/Http/Controllers/AdminController.php index f7c9460..cb1c77c 100644 --- a/app/Http/Controllers/AdminController.php +++ b/app/Http/Controllers/AdminController.php @@ -53,10 +53,4 @@ class AdminController extends Controller return view('admin.tree')->with('data', $data); } - - public function pull() - { - Artisan::call('app:refresh'); - return Artisan::output(); - } } diff --git a/routes/web.php b/routes/web.php index bb9ac01..c7f880f 100644 --- a/routes/web.php +++ b/routes/web.php @@ -71,7 +71,6 @@ Route::group(['middleware' => 'AdminCheck'], function() { Route::get('/iphone/dashboard', [App\Http\Controllers\AdminController::class, 'index'])->name('admin_index'); Route::get('/iphone/users', [App\Http\Controllers\AdminController::class, 'users'])->name('admin_users'); Route::get('/iphone/tree', [App\Http\Controllers\AdminController::class, 'tree'])->name('admin_tree'); - Route::get('/iphone/pull', [App\Http\Controllers\AdminController::class, 'pull'])->name('admin_pull'); }); // Client routes