Skip to content

Commit a5838bd

Browse files
alexwilsonandrerom
authored andcommitted
EZP-15983 - Only include ezp_override when present (ezsystems#1270)
When generating autoloads on a fresh ezpublish-legacy install through Symfony, the missing file raises a notice which is caught by the Symfony exception handler - This means that the autoloads can't be generated through Symfony, unless they have previously been generated by legacy. This change is trivial and mitigates the issue. Duplicate/response to https://jira.ez.no/browse/EZP-15983 - Please don't hate me for using a file_exists @bdunogier!
1 parent 3dbdb78 commit a5838bd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

autoload.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ public static function autoload( $className )
120120
{
121121
// won't work, as eZDebug isn't initialized yet at that time
122122
// eZDebug::writeError( "Kernel override is enabled, but var/autoload/ezp_override.php has not been generated\nUse bin/php/ezpgenerateautoloads.php -o", 'autoload.php' );
123-
if ( $ezpKernelOverrideClasses = include __DIR__ . '/var/autoload/ezp_override.php' )
123+
$ezpKernelOverridePath = __DIR__ . '/var/autoload/ezp_override.php';
124+
if ( file_exists( $ezpKernelOverridePath ) && $ezpKernelOverrideClasses = include $ezpKernelOverridePath )
124125
{
125126
self::$ezpClasses = array_merge( self::$ezpClasses, $ezpKernelOverrideClasses );
126127
}

0 commit comments

Comments
 (0)