Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ echo implode('<br />', $CachedString->get());// Will echo your product list
* See the file examples/withoutComposer.php for more information.

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

#### :boom: phpFastCache support
Found an issue or have an idea ? Come [here](https://github.com/PHPSocialNetwork/phpfastcache/issues) and let us know !
31 changes: 31 additions & 0 deletions docs/migration/MigratingFromV5ToV6.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,37 @@ Notice: Undefined index: e in /phpfastcache/src/phpFastCache/Core/Pool/DriverBas
Fatal error: Uncaught phpFastCache\Exceptions\phpFastCacheInvalidArgumentException: $expiration must be an object implementing the DateTimeInterface in ...
```

### Setting up a default config

#### :clock1: Then:
PhpFastCache used to set a default global config using the `CacheManager::setup()` method

```php
namespace My\Custom\Project;


$instance = CacheManager::setup([
'path' => 'somewhere'
]);
$instance = CacheManager::getInstance('Files');

```

#### :alarm_clock: Now:
This method has been changed is now replaced by the `CacheManager::setDefaultConfig()` method.
Using the old `CacheManager::setup()` method will trigger a `phpFastCacheInvalidConfigurationException`

```php
namespace My\Custom\Project;


$instance = CacheManager::setDefaultConfig([
'path' => 'somewhere'
]);
$instance = CacheManager::getInstance('Files');

```

### Type hint of Driver instances

#### :clock1: Then:
Expand Down
48 changes: 0 additions & 48 deletions examples/zend_disk.php

This file was deleted.

41 changes: 0 additions & 41 deletions examples/zend_shm.php

This file was deleted.

12 changes: 12 additions & 0 deletions src/phpFastCache/CacheManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,18 @@ public static function setDefaultConfig($name, $value = null)
}
}

/**
* @param $name string|array
* @param mixed $value
* @throws phpFastCacheInvalidConfigurationException
* @deprecated Method "setup" is deprecated, please use "setDefaultConfig" method instead
*/
public static function setup($name, $value = null)
{
throw new phpFastCacheInvalidConfigurationException(sprintf('Method "%s" is deprecated, please use "setDefaultConfig" method instead.', __FUNCTION__));
}


/**
* @return array
*/
Expand Down