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 d2d0163

Browse filesBrowse files
[APCu] A new polyfill for the legacy APC users
1 parent dd9db1d commit d2d0163
Copy full SHA for d2d0163

22 files changed

+203-29Lines changed: 203 additions & 29 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.travis.yml‎

Copy file name to clipboardExpand all lines: .travis.yml
+8-4Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,16 @@ matrix:
1414

1515
before_install:
1616
- composer self-update;
17-
- if [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then phpenv config-rm xdebug.ini; fi;
18-
- if [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then echo "extension = ldap.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;
19-
- if [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then php -i; fi;
17+
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then INI_FILE=~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; else INI_FILE=/etc/hhvm/php.ini; fi;
18+
- echo memory_limit = -1 >> $INI_FILE
19+
- echo session.gc_probability = 0 >> $INI_FILE
20+
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then phpenv config-rm xdebug.ini; fi;
21+
- 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;
22+
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then echo extension = ldap.so >> $INI_FILE; fi;
23+
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then php -i; fi;
2024

2125
install:
22-
- if [ "$TRAVIS_BRANCH" = "master" ]; then export COMPOSER_ROOT_VERSION=dev-master; else export COMPOSER_ROOT_VERSION="$TRAVIS_BRANCH".x-dev; fi;
26+
- if [[ $TRAVIS_BRANCH = master ]]; then export COMPOSER_ROOT_VERSION=dev-master; else export COMPOSER_ROOT_VERSION=$TRAVIS_BRANCH.x-dev; fi;
2327
- composer --prefer-source install;
2428

2529
script:
Collapse file

‎README.md‎

Copy file name to clipboardExpand all lines: README.md
+2-1Lines changed: 2 additions & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ compatibility layers for some extensions and functions. It is intended to be
66
used when portability across PHP versions and extensions is desired.
77

88
Polyfills are provided for:
9+
- the `apcu` extension when the legacy `apc` extension is installed;
910
- the `mbstring` and `iconv` extensions;
1011
- the `Normalizer` class and the `grapheme_*` functions;
1112
- the `utf8_encode` and `utf8_decode` functions from the `xml` extension;
@@ -54,4 +55,4 @@ feature and behavior parity can be proven and enforced in the long run.
5455
License
5556
=======
5657

57-
This library is released under the [MIT license](LICENSE).
58+
This library is released under the [MIT license](LICENSE).
Collapse file

‎appveyor.yml‎

Copy file name to clipboardExpand all lines: appveyor.yml
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ install:
2020
- IF %PHP%==1 7z x ICU-51.2-dlls.zip -y >nul
2121
- IF %PHP%==1 del /Q *.zip
2222
- IF %PHP%==1 cd ext
23+
- IF %PHP%==1 appveyor DownloadFile http://windows.php.net/downloads/pecl/releases/apcu/4.0.10/php_apcu-4.0.10-5.3-nts-vc9-x86.zip
24+
- IF %PHP%==1 7z x php_apcu-4.0.10-5.3-nts-vc9-x86.zip -y >nul
2325
- IF %PHP%==1 appveyor DownloadFile http://nebm.ist.utl.pt/~glopes/misc/intl_win/php_intl-3.0.0-5.3-nts-vc9-x86.zip
2426
- IF %PHP%==1 7z x php_intl-3.0.0-5.3-nts-vc9-x86.zip -y >nul
2527
- IF %PHP%==1 del /Q *.zip
@@ -32,6 +34,8 @@ install:
3234
- IF %PHP%==1 echo date.timezone="UTC" >> php.ini
3335
- IF %PHP%==1 echo extension_dir=ext >> php.ini
3436
- IF %PHP%==1 echo extension=php_openssl.dll >> php.ini
37+
- IF %PHP%==1 echo extension=php_apcu.dll >> php.ini
38+
- IF %PHP%==1 echo apc.enable_cli=1 >> php.ini
3539
- IF %PHP%==1 echo extension=php_intl.dll >> php.ini
3640
- IF %PHP%==1 echo extension=php_mbstring.dll >> php.ini
3741
- IF %PHP%==1 echo extension=php_ldap.dll >> php.ini
Collapse file

‎composer.json‎

Copy file name to clipboardExpand all lines: composer.json
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"symfony/intl": "~2.3|~3.0"
2323
},
2424
"replace": {
25+
"symfony/polyfill-apcu": "self.version",
2526
"symfony/polyfill-php54": "self.version",
2627
"symfony/polyfill-php55": "self.version",
2728
"symfony/polyfill-php56": "self.version",
@@ -37,6 +38,7 @@
3738
"autoload": {
3839
"psr-4": { "Symfony\\Polyfill\\": "src/" },
3940
"files": [
41+
"src/Apcu/bootstrap.php",
4042
"src/Php54/bootstrap.php",
4143
"src/Php55/bootstrap.php",
4244
"src/Php56/bootstrap.php",
@@ -49,6 +51,7 @@
4951
"src/Xml/bootstrap.php"
5052
],
5153
"classmap": [
54+
"src/Apcu/Resources/stubs",
5255
"src/Intl/Normalizer/Resources/stubs",
5356
"src/Php70/Resources/stubs",
5457
"src/Php54/Resources/stubs"
Collapse file

‎src/Apcu/LICENSE‎

Copy file name to clipboard
+19Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2016 Fabien Potencier
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is furnished
8+
to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.
Collapse file

‎src/Apcu/README.md‎

Copy file name to clipboard
+12Lines changed: 12 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Symfony Polyfill / APCu
2+
========================
3+
4+
This component provides `apcu_*` functions and the `APCUIterator` class to users of the legacy APC extension.
5+
6+
More information can be found in the
7+
[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md).
8+
9+
License
10+
=======
11+
12+
This library is released under the [MIT license](LICENSE).
Collapse file
+18Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
class APCUIterator extends APCIterator
13+
{
14+
public function __construct($search = null, $format = APC_ITER_ALL, $chunk_size = 100, $list = APC_LIST_ACTIVE)
15+
{
16+
parent::__construct('user', $search, $format, $chunk_size, $list);
17+
}
18+
}
Collapse file

‎src/Apcu/bootstrap.php‎

Copy file name to clipboard
+28Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
if (!extension_loaded('apc')) {
13+
return;
14+
}
15+
16+
if (!function_exists('apcu_add')) {
17+
function apcu_add($key, $var = null, $ttl = 0) { return apc_add($key, $var, $ttl); }
18+
function apcu_cache_info($limited = false) { return apc_cache_info('user', $limited); }
19+
function apcu_cas($key, $old, $new) { return apc_cas($key, $old, $new); }
20+
function apcu_clear_cache() { return apc_clear_cache('user'); }
21+
function apcu_dec($key, $step = 1, &$success = false) { return apc_dec($key, $step, $success); }
22+
function apcu_delete($key) { return apc_delete($key); }
23+
function apcu_exists($keys) { return apc_exists($keys); }
24+
function apcu_fetch($key, &$success = false) { return apc_fetch($key, $success); }
25+
function apcu_inc($key, $step = 1, &$success = false) { return apc_inc($key, $step, $success); }
26+
function apcu_sma_info($limited = false) { return apc_sma_info($limited); }
27+
function apcu_store($key, $var = null, $ttl = 0) { return apc_store($key, $var, $ttl); }
28+
}
Collapse file

‎src/Apcu/composer.json‎

Copy file name to clipboard
+31Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "symfony/polyfill-apcu",
3+
"type": "library",
4+
"description": "Symfony polyfill backporting apcu_* functions to lower PHP versions",
5+
"keywords": ["polyfill", "shim", "compatibility", "portable", "apcu"],
6+
"homepage": "https://symfony.com",
7+
"license": "MIT",
8+
"authors": [
9+
{
10+
"name": "Nicolas Grekas",
11+
"email": "p@tchwork.com"
12+
},
13+
{
14+
"name": "Symfony Community",
15+
"homepage": "https://symfony.com/contributors"
16+
}
17+
],
18+
"require": {
19+
"php": ">=5.3.3"
20+
},
21+
"autoload": {
22+
"files": [ "bootstrap.php" ],
23+
"classmap": [ "Resources/stubs" ]
24+
},
25+
"minimum-stability": "dev",
26+
"extra": {
27+
"branch-alias": {
28+
"dev-master": "1.0-dev"
29+
}
30+
}
31+
}
Collapse file

‎src/Iconv/README.md‎

Copy file name to clipboardExpand all lines: src/Iconv/README.md
+2-2Lines changed: 2 additions & 2 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ This component provides a native PHP implementation of the
55
[php.net/iconv](http://php.net/iconv) functions
66
(short of [`ob_iconv_handler`](http://php.net/manual/en/function.ob-iconv-handler.php)).
77

8-
More information can be found in the
8+
More information can be found in the
99
[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md).
1010

1111
License
1212
=======
1313

14-
This library is released under the [MIT license](LICENSE).
14+
This library is released under the [MIT license](LICENSE).

0 commit comments

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