From 4cecdcd2ae4a2ccf1addba474f90248bdf4bb485 Mon Sep 17 00:00:00 2001 From: Aazhar Date: Mon, 22 Feb 2021 19:58:57 +0100 Subject: [PATCH 1/2] added prepend parameter for the autoload register when using some other auto-loaders, we would like to prepend doctrine autoloader to avoid errors --- lib/Doctrine/Common/Proxy/Autoloader.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Doctrine/Common/Proxy/Autoloader.php b/lib/Doctrine/Common/Proxy/Autoloader.php index 58d221af7..fea6c5db0 100644 --- a/lib/Doctrine/Common/Proxy/Autoloader.php +++ b/lib/Doctrine/Common/Proxy/Autoloader.php @@ -62,12 +62,13 @@ public static function resolveFile($proxyDir, $proxyNamespace, $className) * @param string $proxyDir * @param string $proxyNamespace * @param callable|null $notFoundCallback Invoked when the proxy file is not found. + * @param bool $prepend if true prepend the autoloader on the autoload queue instead of appending it * * @return Closure * * @throws InvalidArgumentException */ - public static function register($proxyDir, $proxyNamespace, $notFoundCallback = null) + public static function register($proxyDir, $proxyNamespace, $notFoundCallback = null, $prepend = false) { $proxyNamespace = ltrim($proxyNamespace, '\\'); @@ -93,7 +94,7 @@ public static function register($proxyDir, $proxyNamespace, $notFoundCallback = require $file; }; - spl_autoload_register($autoloader); + spl_autoload_register($autoloader, true, $prepend); return $autoloader; } From 933a0eaf9c4c19c5dad61fce35ce60d393077717 Mon Sep 17 00:00:00 2001 From: Achraf Azhar Date: Sat, 27 Feb 2021 17:28:26 +0100 Subject: [PATCH 2/2] fix docblock. --- lib/Doctrine/Common/Proxy/Autoloader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Doctrine/Common/Proxy/Autoloader.php b/lib/Doctrine/Common/Proxy/Autoloader.php index fea6c5db0..ca3188a9a 100644 --- a/lib/Doctrine/Common/Proxy/Autoloader.php +++ b/lib/Doctrine/Common/Proxy/Autoloader.php @@ -62,7 +62,7 @@ public static function resolveFile($proxyDir, $proxyNamespace, $className) * @param string $proxyDir * @param string $proxyNamespace * @param callable|null $notFoundCallback Invoked when the proxy file is not found. - * @param bool $prepend if true prepend the autoloader on the autoload queue instead of appending it + * @param bool $prepend if true prepend the autoloader on the autoload queue instead of appending it * * @return Closure *