File tree 4 files changed +9
-6
lines changed
src/Symfony/Component/ClassLoader
4 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -38,8 +38,9 @@ before_install:
38
38
- echo session.gc_probability = 0 >> $INI_FILE
39
39
- if [[ $TRAVIS_PHP_VERSION = 5.* ]]; then echo extension = mongo.so >> $INI_FILE; fi;
40
40
- if [[ $TRAVIS_PHP_VERSION = 5.* ]]; then echo extension = memcache.so >> $INI_FILE; fi;
41
- - if [[ $TRAVIS_PHP_VERSION = 5.* ]]; then (echo yes | pecl install -f apcu-4.0.10 && echo apc.enable_cli = 1 >> $INI_FILE) || echo "Let's continue without apcu extension"; fi;
42
- - if [[ $TRAVIS_PHP_VERSION = 5.* ]]; then pecl install -f memcached-2.1.0 || echo "Let's continue without memcached extension"; fi;
41
+ - if [[ $TRAVIS_PHP_VERSION = 5.* ]]; then (echo yes | pecl install -f apcu-4.0.10 && echo apc.enable_cli = 1 >> $INI_FILE); fi;
42
+ - if [[ $TRAVIS_PHP_VERSION = 7.* ]]; then (echo yes | pecl install -f apcu-5.1.2 && echo apc.enable_cli = 1 >> $INI_FILE); fi;
43
+ - if [[ $TRAVIS_PHP_VERSION = 5.* ]]; then pecl install -f memcached-2.1.0; fi;
43
44
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then echo extension = ldap.so >> $INI_FILE; fi;
44
45
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then phpenv config-rm xdebug.ini; fi;
45
46
- if [[ $TRAVIS_REPO_SLUG = symfony/symfony ]]; then cp .composer-auth.json ~/.composer/auth.json; fi;
Original file line number Diff line number Diff line change 18
18
"require" : {
19
19
"php" : " >=5.3.3" ,
20
20
"doctrine/common" : " ~2.4" ,
21
+ "symfony/polyfill-apcu" : " ~1.0,>=1.0.2" ,
21
22
"twig/twig" : " ~1.23|~2.0" ,
22
23
"psr/log" : " ~1.0"
23
24
},
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ class ApcClassLoader
67
67
*/
68
68
public function __construct ($ prefix , $ decorated )
69
69
{
70
- if (!extension_loaded ('apc ' )) {
70
+ if (!ini_get ('apc.enabled ' ) || ( ' cli ' === PHP_SAPI && ! ini_get ( ' apc.enable_cli ' ) )) {
71
71
throw new \RuntimeException ('Unable to use ApcClassLoader as APC is not enabled. ' );
72
72
}
73
73
@@ -122,8 +122,8 @@ public function loadClass($class)
122
122
*/
123
123
public function findFile ($ class )
124
124
{
125
- if (false === $ file = apc_fetch ($ this ->prefix .$ class )) {
126
- apc_store ($ this ->prefix .$ class , $ file = $ this ->decorated ->findFile ($ class ));
125
+ if (false === $ file = apcu_fetch ($ this ->prefix .$ class )) {
126
+ apcu_store ($ this ->prefix .$ class , $ file = $ this ->decorated ->findFile ($ class ));
127
127
}
128
128
129
129
return $ file ;
Original file line number Diff line number Diff line change 17
17
],
18
18
"minimum-stability" : " dev" ,
19
19
"require" : {
20
- "php" : " >=5.3.3"
20
+ "php" : " >=5.3.3" ,
21
+ "symfony/polyfill-apcu" : " ~1.0,>=1.0.2"
21
22
},
22
23
"require-dev" : {
23
24
"symfony/finder" : " ~2.0,>=2.0.5"
You can’t perform that action at this time.
0 commit comments