updated-packages

This commit is contained in:
RafficMohammed
2023-01-08 00:13:22 +05:30
parent 3ff7df7487
commit da241bacb6
12659 changed files with 563377 additions and 510538 deletions

View File

@@ -22,19 +22,28 @@ use Symfony\Component\HttpKernel\KernelInterface;
class FileLocator extends BaseFileLocator
{
private $kernel;
private $path;
/**
* @param KernelInterface $kernel A KernelInterface instance
* @param string|null $path The path the global resource directory
* @param array $paths An array of paths where to look for resources
* @deprecated since Symfony 4.4
*/
public function __construct(KernelInterface $kernel, string $path = null, array $paths = array())
private $path;
public function __construct(KernelInterface $kernel/* , string $path = null, array $paths = [], bool $triggerDeprecation = true */)
{
$this->kernel = $kernel;
if (null !== $path) {
$this->path = $path;
$paths[] = $path;
if (2 <= \func_num_args()) {
$this->path = func_get_arg(1);
$paths = 3 <= \func_num_args() ? func_get_arg(2) : [];
if (null !== $this->path) {
$paths[] = $this->path;
}
if (4 !== \func_num_args() || func_get_arg(3)) {
@trigger_error(sprintf('Passing more than one argument to %s is deprecated since Symfony 4.4 and will be removed in 5.0.', __METHOD__), \E_USER_DEPRECATED);
}
} else {
$paths = [];
}
parent::__construct($paths);
@@ -46,9 +55,36 @@ class FileLocator extends BaseFileLocator
public function locate($file, $currentPath = null, $first = true)
{
if (isset($file[0]) && '@' === $file[0]) {
return $this->kernel->locateResource($file, $this->path, $first);
return $this->kernel->locateResource($file, $this->path, $first, false);
}
return parent::locate($file, $currentPath, $first);
$locations = parent::locate($file, $currentPath, $first);
if (isset($file[0]) && !(
'/' === $file[0] || '\\' === $file[0]
|| (\strlen($file) > 3 && ctype_alpha($file[0]) && ':' === $file[1] && ('\\' === $file[2] || '/' === $file[2]))
|| null !== parse_url($file, \PHP_URL_SCHEME)
)) {
$deprecation = false;
// no need to trigger deprecations when the loaded file is given as absolute path
foreach ($this->paths as $deprecatedPath) {
foreach ((array) $locations as $location) {
if (null !== $currentPath && str_starts_with($location, $currentPath)) {
return $locations;
}
if (str_starts_with($location, $deprecatedPath) && (null === $currentPath || !str_contains($location, $currentPath))) {
$deprecation = sprintf('Loading the file "%s" from the global resource directory "%s" is deprecated since Symfony 4.4 and will be removed in 5.0.', $file, $deprecatedPath);
}
}
}
if ($deprecation) {
@trigger_error($deprecation, \E_USER_DEPRECATED);
}
}
return $locations;
}
}