Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
EZP-15983 - Only include ezp_override when present (#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!
  • Loading branch information
alexwilson authored and andrerom committed Mar 15, 2017
1 parent 3dbdb78 commit a5838bd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion autoload.php
Expand Up @@ -120,7 +120,8 @@ public static function autoload( $className )
{
// won't work, as eZDebug isn't initialized yet at that time
// eZDebug::writeError( "Kernel override is enabled, but var/autoload/ezp_override.php has not been generated\nUse bin/php/ezpgenerateautoloads.php -o", 'autoload.php' );
if ( $ezpKernelOverrideClasses = include __DIR__ . '/var/autoload/ezp_override.php' )
$ezpKernelOverridePath = __DIR__ . '/var/autoload/ezp_override.php';
if ( file_exists( $ezpKernelOverridePath ) && $ezpKernelOverrideClasses = include $ezpKernelOverridePath )
{
self::$ezpClasses = array_merge( self::$ezpClasses, $ezpKernelOverrideClasses );
}
Expand Down

0 comments on commit a5838bd

Please sign in to comment.