PHPackages                             mic2100/is-tor - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. mic2100/is-tor

ActiveLibrary[Security](/categories/security)

mic2100/is-tor
==============

Detects whether the current visitor accessing your site from a Tor network exit point

08[1 PRs](https://github.com/mic2100/is-tor/pulls)PHP

Since Jun 13Pushed 10y ago1 watchersCompare

[ Source](https://github.com/mic2100/is-tor)[ Packagist](https://packagist.org/packages/mic2100/is-tor)[ RSS](/packages/mic2100-is-tor/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

IsTor?
======

[](#istor)

Detect whether a visitor is accessing your site from the Tor network.

Usage
=====

[](#usage)

Getting the Tor ip addresses

```
$filename = sys_get_temp_dir() . '/ips.ip';
$storage = new Storage\FileStorage;
$engine = new Engine;
$subscriptions = new Subscriptions($engine, $storage);
$assessor = new Assessor($engine, $storage);

//This needs to be run from within a cron job so that the file is kept up to date
//ip address of the server
$ip = '11.12.13.14';
$subscriptions->addSubscription(new Tor($ip))
              ->setName($filename)
              ->retrieve();
```

Checking the user

```
$filename = sys_get_temp_dir() . '/ips.ip';
$storage = new Storage\FileStorage;
$engine = new Engine;
$subscriptions = new Subscriptions($engine, $storage);
$assessor = new Assessor($engine, $storage);

//This needs to be ran on each of the requests that are received from users
//Ideally the isTor method responses can be cached in APC (or other caching system)
$ip = $_SERVER['REMOTE_ADDR'];

if ($assessor->setStorageName($filename)->isTor($ip)) {
    //the current visitor is accessing your site through the Tor network
}

//the current visitor is not accessing your site through the Tor network
```

[![Bitdeli Badge](https://camo.githubusercontent.com/bdecdebe074d81c8961b52223562e720499be1134b5802b1129785c600ed9651/68747470733a2f2f64327765637a68766c38323376302e636c6f756466726f6e742e6e65742f6d6963323130302f69732d746f722f7472656e642e706e67)](https://bitdeli.com/free "Bitdeli Badge")

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/cd22019623ac7e0ed3b0680eb602a6794fbbd4467ba905fa3ab07bfc962069ce?d=identicon)[mic2100](/maintainers/mic2100)

---

Top Contributors

[![mic2100](https://avatars.githubusercontent.com/u/2852547?v=4)](https://github.com/mic2100 "mic2100 (1 commits)")

### Embed Badge

![Health badge](/badges/mic2100-is-tor/health.svg)

```
[![Health](https://phpackages.com/badges/mic2100-is-tor/health.svg)](https://phpackages.com/packages/mic2100-is-tor)
```

###  Alternatives

[defuse/php-encryption

Secure PHP Encryption Library

3.9k162.4M214](/packages/defuse-php-encryption)[roave/security-advisories

Prevents installation of composer packages with known security vulnerabilities: no API, simply require it

2.9k97.3M6.4k](/packages/roave-security-advisories)[mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

2.0k16.7M113](/packages/mews-purifier)[robrichards/xmlseclibs

A PHP library for XML Security

41278.1M118](/packages/robrichards-xmlseclibs)[bjeavons/zxcvbn-php

Realistic password strength estimation PHP library based on Zxcvbn JS

86917.5M63](/packages/bjeavons-zxcvbn-php)[enlightn/security-checker

A PHP dependency vulnerabilities scanner based on the Security Advisories Database.

33732.2M110](/packages/enlightn-security-checker)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
