mirror of
https://github.com/danog/PHP-Parser.git
synced 2024-11-27 12:24:39 +01:00
d225555830
Running a .phar or regular PHP executable that requires and includes its own version of php-parser will cause a "cannot redeclare class" error if said executable also includes the autoloader of the current working directory.
7 lines
139 B
PHP
7 lines
139 B
PHP
<?php
|
|
|
|
if (!class_exists('PhpParser\Autoloader')) {
|
|
require __DIR__ . '/PhpParser/Autoloader.php';
|
|
}
|
|
PhpParser\Autoloader::register();
|