Skip to content
This repository was archived by the owner on Feb 3, 2022. It is now read-only.

Commit c58d8fe

Browse files
committed
Merge branch 'hotfix/8-fatal-error-cannot-redeclare-class'
2 parents bcdaa84 + af2a72f commit c58d8fe

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

bin/magedbm

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
<?php
22

3+
// Avoid APC causing random fatal errors per https://github.com/composer/composer/issues/264
4+
if (extension_loaded('apc') && ini_get('apc.enable_cli') && ini_get('apc.cache_by_default')) {
5+
if (version_compare(phpversion('apc'), '3.0.12', '>=')) {
6+
ini_set('apc.cache_by_default', 0);
7+
} else {
8+
fwrite(STDERR, 'Warning: APC <= 3.0.12 may cause fatal errors when running composer commands.'.PHP_EOL);
9+
fwrite(STDERR, 'Update APC, or set apc.enable_cli or apc.cache_by_default to 0 in your php.ini.'.PHP_EOL);
10+
}
11+
}
12+
313
$autoload_files = array(
414
__DIR__ . '/../vendor/autoload.php'
515
);

0 commit comments

Comments
 (0)