Skip to content

Commit

Permalink
Added support for caching within session.
Browse files Browse the repository at this point in the history
  • Loading branch information
Enrico Sola authored and Enrico Sola committed Feb 14, 2018
1 parent e3d1933 commit 1c26fa9
Show file tree
Hide file tree
Showing 6 changed files with 320 additions and 881 deletions.
674 changes: 0 additions & 674 deletions LICENSE

This file was deleted.

14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,18 @@ If you want to get the IP address of the client you can use this method:

`$address = PHPTorDetector\PHPTorDetector::getClientIPAddress();`

By default, check result is cached within session (if session is enabled and if the script is not executed in CLI), you can disable this feature by using this method:

`PHPTorDetector\PHPTorDetector::setSessionCache(false);`

If you want to change the index where the results will be cached you can use this method:

`PHPTorDetector\PHPTorDetector::setSessionCacheName('tor_cache');`

Note that if you want to set multiple indexes within the session array you can separate indexes with a "@" like this:

`PHPTorDetector\PHPTorDetector::setSessionCacheName('tor@cache');`

In this way, cache will be stored in `$_SESSION['tor']['cache']`.

Are you looking for the Node.js version? Give a look [here](https://github.com/RyanJ93/tor-detector).
10 changes: 10 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Changelog

All notable changes to this project will be documented in this file.

## Version 1.1.1

* Added support for caching within session.
* Some minor changes to documentation.
* Removed "license.txt" in favour of "license.md".
* Updated "README.md" including new features.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ryanj93/php-tor-detector",
"version": "1.1.0",
"version": "1.1.1",
"description": "A very simple library to detect Tor connections using PHP 7 without any dependency.",
"type": "library",
"license": "GPL-3.0-or-later",
Expand Down
Loading

0 comments on commit 1c26fa9

Please sign in to comment.