Skip to content

Commit

Permalink
Use the realpath to require the error files as HHVM does not resolve …
Browse files Browse the repository at this point in the history
…them in phars

This avoids loading the file twice on HHVM because it considers the 2 paths to be different even though they reference the same file when normalized.
Refs sebastianbergmann#1684
  • Loading branch information
stof committed Apr 29, 2015
1 parent 27d119a commit bf5d323
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Util/ErrorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@

// Workaround for http://bugs.php.net/bug.php?id=47987,
// see https://github.com/sebastianbergmann/phpunit/issues#issue/125 for details
require_once __DIR__ . '/../Framework/Error.php';
require_once __DIR__ . '/../Framework/Error/Notice.php';
require_once __DIR__ . '/../Framework/Error/Warning.php';
require_once __DIR__ . '/../Framework/Error/Deprecated.php';
// Use dirname(__DIR__) instead of using /../ because of https://github.com/facebook/hhvm/issues/5215
require_once dirname(__DIR__) . '/Framework/Error.php';
require_once dirname(__DIR__) . '/Framework/Error/Notice.php';
require_once dirname(__DIR__) . '/Framework/Error/Warning.php';
require_once dirname(__DIR__) . '/Framework/Error/Deprecated.php';

/**
* Error handler that converts PHP errors and warnings to exceptions.
Expand Down

0 comments on commit bf5d323

Please sign in to comment.