Skip to content

Commit

Permalink
[Apcu] Load APCUIterator only when APCIterator exists
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Mar 3, 2016
1 parent 4533169 commit 3b7100b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 21 deletions.
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
"src/Xml/bootstrap.php"
],
"classmap": [
"src/Apcu/Resources/stubs",
"src/Intl/Normalizer/Resources/stubs",
"src/Php70/Resources/stubs",
"src/Php54/Resources/stubs"
Expand Down
18 changes: 0 additions & 18 deletions src/Apcu/Resources/stubs/APCUIterator.php

This file was deleted.

10 changes: 10 additions & 0 deletions src/Apcu/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,13 @@ function apcu_inc($key, $step = 1, &$success = false) { return apc_inc($key, $st
function apcu_sma_info($limited = false) { return apc_sma_info($limited); }
function apcu_store($key, $var = null, $ttl = 0) { return apc_store($key, $var, $ttl); }
}

if (!class_exists('APCUIterator', false)) {
class APCUIterator extends APCIterator
{
public function __construct($search = null, $format = APC_ITER_ALL, $chunk_size = 100, $list = APC_LIST_ACTIVE)
{
parent::__construct('user', $search, $format, $chunk_size, $list);
}
}
}
3 changes: 1 addition & 2 deletions src/Apcu/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
"php": ">=5.3.3"
},
"autoload": {
"files": [ "bootstrap.php" ],
"classmap": [ "Resources/stubs" ]
"files": [ "bootstrap.php" ]
},
"minimum-stability": "dev",
"extra": {
Expand Down

0 comments on commit 3b7100b

Please sign in to comment.