From 5f9ed170916737ba68ee07cfcd53f703a5d332aa Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Thu, 31 Dec 2015 11:47:50 -0700 Subject: [PATCH] Added support for APCu and PHP 7.0 --- composer.lock | 74 +++++++++++++++++--------------- system/src/Grav/Common/Cache.php | 8 +++- 2 files changed, 47 insertions(+), 35 deletions(-) diff --git a/composer.lock b/composer.lock index 0db4f5797..ca99857dc 100644 --- a/composer.lock +++ b/composer.lock @@ -9,33 +9,33 @@ "packages": [ { "name": "doctrine/cache", - "version": "v1.5.4", + "version": "v1.6.0", "source": { "type": "git", "url": "https://github.com/doctrine/cache.git", - "reference": "47cdc76ceb95cc591d9c79a36dc3794975b5d136" + "reference": "f8af318d14bdb0eff0336795b428b547bd39ccb6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/47cdc76ceb95cc591d9c79a36dc3794975b5d136", - "reference": "47cdc76ceb95cc591d9c79a36dc3794975b5d136", + "url": "https://api.github.com/repos/doctrine/cache/zipball/f8af318d14bdb0eff0336795b428b547bd39ccb6", + "reference": "f8af318d14bdb0eff0336795b428b547bd39ccb6", "shasum": "" }, "require": { - "php": ">=5.3.2" + "php": "~5.5|~7.0" }, "conflict": { "doctrine/common": ">2.2,<2.4" }, "require-dev": { - "phpunit/phpunit": ">=3.7", + "phpunit/phpunit": "~4.8|~5.0", "predis/predis": "~1.0", "satooshi/php-coveralls": "~0.6" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.5.x-dev" + "dev-master": "1.6.x-dev" } }, "autoload": { @@ -75,7 +75,7 @@ "cache", "caching" ], - "time": "2015-12-19 05:03:47" + "time": "2015-12-31 16:37:02" }, { "name": "donatj/phpuseragentparser", @@ -726,16 +726,16 @@ }, { "name": "symfony/console", - "version": "v2.8.0", + "version": "v2.8.1", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "d232bfc100dfd32b18ccbcab4bcc8f28697b7e41" + "reference": "2e06a5ccb19dcf9b89f1c6a677a39a8df773635a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/d232bfc100dfd32b18ccbcab4bcc8f28697b7e41", - "reference": "d232bfc100dfd32b18ccbcab4bcc8f28697b7e41", + "url": "https://api.github.com/repos/symfony/console/zipball/2e06a5ccb19dcf9b89f1c6a677a39a8df773635a", + "reference": "2e06a5ccb19dcf9b89f1c6a677a39a8df773635a", "shasum": "" }, "require": { @@ -782,11 +782,11 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2015-11-30 12:35:10" + "time": "2015-12-22 10:25:57" }, { "name": "symfony/event-dispatcher", - "version": "v2.8.0", + "version": "v2.8.1", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", @@ -846,21 +846,24 @@ }, { "name": "symfony/polyfill-iconv", - "version": "v1.0.0", + "version": "v1.0.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-iconv.git", - "reference": "21a18998764e569c1675efc7191887130b319605" + "reference": "541cce29a46d6ee18bb9271c6ac3ca783b0faab0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/21a18998764e569c1675efc7191887130b319605", - "reference": "21a18998764e569c1675efc7191887130b319605", + "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/541cce29a46d6ee18bb9271c6ac3ca783b0faab0", + "reference": "541cce29a46d6ee18bb9271c6ac3ca783b0faab0", "shasum": "" }, "require": { "php": ">=5.3.3" }, + "suggest": { + "ext-iconv": "For best performance" + }, "type": "library", "extra": { "branch-alias": { @@ -898,25 +901,28 @@ "portable", "shim" ], - "time": "2015-11-04 20:28:58" + "time": "2015-11-20 09:19:13" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.0.0", + "version": "v1.0.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "0b6a8940385311a24e060ec1fe35680e17c74497" + "reference": "49ff736bd5d41f45240cec77b44967d76e0c3d25" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0b6a8940385311a24e060ec1fe35680e17c74497", - "reference": "0b6a8940385311a24e060ec1fe35680e17c74497", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/49ff736bd5d41f45240cec77b44967d76e0c3d25", + "reference": "49ff736bd5d41f45240cec77b44967d76e0c3d25", "shasum": "" }, "require": { "php": ">=5.3.3" }, + "suggest": { + "ext-mbstring": "For best performance" + }, "type": "library", "extra": { "branch-alias": { @@ -954,20 +960,20 @@ "portable", "shim" ], - "time": "2015-11-04 20:28:58" + "time": "2015-11-20 09:19:13" }, { "name": "symfony/var-dumper", - "version": "v2.8.0", + "version": "v2.8.1", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "e6f3855005f2bfad7d7e72431d374a6478893fe3" + "reference": "f943f29ae69c42511a2d85adee9d13d835b5c803" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/e6f3855005f2bfad7d7e72431d374a6478893fe3", - "reference": "e6f3855005f2bfad7d7e72431d374a6478893fe3", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/f943f29ae69c42511a2d85adee9d13d835b5c803", + "reference": "f943f29ae69c42511a2d85adee9d13d835b5c803", "shasum": "" }, "require": { @@ -1017,20 +1023,20 @@ "debug", "dump" ], - "time": "2015-11-18 13:45:00" + "time": "2015-12-05 11:09:21" }, { "name": "symfony/yaml", - "version": "v2.8.0", + "version": "v2.8.1", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "f79824187de95064a2f5038904c4d7f0227fedb5" + "reference": "ac84cbb98b68a6abbc9f5149eb96ccc7b07b8966" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/f79824187de95064a2f5038904c4d7f0227fedb5", - "reference": "f79824187de95064a2f5038904c4d7f0227fedb5", + "url": "https://api.github.com/repos/symfony/yaml/zipball/ac84cbb98b68a6abbc9f5149eb96ccc7b07b8966", + "reference": "ac84cbb98b68a6abbc9f5149eb96ccc7b07b8966", "shasum": "" }, "require": { @@ -1066,7 +1072,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2015-11-30 12:35:10" + "time": "2015-12-26 13:37:56" }, { "name": "twig/twig", diff --git a/system/src/Grav/Common/Cache.php b/system/src/Grav/Common/Cache.php index da0825ed9..09278295e 100644 --- a/system/src/Grav/Common/Cache.php +++ b/system/src/Grav/Common/Cache.php @@ -131,7 +131,9 @@ class Cache extends Getters $driver_name = 'file'; if (!$setting || $setting == 'auto') { - if (extension_loaded('apc')) { + if (extension_loaded('apcu')) { + $driver_name = 'apcu'; + } elseif (extension_loaded('apc')) { $driver_name = 'apc'; } elseif (extension_loaded('wincache')) { $driver_name = 'wincache'; @@ -149,6 +151,10 @@ class Cache extends Getters $driver = new \Doctrine\Common\Cache\ApcCache(); break; + case 'apcu': + $driver = new \Doctrine\Common\Cache\ApcuCache(); + break; + case 'wincache': $driver = new \Doctrine\Common\Cache\WinCacheCache(); break;