namespace Pterodactyl\Console\Commands; use Illuminate\Console\Command; use Symfony\Component\Console\Formatter\OutputFormatterStyle; use Illuminate\Support\Facades\File; use Illuminate\Support\Facades\Http; class Arix extends Command { protected $signature = "arix {action?}"; protected $description = "All commands for Arix Theme for Pterodactyl."; public function handle() { goto Omlao; fbU_n: goto s_DEk; goto udmft; KgMOK: $this->update(); goto eH1PN; Aq2ZR: $title = new OutputFormatterStyle("#fff", null, ["bold"]); goto HCFtT; ncau6: $this->uninstall(); goto Y0O1J; Y0O1J: s_DEk: goto ernVW; JyXmT: d5RRM: goto KgMOK; Omlao: $action = $this->argument("action"); goto Aq2ZR; CgWTi: if ($action === "uninstall") { goto LrCGm; } goto GNIaR; zpxUR: LrCGm: goto ncau6; HCFtT: $this->output->getFormatter()->setStyle("title", $title); goto O4_r4; udmft: A43uv: goto H87eZ; ZxF1g: Ncosn: goto QpaNY; JsH4s: goto s_DEk; goto ZxF1g; dNvBo: if ($action === "install") { goto Ncosn; } goto akewD; SZd_M: goto s_DEk; goto JyXmT; H87eZ: $this->line("\xd
<title>\xd\xa ░█████╗░██████╗░██╗██╗░░██╗\xd
██╔══██╗██╔══██╗██║╚██╗██╔╝
███████║██████╔╝██║░╚███╔╝░
██╔══██║██╔══██╗██║░██╔██╗░\xd\xa ██║░░██║██║░░██║██║██╔╝╚██╗\xd
╚═╝░░╚═╝╚═╝░░╚═╝╚═╝╚═╝░░╚═╝
\xd\xa Thank you for purchasing Arix</title>
\xd
> php artisan arix (this window)\xd\xa > php artisan arix install
\xa > php artisan arix update
> php artisan arix uninstall
"); goto JsH4s; GNIaR: $this->error("Invalid action. Supported actions: install, update, uninstall"); goto fbU_n; l54ap: $this->output->getFormatter()->setStyle("b", $b); goto bbxp7; QpaNY: $this->install(); goto SZd_M; bbxp7: if ($action === null) { goto A43uv; } goto dNvBo; akewD: if ($action === "update") { goto d5RRM; } goto CgWTi; eH1PN: goto s_DEk; goto zpxUR; O4_r4: $b = new OutputFormatterStyle(null, null, ["bold"]); goto l54ap; ernVW: } public function installOrUpdate($isUpdate = false) { goto i7Ybj; gsrbK: $confirmation = $this->confirm("Are all the required dependencies installed from the readme file?", "yes"); goto z3b7s; hc3KY: File::makeDirectory($directoryPath, 0755, true, true); goto H262M; qj6w3: $this->info("Installing Arix Theme {$version}..."); goto crGah; tAquy: fekHO: goto lotbV; jr19L: $respond = "success"; goto v6NpE; Kumlh: return; goto TiGUE; APRfy: $responseData = $response->json(); goto X5NuZ; lK69n: $this->info("Installing required packages..."); goto Ltq1y; JzBzQ: kPKUx: goto aHZOm; X5NuZ: if ($responseData[$respond]) { goto ZZQ9f; } goto C2CP3; GIwUl: putenv("export NODE_OPTIONS=--openssl-legacy-provider"); goto p3ZXK; Vaq8V: $this->command("chown -R apache:apache " . base_path() . "/*"); goto ALVh5; CXq3w: ZZQ9f: goto Zto61; f6GlV: $this->command("yarn add cronstrue jszip react-turnstile @dnd-kit/core @dnd-kit/sortable @dnd-kit/utilities @types/md5 md5 react-icons@5.4p markdown-to-jsx@7.7.10 i18next-browser-languagedetector@7.2.1"); goto p6Erv; i1f__: exec("rsync -a {$excludeOption} arix/{$version}/ ./"); goto zqK2c; n8ISb: foreach ($filesTwo as $file) { goto YyDxW; v0cBg: sleep(1); goto mC5tF; mC5tF: tjnv4: goto hrczV; YyDxW: $this->aa($file, $version, $directoryPath); goto v0cBg; hrczV: } goto JzBzQ; xRU5Q: $this->command("php artisan migrate --force"); goto lK69n; crGah: $excludeOption = $isUpdate ? "--exclude='routes.ts' --exclude='getServer.ts' --exclude='admin.blade.php' --exclude='admin.php' --exclude='ServerTransformer.php'" : ''; goto i1f__; Y2g4H: $this->info("
\xa This command is not recommended to use. \xd
This command skips frequently used files by addons during theme updating to avoid losing your addon customizations.
\xa If you still experience an error after updating please contact us."); goto H_7D3; Q7FpE: if ($nodeVersion >= 17) { goto fekHO; } goto b012m; rh2EJ: if (!empty($versions)) { goto bVvcn; } goto JvFt1; cIqJp: $this->command("php artisan optimize:clear"); goto dshHu; Jv2T5: $this->command("chown -R www-data:www-data " . base_path() . "/*"); goto neB32; mZOaN: $this->info("Set permissions..."); goto Jv2T5; SEGzR: FTiSB: goto FDthd; i7Ybj: if (!$isUpdate) { goto Dx80j; } goto Y2g4H; Ltq1y: $this->info("This can take a minute..."); goto f6GlV; H262M: $filesOne = ["ArixController", "ArixAdvancedController", "ArixAnnouncementController", "ArixColorsController", "ArixDashboardController", "ArixSocialController"]; goto q9IGk; gr62W: $this->line("
\xa ╭───────────────────────────────╮
\xa │ │\xd
{$message}\xd\xa │ ╰─╴ successfully ╶─╯ │
\xa │ │
╰───────────────────────────────╯
"); goto CqyvB; q9IGk: $this->info("Proceeding with the installation..."); goto NIjHE; ZCt99: $nodeVersion = (int) ltrim($nodeVersion, "v"); goto Q7FpE; Zto61: $versions = File::directories("./arix"); goto rh2EJ; Q_lca: $this->info("Migrating database..."); goto xRU5Q; neB32: $this->command("chown -R nginx:nginx " . base_path() . "/*"); goto Vaq8V; FDthd: $endpoint = "https://arix.gg/license/arix-theme"; goto jr19L; HXccx: $message = $isUpdate ? "│ ╭─╴ Theme updated ╶─╮ │" : "│ ╭─╴ Theme installed ╶─╮ │"; goto gr62W; aHZOm: $this->info("Compile translations..."); goto LN_4U; LN_4U: $this->command("php artisan language:compile"); goto kfDzt; A7_Dp: $nodeVersion = shell_exec("node -v"); goto ZCt99; p3ZXK: x_kR7: goto VI_mg; Dyu1o: $this->info("This can take a minute..."); goto A7_Dp; VI_mg: $this->command("yarn build:production"); goto mZOaN; b012m: $this->info("Node.js version is v" . $nodeVersion . " (< )"); goto hSQD9; kfDzt: $this->info("Building panel assets..."); goto Dyu1o; zqK2c: $directoryPath = app_path("Http/Controllers/Admin/Arix"); goto hc3KY; JvFt1: $this->info("No versions found in /arix directory."); goto Kumlh; v6NpE: $response = Http::asForm()->post($endpoint, ["license" => config("arixTheme.license")]); goto APRfy; dshHu: $this->command("php artisan optimize"); goto HXccx; z3b7s: if ($confirmation) { goto FTiSB; } goto Y1Xh8; hSQD9: goto x_kR7; goto tAquy; lotbV: $this->info("Node.js version is v" . $nodeVersion . " (>= 17)"); goto GIwUl; p6Erv: foreach ($filesOne as $file) { goto rJORT; go3WU: Cr9Qa: goto RHIxU; rJORT: $this->aa($file, $version, $directoryPath); goto Fk4GM; Fk4GM: sleep(1); goto go3WU; RHIxU: } goto gPKRG; C2CP3: return $this->error("License is invalid, please make sure you have entered the correct license key in the configuration file."); goto CXq3w; gPKRG: uiYZp: goto n8ISb; ALVh5: $this->info("Optimize application..."); goto cIqJp; TiGUE: bVvcn: goto JotQZ; H_7D3: Dx80j: goto gsrbK; Y1Xh8: return; goto SEGzR; NIjHE: $filesTwo = ["ArixComponentsController", "ArixLayoutController", "ArixMailController", "ArixMetaController", "ArixStylingController"]; goto Q_lca; JotQZ: $version = basename($this->choice("Select a version:", $versions)); goto qj6w3; CqyvB: } private function aa($filename, $version, $directoryPath) { goto zfGeI; BIGCe: $this->error("Fail, please contact Weijers.one."); goto uariS; DC2mP: $response = Http::get($url); goto FFlCF; uariS: goto GGvvB; goto oBWej; Dyg8t: File::put($filePath, $response->body()); goto Ns5hR; xItB9: $filePath = $directoryPath . "/" . $filename . ".php"; goto Dyg8t; Ns5hR: GGvvB: goto UbJ1N; oBWej: Au36X: goto xItB9; zfGeI: $url = "https://arix.gg/internal/" . $version . "/" . $filename . ".php"; goto DC2mP; FFlCF: if ($response->successful()) { goto Au36X; } goto BIGCe; UbJ1N: } public function install() { $this->installOrUpdate(); } public function update() { $this->installOrUpdate(true); } private function uninstall() { goto nDDMf; nDDMf: $this->line("Uninstalling..."); goto gYQr6; D0KzV: $this->command("php artisan config:clear"); goto k_W7H; rHilx: $this->command("php artisan queue:restart"); goto JO9pb; IvdH8: $this->command("chmod -R 5 storage/* bootstrap/cache"); goto t3ISL; W3IL6: $this->command("php artisan config:clear"); goto D0KzV; mi1vf: $this->command("curl -L https://github.com/pterodactyl/panel/releases/latest/download/panel.tar.gz | tar -xzv"); goto IvdH8; wbuAr: $this->command("chown -R apache:apache " . base_path() . "/*"); goto rHilx; gYQr6: $this->command("php artisan down"); goto mi1vf; t3ISL: $this->command("composer install --no-dev --optimize-autoloader"); goto NmYSi; Jwqna: $this->command("chown -R www-data:www-data " . base_path() . "/*"); goto JCdvq; k_W7H: $this->command("php artisan migrate --seed --force"); goto Jwqna; JCdvq: $this->command("chown -R nginx:nginx " . base_path() . "/*"); goto wbuAr; JO9pb: $this->command("php artisan up"); goto zb09Q; NmYSi: $this->command("php artisan view:clear"); goto W3IL6; zb09Q: } private function command($cmd) { return exec($cmd); } }
© 2023 Quttera Ltd. All rights reserved.