⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.142
Server IP:
217.76.53.76
Server:
Linux vmi1397931.contaboserver.net 5.4.0-105-generic #119-Ubuntu SMP Mon Mar 7 18:49:24 UTC 2022 x86_64
Server Software:
Apache
PHP Version:
8.2.27
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
www
/
wwwroot
/
wix.com.ng
/
public
/
updater
/
View File Name :
UpdateController.php
recurse_copy($src . '/' . $file, $dst . '/' . $file); } else { copy(base_path($src . '/' . $file), base_path($dst) . '/' . $file); } } } closedir($dir); } public function upversion(Request $request) { $assets = [ ['path' => 'app', 'type' => 'folder', 'action' => 'replace'], ['path' => 'config', 'type' => 'folder', 'action' => 'replace'], ['path' => 'resources/views', 'type' => 'folder', 'action' => 'replace'], ['path' => 'public/assets/front/css/rtl.css', 'type' => 'file', 'action' => 'replace'], ['path' => 'public/assets/front/css/style.css', 'type' => 'file', 'action' => 'replace'], ['path' => 'public/assets/front/js/script.js', 'type' => 'file', 'action' => 'replace'], ['path' => 'public/assets/user-front/js', 'type' => 'folder', 'action' => 'replace'], ['path' => 'public/assets/user-front/css', 'type' => 'folder', 'action' => 'replace'], ['path' => 'routes', 'type' => 'folder', 'action' => 'replace'], ['path' => 'composer.json', 'type' => 'file', 'action' => 'replace'], ['path' => 'composer.lock', 'type' => 'file', 'action' => 'replace'], ['path' => 'version.json', 'type' => 'file', 'action' => 'replace'] ]; foreach ($assets as $key => $asset) { $des = ''; $des = $asset['path']; // if updater need to replace files / folder (with/without content) if ($asset['action'] == 'replace') { if ($asset['type'] == 'file') { copy(base_path('public/updater/' . $asset['path']), base_path($des)); } if ($asset['type'] == 'folder') { $this->delete_directory(base_path($des)); $this->recurse_copy('public/updater/' . $asset['path'], $des); } } elseif ($asset['action'] == 'add') { if ($asset['type'] == 'folder') { $this->recurse_copy('public/updater/' . $asset['path'], $des); } if ($asset['type'] == 'file') { copy(base_path('public/updater/' . $asset['path']), base_path($des)); } } } Session::flash('success', 'Updated successfully'); return redirect('updater/success.php'); } function delete_directory($dirname) { if (!is_dir($dirname)) { return false; } $dir_handle = opendir($dirname); if (!$dir_handle) { return false; } while ($file = readdir($dir_handle)) { if ($file !== '.' && $file !== '..') { $filePath = $dirname . DIRECTORY_SEPARATOR . $file; if (is_dir($filePath)) { $this->delete_directory($filePath); // If in a class, use $this->delete_directory } else { unlink($filePath); } } } closedir($dir_handle); return rmdir($dirname); // Only returns true if directory was successfully removed } }