Skip to content

Commit 0c879ac

Browse files
authored
Merge pull request #827 from Geolim4/master
Updated some docs files (fixed typos)
2 parents d620eaa + 5a98b2d commit 0c879ac

File tree

9 files changed

+27
-57
lines changed

9 files changed

+27
-57
lines changed

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
name: Github tests workflow
1+
name: Github CI
22
on: [push, pull_request]
33
jobs:
44
build:
5-
name: Github PHP unit tests
5+
name: Github CI - Branch
66
runs-on: ubuntu-latest
77
steps:
88
- name: Setup PHP 7.3

LICENCE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2016 phpFastCache
1+
Copyright (c) 2016 Phpfastcache
22

33
Permission is hereby granted, free of charge, to any person obtaining
44
a copy of this software and associated documentation files (the
@@ -17,4 +17,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
1717
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
1818
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
1919
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

docs/CREDITS.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## phpFastCache Copyright (c) 2016
1+
## Phpfastcache Copyright (c) 2016
22
https://www.phpfastcache.com
33

44
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -19,30 +19,30 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1919
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2020
SOFTWARE.
2121

22-
__phpFastCache Current Project Manager:__ Georges.L (Geolim4) / (v5, v6, v7, v8)
22+
__Phpfastcache Current Project Manager:__ Georges.L (Geolim4) / (v5, v6, v7, v8)
2323

24-
__phpFastCache Former Project Founder:__ Khoa Bui (khoaofgod) / (<= v4)
24+
__Phpfastcache Former Project Founder:__ Khoa Bui (khoaofgod) / (<= v4)
2525

26-
__phpFastCache Contributors:__ https://github.com/PHPSocialNetwork/phpfastcache/graphs/contributors
26+
__Phpfastcache Contributors:__ https://github.com/PHPSocialNetwork/phpfastcache/graphs/contributors
2727

2828
#### Hall of fame (Special thanks):
2929

3030
- __Jetbrains__ * for providing us a free IDE licence
3131
- __Scrutinizer-CI__ * for providing us a free Security Analysis
32-
- __VersionEye__ * For being an awesome tool that helped us to watch version dependencies. You will be missed, thanks you very much Robert.
32+
- __VersionEye__ * For being an awesome tool that helped us to watch version dependencies. You will be missed, thank you very much Robert.
3333
- __Sabine van Lommen__ * from __Zend.com__ for providing us a free developer licence of Zend Server
3434
- __Lucas (_hammermaps_)__ for the "Zend Data Cache" driver implementation
3535
- __Anton (_git-webmaster_)__ for kindly providing us a Couchbase server for deep tests purposes.
3636

37-
\* Thanks to the companies that provided us free access to their products to help us to build a better quality software every days.
37+
\* Thanks to the companies that provided us free access to their products to help us to build a better quality software every day.
3838

3939
But above all, many thanks to these companies to support indisputably Open Source Projects.
40-
Thanks to all the contributors that added their stone to the building. Each contribution made this project a bit better, every commits, every pull request you made contributed to make this project greater and better.
40+
Thanks to all the contributors that added their stone to the building. Each contribution made this project a bit better, every commit, every pull request you made contributed to make this project greater and better.
4141

4242
#### Software licenses:
4343

4444
- PHP License, version 3.0:
4545
- Pear (c) 2001-2004 PHP Group, http://pear.php.net
4646

4747
- MIT licenced:
48-
- Predis (c) 2009-2015 Daniele Alessandri, https://clorophilla.net
48+
- Predis (c) 2009-2015 Daniele Alessandri, https://clorophilla.net

docs/EVENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
:mega: As of the V6, PhpFastCache provides an event mechanism.
1+
:mega: As of the V6, Phpfastcache provides an event mechanism.
22
You can subscribe to an event by passing a Closure to an active event:
33

44
```php

docs/OPTIONS.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
PhpFastCache has some options that you may want to know before using them, here's the list:
1+
Phpfastcache has some options that you may want to know before using them, here's the list:
22

33
### File-based drivers options *
44
* **path** See the "**Host/Authenticating options**" section
55
* **default_chmod** _| int>octal (default: 0777)_ `[>=V4, <V7]` This option will define the chmod used to write driver cache files.
66
* **defaultChmod** _| int>octal (default: 0777)_ `[>=V7]` New configuration name of `default_chmod` as of V7
77
* **securityKey** _| string (default: 'auto')_ `[>=V4]` A security key that define the subdirectory name. 'auto' value will be the HTTP_HOST value.
88
* **htaccess** _| bool (default: true)_ `[>=V4]` Option designed to (dis)allow the auto-generation of .htaccess.
9-
* **autoTmpFallback** _| bool (default: false)_ `[>=V6]`Option designed to automatically attempt to fallback to temporary directory if the cache fails to write on the specified directory
10-
* **secureFileManipulation** _| bool (default: false)_ `[>=V6]` This option enforces a strict I/O manipulation policy by adding more integrity checks. This option may slow down the write operations, therefore you must use it with caution. In case of failure an **phpFastCacheIOException** exception will be thrown. Currently only supported by _Files_ driver.
11-
* **cacheFileExtension** _| string (default: 'txt')_ `[>=V6.0.2]` This allows you to setup a custom (but safe) cache file extension.
9+
* **autoTmpFallback** _| bool (default: false)_ `[>=V6]`Option designed to automatically attempt to fall back to temporary directory if the cache fails to write on the specified directory
10+
* **secureFileManipulation** _| bool (default: false)_ `[>=V6]` This option enforces a strict I/O manipulation policy by adding more integrity checks. This option may slow down the write operations, therefore you must use it with caution. In case of failure a **PhpfastcacheIOException** exception will be thrown. Currently, only supported by _Files_ driver.
11+
* **cacheFileExtension** _| string (default: 'txt')_ `[>=V6.0.2]` This allows you to set up a custom (but safe) cache file extension.
1212

1313
\* Drivers like _Files_, _Sqlite_, _Leveldb_, etc.
1414

1515
### Global options
1616
* **fallback** _| string|bool_ (default: false)`[>=V4.2]` A driver name used in case the main driver stopped working. E.g. a missing php extension.
1717
* **fallbackConfig** _| ConfigurationOption|null_ (default: null)`[>=V7]` A dedicated `ConfigurationOption` object for the `fallback` driver, if needed.
18-
* **compress_data** _| bool (default: false)_ `[>=V4.3]` Compress stored data, if the backend supports it. Currently only supported by _Memcache(d)_ driver.
19-
* **limited_memory_each_object** _| int (default: 4096)_ `[>=V4.2]` Maximum size (bytes) of object stored in memory. Currently only supported by _Cookie_ driver.
18+
* **compress_data** _| bool (default: false)_ `[>=V4.3]` Compress stored data, if the backend supports it. Currently, only supported by _Memcache(d)_ driver.
19+
* **limited_memory_each_object** _| int (default: 4096)_ `[>=V4.2]` Maximum size (bytes) of object stored in memory. Currently, only supported by _Cookie_ driver.
2020
* **defaultTtl** _| int (default: 900)_ `[>=V5]` This option define a default ttl (time-to-live, in seconds) for item that has no specified expiration date/ttl.
2121
* **itemDetailedDate** _| bool (default: false)_ `[>=V6]` This option will define if the Items will make use of detailed dates such as Creation/modification date. Trying to access to these date without being explicitly enabled will throw a `LogicException`
2222
* **defaultKeyHashFunction** _| string (default: 'md5')_ `[>=V6]` This option will allow you to define a custom hash function for the `$item->getEncodedKey()` method. Callable objects are not allowed, but static method such as `\Absolute\Namespace\ToStatic::method` are allowed.
@@ -38,7 +38,7 @@ PhpFastCache has some options that you may want to know before using them, here'
3838
* **redisClient** _| \Redis (default: null)_ `[>=V7]` An optional Redis Client created outside Phpfastcache's scope. This option overrides every _Host/Authenticating_ options
3939
* **predisClient** _| \Predis\Client (default: null)_ `[>=V7]` An optional Predis Client created outside Phpfastcache's scope. This option overrides every _Host/Authenticating_ options
4040

41-
These options differs depending the driver that you are using, see **/Examples** folder for more information about these options.
41+
These options differ depend on the driver that you are using, see **/Examples** folder for more information about these options.
4242

4343
\* Drivers like _CouchBase_, _MongoDb_, _(P)redis_, _Ssdb_, etc.
4444

lib/Phpfastcache/Drivers/Cassandra/Driver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function getHelp(): string
6060
To install the php Cassandra extension via Pecl:
6161
<code>sudo pecl install cassandra</code>
6262
More information on: https://github.com/datastax/php-driver
63-
Please not that this repository only provide php stubs and C/C++ sources, it does NOT provide php client.
63+
Please note that this repository only provide php stubs and C/C++ sources, it does NOT provide php client.
6464
</p>
6565
HELP;
6666
}

lib/Phpfastcache/Drivers/Memstatic/Driver.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,7 @@ protected function driverConnect(): bool
7373
*/
7474
protected function driverRead(CacheItemInterface $item)
7575
{
76-
$key = md5($item->getKey());
77-
if (isset($this->staticStack[$key])) {
78-
return $this->staticStack[$key];
79-
}
80-
return null;
76+
return $this->staticStack[$item->getKey()] ?? null;
8177
}
8278

8379
/**
@@ -91,7 +87,7 @@ protected function driverWrite(CacheItemInterface $item): bool
9187
* Check for Cross-Driver type confusion
9288
*/
9389
if ($item instanceof Item) {
94-
$this->staticStack[md5($item->getKey())] = $this->driverPreWrap($item);
90+
$this->staticStack[$item->getKey()] = $this->driverPreWrap($item);
9591
return true;
9692
}
9793

@@ -109,7 +105,7 @@ protected function driverDelete(CacheItemInterface $item): bool
109105
* Check for Cross-Driver type confusion
110106
*/
111107
if ($item instanceof Item) {
112-
$key = md5($item->getKey());
108+
$key = $item->getKey();
113109
if (isset($this->staticStack[$key])) {
114110
unset($this->staticStack[$key]);
115111
return true;
@@ -135,4 +131,4 @@ protected function driverClear(): bool
135131
$this->staticStack = [];
136132
return true;
137133
}
138-
}
134+
}

lib/Phpfastcache/Helper/Psr16Adapter.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ public function has($key): bool
232232

233233
/**
234234
* @return ExtendedCacheItemPoolInterface
235+
* @internal
235236
*/
236237
public function getInternalCacheInstance(): ExtendedCacheItemPoolInterface
237238
{

tests/Memstatic.test.php

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -12,33 +12,6 @@
1212
require_once __DIR__ . '/../vendor/autoload.php';
1313
$testHelper = new TestHelper('Memstatic driver');
1414
$cacheInstance = CacheManager::getInstance('Memstatic');
15-
$cacheKey = 'testItem';
16-
$randomStr = str_shuffle(sha1(uniqid('pfc', true) . mt_rand(100, 10000)));
17-
$testHelper->printText("Random-generated cache value for key '{$cacheKey}': {$randomStr}");
18-
19-
$item = $cacheInstance->getItem($cacheKey);
20-
$item->set($randomStr)->expiresAfter(60);
21-
$cacheInstance->save($item);
22-
$cacheInstance->detachAllItems();
23-
unset($item);
24-
25-
$item = $cacheInstance->getItem($cacheKey);
26-
27-
$cacheResult = $cacheInstance->getItem($cacheKey)->get();
28-
29-
if ($cacheResult === $randomStr) {
30-
$testHelper->assertPass("The cache key value match, got expected value '{$cacheResult}'");
31-
} else {
32-
$testHelper->assertFail("The cache key value match expected value '{$randomStr}', got '{$cacheResult}'");
33-
}
34-
$testHelper->printText('Clearing the whole cache to test item cleaning...');
35-
$cacheInstance->clear();
36-
$cacheResult = ($cacheInstance->getItem($cacheKey)->isHit() === false && $cacheInstance->getItem($cacheKey)->get() === null);
37-
38-
if ($cacheResult === true) {
39-
$testHelper->assertPass('The cache item is null as expected');
40-
} else {
41-
$testHelper->assertFail('The cache is not null');
42-
}
4315

16+
$testHelper->runCRUDTests($cacheInstance);
4417
$testHelper->terminateTest();

0 commit comments

Comments
 (0)