Skip to content

Commit 86b86f8

Browse files
authored
Merge pull request #461 from Geolim4/final
Fixed #459, Fixed #460
2 parents d26b7a0 + 479dea5 commit 86b86f8

File tree

5 files changed

+44
-90
lines changed

5 files changed

+44
-90
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ echo implode('<br />', $CachedString->get());// Will echo your product list
284284
* See the file examples/withoutComposer.php for more information.
285285

286286
#### :zap: Step 3: Enjoy ! Your website is now faster than lightning !
287-
For curious developpers, there is a lot of other examples available [here](https://github.com/PHPSocialNetwork/phpfastcache/tree/final/examples).
287+
For curious developpers, there is a lot of other examples available [here](https://github.com/PHPSocialNetwork/phpfastcache/tree/final/docs/examples).
288288

289289
#### :boom: phpFastCache support
290290
Found an issue or have an idea ? Come [here](https://github.com/PHPSocialNetwork/phpfastcache/issues) and let us know !

docs/migration/MigratingFromV5ToV6.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,37 @@ Notice: Undefined index: e in /phpfastcache/src/phpFastCache/Core/Pool/DriverBas
88
Fatal error: Uncaught phpFastCache\Exceptions\phpFastCacheInvalidArgumentException: $expiration must be an object implementing the DateTimeInterface in ...
99
```
1010

11+
### Setting up a default config
12+
13+
#### :clock1: Then:
14+
PhpFastCache used to set a default global config using the `CacheManager::setup()` method
15+
16+
```php
17+
namespace My\Custom\Project;
18+
19+
20+
$instance = CacheManager::setup([
21+
'path' => 'somewhere'
22+
]);
23+
$instance = CacheManager::getInstance('Files');
24+
25+
```
26+
27+
#### :alarm_clock: Now:
28+
This method has been changed is now replaced by the `CacheManager::setDefaultConfig()` method.
29+
Using the old `CacheManager::setup()` method will trigger a `phpFastCacheInvalidConfigurationException`
30+
31+
```php
32+
namespace My\Custom\Project;
33+
34+
35+
$instance = CacheManager::setDefaultConfig([
36+
'path' => 'somewhere'
37+
]);
38+
$instance = CacheManager::getInstance('Files');
39+
40+
```
41+
1142
### Type hint of Driver instances
1243

1344
#### :clock1: Then:

examples/zend_disk.php

Lines changed: 0 additions & 48 deletions
This file was deleted.

examples/zend_shm.php

Lines changed: 0 additions & 41 deletions
This file was deleted.

src/phpFastCache/CacheManager.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,18 @@ public static function setDefaultConfig($name, $value = null)
332332
}
333333
}
334334

335+
/**
336+
* @param $name string|array
337+
* @param mixed $value
338+
* @throws phpFastCacheInvalidConfigurationException
339+
* @deprecated Method "setup" is deprecated, please use "setDefaultConfig" method instead
340+
*/
341+
public static function setup($name, $value = null)
342+
{
343+
throw new phpFastCacheInvalidConfigurationException(sprintf('Method "%s" is deprecated, please use "setDefaultConfig" method instead.', __FUNCTION__));
344+
}
345+
346+
335347
/**
336348
* @return array
337349
*/

0 commit comments

Comments
 (0)