From c1f7b2ed2d743aaa299f89b1e5dd6da2eb6ce013 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Wed, 27 Jan 2016 16:52:32 +0100 Subject: [PATCH] PHP7: Fix Zend autoload issues refs #10251 --- library/Icinga/Application/ClassLoader.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/library/Icinga/Application/ClassLoader.php b/library/Icinga/Application/ClassLoader.php index 28dd633fe..4cd165d88 100644 --- a/library/Icinga/Application/ClassLoader.php +++ b/library/Icinga/Application/ClassLoader.php @@ -247,7 +247,7 @@ class ClassLoader /** * Whether given prefix (Forms, Controllers...) makes part of "application" * - * @param string $prefix + * @param string $prefix * * @return boolean */ @@ -291,7 +291,12 @@ class ClassLoader // Return as fast as possible if we already did so. if (substr($class, 0, 5) === 'Zend_') { if (! $this->gotZend) { - $this->requireZendAutoloader(); + $zendLoader = $this->requireZendAutoloader(); + if (version_compare(PHP_VERSION, '7.0.0') >= 0) { + // PHP7 seems to remember the autoload function stack before auto-loading. Thus + // autoload functions registered during autoload never get called + return $zendLoader::autoload($class); + } } return false; }