Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ced974c

Browse filesBrowse files
[ClassLoader] Use symfony/polyfill-apcu
1 parent 54d7f2d commit ced974c
Copy full SHA for ced974c

File tree

4 files changed

+9
-6
lines changed
Filter options

4 files changed

+9
-6
lines changed

‎.travis.yml

Copy file name to clipboardExpand all lines: .travis.yml
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ before_install:
3838
- echo session.gc_probability = 0 >> $INI_FILE
3939
- if [[ $TRAVIS_PHP_VERSION = 5.* ]]; then echo extension = mongo.so >> $INI_FILE; fi;
4040
- 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;
4344
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then echo extension = ldap.so >> $INI_FILE; fi;
4445
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then phpenv config-rm xdebug.ini; fi;
4546
- if [[ $TRAVIS_REPO_SLUG = symfony/symfony ]]; then cp .composer-auth.json ~/.composer/auth.json; fi;

‎composer.json

Copy file name to clipboardExpand all lines: composer.json
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"php": ">=5.3.3",
2020
"doctrine/common": "~2.4",
2121
"paragonie/random_compat": "~1.0",
22+
"symfony/polyfill-apcu": "~1.0,>=1.0.2",
2223
"twig/twig": "~1.23|~2.0",
2324
"psr/log": "~1.0"
2425
},

‎src/Symfony/Component/ClassLoader/ApcClassLoader.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/ClassLoader/ApcClassLoader.php
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class ApcClassLoader
6767
*/
6868
public function __construct($prefix, $decorated)
6969
{
70-
if (!extension_loaded('apc')) {
70+
if (!ini_get('apc.enabled') || ('cli' === PHP_SAPI && !ini_get('apc.enable_cli'))) {
7171
throw new \RuntimeException('Unable to use ApcClassLoader as APC is not enabled.');
7272
}
7373

@@ -122,8 +122,8 @@ public function loadClass($class)
122122
*/
123123
public function findFile($class)
124124
{
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));
127127
}
128128

129129
return $file;

‎src/Symfony/Component/ClassLoader/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Component/ClassLoader/composer.json
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
],
1818
"minimum-stability": "dev",
1919
"require": {
20-
"php": ">=5.3.3"
20+
"php": ">=5.3.3",
21+
"symfony/polyfill-apcu": "~1.0,>=1.0.2"
2122
},
2223
"require-dev": {
2324
"symfony/finder": "~2.0,>=2.0.5"

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.