REDROOM
PHP 8.0.30
Path:
Logout
Edit File
Size: 3.95 KB
Close
/home/certprox/template.certproxywizard.com/wp-content/plugins/hostinger-reach/src/Container.php
Text
Base64
<?php namespace Hostinger\Reach; use Psr\Container\ContainerInterface; use Closure; use ReflectionException; use ReflectionClass; use ReflectionMethod; use Exception; class Container implements ContainerInterface { protected array $entries = array(); protected array $instances = array(); protected array $rules = array(); public function get( mixed $id ): mixed { if ( ! $this->has( $id ) ) { $this->set( $id ); } if ( $this->entries[ $id ] instanceof Closure || is_callable( $this->entries[ $id ] ) ) { return $this->entries[ $id ]( $this ); } if ( isset( $this->rules['shared'] ) && in_array( $id, $this->rules['shared'], true ) ) { return $this->singleton( $id ); } return $this->resolve( $id ); } public function has( mixed $id ): bool { return isset( $this->entries[ $id ] ); } public function set( mixed $entry, mixed $concrete = null ): void { if ( is_null( $concrete ) ) { $concrete = $entry; } $this->entries[ $entry ] = $concrete; } public function resolve( mixed $alias ): mixed { $reflector = $this->getReflector( $alias ); $constructor = $reflector->getConstructor(); if ( $reflector->isInterface() ) { return $this->resolveInterface( $reflector ); } if ( ! $reflector->isInstantiable() ) { throw new Exception( esc_html( "Cannot inject {$reflector->getName()} because it cannot be instantiated" ) ); } if ( $constructor === null ) { return $reflector->newInstance(); } $args = $this->getArguments( $alias, $constructor ); return $reflector->newInstanceArgs( $args ); } public function singleton( mixed $alias ): mixed { if ( ! isset( $this->instances[ $alias ] ) ) { $this->instances[ $alias ] = $this->resolve( $this->entries[ $alias ] ); } return $this->instances[ $alias ]; } public function getReflector( string $alias ): ReflectionClass { $class = $this->entries[ $alias ]; try { return ( new ReflectionClass( $class ) ); } catch ( ReflectionException $e ) { throw new Exception( esc_html( $e->getMessage() ), esc_html( $e->getCode() ) ); } } public function getArguments( mixed $alias, ReflectionMethod $constructor ): array { $args = array(); $params = $constructor->getParameters(); foreach ( $params as $param ) { $type = $param->getType(); if ( $type && ! $type->isBuiltin() ) { $class_name = $type->getName(); $args[] = $this->get( $class_name ); } elseif ( $param->isDefaultValueAvailable() ) { $args[] = $param->getDefaultValue(); } elseif ( isset( $this->rules[ $alias ][ $param->getName() ] ) ) { $args[] = $this->rules[ $alias ][ $param->getName() ]; } } return $args; } public function resolveInterface( ReflectionClass $reflector ): mixed { if ( isset( $this->rules['substitute'][ $reflector->getName() ] ) ) { return $this->get( $this->rules['substitute'][ $reflector->getName() ] ); } $classes = get_declared_classes(); foreach ( $classes as $class ) { $rf = new ReflectionClass( $class ); if ( $rf->implementsInterface( $reflector->getName() ) ) { return $this->get( $rf->getName() ); } } throw new Exception( esc_html( "Class {$reflector->getName()} not found" ), 1 ); } public function configure( array $config ): static { $this->rules = array_merge( $this->rules, $config ); return $this; } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 12 × Files: 3
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
Admin
DIR
-
drwxr-xr-x
2026-06-14 00:14:19
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Amplitude
DIR
-
drwxr-xr-x
2026-06-14 00:14:19
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Api
DIR
-
drwxr-xr-x
2026-06-14 00:14:19
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Blocks
DIR
-
drwxr-xr-x
2026-06-14 00:14:19
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Dto
DIR
-
drwxr-xr-x
2026-06-14 00:14:19
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Integrations
DIR
-
drwxr-xr-x
2026-06-14 00:14:19
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Jobs
DIR
-
drwxr-xr-x
2026-06-14 00:14:19
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Models
DIR
-
drwxr-xr-x
2026-06-14 00:14:19
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Providers
DIR
-
drwxr-xr-x
2026-06-14 00:14:19
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Repositories
DIR
-
drwxr-xr-x
2026-06-14 00:14:19
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Setup
DIR
-
drwxr-xr-x
2026-06-14 00:14:19
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Tracking
DIR
-
drwxr-xr-x
2026-06-14 00:14:19
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Boot.php
2.63 KB
lrw-r--r--
2026-06-10 16:30:30
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Container.php
3.95 KB
lrw-r--r--
2026-06-10 16:30:30
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Functions.php
6.52 KB
lrw-r--r--
2026-06-10 16:30:30
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).