|
@@ -39,11 +39,17 @@ set_error_handler(function ($severity, $message, $file, $line) {
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
-try {
|
|
+$require = true;
|
|
|
|
+if (class_exists('Phar')) {
|
|
// Maybe this file is used as phar-stub? Let's try!
|
|
// Maybe this file is used as phar-stub? Let's try!
|
|
- Phar::mapPhar('php-cs-fixer.phar');
|
|
+ try {
|
|
- require_once 'phar://php-cs-fixer.phar/vendor/autoload.php';
|
|
+ Phar::mapPhar('php-cs-fixer.phar');
|
|
-} catch (PharException $e) {
|
|
+ require_once 'phar://php-cs-fixer.phar/vendor/autoload.php';
|
|
|
|
+ $require = false;
|
|
|
|
+ } catch (PharException $e) {
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+if ($require) {
|
|
// OK, it's not, let give Composer autoloader a try!
|
|
// OK, it's not, let give Composer autoloader a try!
|
|
if (file_exists($a = __DIR__.'/../../autoload.php')) {
|
|
if (file_exists($a = __DIR__.'/../../autoload.php')) {
|
|
require_once $a;
|
|
require_once $a;
|
|
@@ -51,6 +57,7 @@ try {
|
|
require_once __DIR__.'/vendor/autoload.php';
|
|
require_once __DIR__.'/vendor/autoload.php';
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+unset($require);
|
|
|
|
|
|
use PhpCsFixer\Console\Application;
|
|
use PhpCsFixer\Console\Application;
|
|
|
|
|