Skip to content

Commit 9d67d78

Browse files
authored
Escape paths (#72)
* feature: escape filename * feature: escape keys
1 parent 4efd965 commit 9d67d78

12 files changed

Lines changed: 110 additions & 80 deletions

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ The first time we see the IP address will have to make an HTTP call, but subsequ
2929

3030
```php
3131
$ipAddress = $_SERVER["REMOTE_ADDR"];
32-
$fileCache = new Gt\FileCache\Cache("/tmp/ip-address-geolocation");
32+
$fileCache = new GT\FileCache\Cache("/tmp/ip-address-geolocation");
3333

3434
// This function uses file_get_contents to contact the remote server
3535
// at ipinfo.io, a costly operation. We will pass the lookup function
@@ -44,7 +44,7 @@ $location = $fileCache->get("lat-lon", $lookup);
4444
echo "Your location is: $location";
4545
```
4646

47-
If generating a fresh value fails, throw `Gt\FileCache\CacheValueGenerationException`
47+
If generating a fresh value fails, throw `GT\FileCache\CacheValueGenerationException`
4848
from the callback. The cache will ignore that failure and skip writing a replacement
4949
value, which leaves `null` available as a legitimate cached value.
5050

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,14 @@
4040

4141
"autoload": {
4242
"psr-4": {
43+
"GT\\FileCache\\": "./src",
4344
"Gt\\FileCache\\": "./src"
4445
}
4546
},
4647

4748
"autoload-dev": {
4849
"psr-4": {
49-
"Gt\\FileCache\\Test\\": "./test/phpunit"
50+
"GT\\FileCache\\Test\\": "./test/phpunit"
5051
}
5152
},
5253

0 commit comments

Comments
 (0)