One Hat Cyber Team
Your IP :
3.144.29.148
Server IP :
50.28.103.30
Server :
Linux host.jcukjv-lwsites.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
Server Software :
nginx/1.24.0
PHP Version :
8.3.12
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
www
/
wwwroot
/
ef.electronharmony.com
/
app
/
Helpers
/
View File Name :
languageDynamic.php
<?php use Illuminate\Support\Facades\App; use Illuminate\Support\Facades\Session; function getAllResourceFiles($dir, &$results = array()) { $files = scandir($dir); foreach ($files as $key => $value) { $path = $dir . "/" . $value; if (!is_dir($path)) { $results[] = $path; } else if ($value != "." && $value != "..") { getAllResourceFiles($path, $results); } } return $results; } function getRegexBetween($content) { preg_match_all("%\{{__\(['|\"](.*?)['\"]\)}}%i", $content, $matches1, PREG_PATTERN_ORDER); preg_match_all("%\@lang\(['|\"](.*?)['\"]\)%i", $content, $matches2, PREG_PATTERN_ORDER); preg_match_all("%trans\(['|\"](.*?)['\"]\)%i", $content, $matches3, PREG_PATTERN_ORDER); $Alldata = [$matches1[1], $matches2[1], $matches3[1]]; $data = []; foreach ($Alldata as $value) { if (!empty($value)) { foreach ($value as $val) { $data[$val] = $val; } } } return $data; } function generateLang($path = '') { // user panel $paths = getAllResourceFiles(resource_path('views/user')); $paths = array_merge($paths, getAllResourceFiles(resource_path('views/errors'))); $paths = array_merge($paths, getAllResourceFiles(resource_path('views/test'))); // end user panel // user validation $paths = getAllResourceFiles(app_path('Http/Controllers/WEB/User')); $paths = array_merge($paths, getAllResourceFiles(app_path('Http/Controllers/test'))); $paths = array_merge($paths, getAllResourceFiles(app_path('Http/Controllers/Auth'))); // end user validation // admin panel $paths = getAllResourceFiles(resource_path('views/admin')); // end admin panel // admin validation $paths = getAllResourceFiles(app_path('Http/Controllers/WEB/Admin')); $paths = array_merge($paths, getAllResourceFiles(app_path('Http/Controllers/WEB/Seller'))); // end validation $AllData = []; foreach ($paths as $key => $path) { $AllData[] = getRegexBetween(file_get_contents($path)); } $modifiedData = []; foreach ($AllData as $value) { if (!empty($value)) { foreach ($value as $val) { $modifiedData[$val] = $val; } } } $modifiedData = var_export($modifiedData, true); file_put_contents('lang/en/admin_validation.php', "<?php\n return {$modifiedData};\n ?>"); } function html_decode($text) { $after_decode = htmlspecialchars_decode($text, ENT_QUOTES); return $after_decode; } function getSessionLanguage() { if (!Session::has('lang')) { $lang = Session::put('lang', App::getLocale()); } $lang = Session::get('lang'); return $lang; }