PHPackages                             samcleaver/phpgsb - 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. samcleaver/phpgsb

ActiveLibrary[Security](/categories/security)

samcleaver/phpgsb
=================

PHP Google Safe Browsing

0.2.7(9y ago)4215.5k17[3 PRs](https://github.com/samcleaver/phpGSB/pulls)BSD-3-ClausePHPPHP &gt;=5.3.0

Since Jan 20Pushed 7y ago13 watchersCompare

[ Source](https://github.com/samcleaver/phpGSB)[ Packagist](https://packagist.org/packages/samcleaver/phpgsb)[ Docs](https://github.com/samcleaver/phpgsb)[ RSS](/packages/samcleaver-phpgsb/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)DependenciesVersions (6)Used By (0)

Implementation of Google Safe Browsing
======================================

[](#implementation-of-google-safe-browsing)

**phpGSB** is a robust implementation of the Google Safe Browsing API. It currently *does* allow the following:

- Updating of GSB lists to a MySQL database
- Basic checking of URLs' against lists and then full-hash checks against the full GSB database
- Caching of full-hash keys to minimise requests to the remote Google server

At current it *does not* allow the following:

- Requests using MAC keys (integrity checks)

The main class is definitely not as efficient as it could be and has developed very quickly to meet the basic GSB specification; any contributions, bug fixes etc are **very** welcome!

Download
--------

[](#download)

- Installation using composer

```
$ composer require samcleaver/phpgsb

```

- You could manually download phpgsb by this link:

Installation
------------

[](#installation)

1. Enter database details into install.php (Replace DATABASE\_USERNAME, DATABASE\_NAME and DATABASE\_PASSWORD with respective information)
2. Run install.php
3. Look at listupdater.php and lookup.php example files for basic methods on using the system.
4. If you choose to use listupdater.php as-is then set it as a cron job/scheduled task to run every minute. *(It won't actually update every minute but is required incase of backoff procedures and timeouts)*

FAQ
---

[](#faq)

- **When I do a lookup, phpGSB says the URL is safe but I know it's not.***The database is updated in chunks from Google's central server. Because of this, you need to run updates for 24 hours before you can start doing lookups, this is a limitation of the specification and not the implementation. (Check Step 5 of installation on how to ensure updates are running.)*

License
-------

[](#license)

The phpGSB library is released under the New BSD License.

```
Copyright (c) 2010-2015, Sam Cleaver

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.
    * Neither the name of the organization nor the
      names of its contributors may be used to endorse or promote products
      derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

```

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity38

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 86% 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.

###  Release Activity

Cadence

Every ~352 days

Total

4

Last Release

3444d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9a90aca97d9cd790cb6948c6fda08f972f17420811dc2670433b6ca5c5d70eb6?d=identicon)[samcleaver](/maintainers/samcleaver)

---

Top Contributors

[![samcleaver](https://avatars.githubusercontent.com/u/284957?v=4)](https://github.com/samcleaver "samcleaver (43 commits)")[![caseycs](https://avatars.githubusercontent.com/u/76095?v=4)](https://github.com/caseycs "caseycs (3 commits)")[![YevKov](https://avatars.githubusercontent.com/u/1657057?v=4)](https://github.com/YevKov "YevKov (2 commits)")[![castiel](https://avatars.githubusercontent.com/u/73254?v=4)](https://github.com/castiel "castiel (1 commits)")[![demianr](https://avatars.githubusercontent.com/u/602269?v=4)](https://github.com/demianr "demianr (1 commits)")

---

Tags

phpgooglegsfgoogle safe browsing

### Embed Badge

![Health badge](/badges/samcleaver-phpgsb/health.svg)

```
[![Health](https://phpackages.com/badges/samcleaver-phpgsb/health.svg)](https://phpackages.com/packages/samcleaver-phpgsb)
```

###  Alternatives

[stymiee/php-simple-encryption

The PHP Simple Encryption library is designed to simplify the process of encrypting and decrypting data while ensuring best practices are followed. By default is uses a secure encryption algorithm and generates a cryptologically strong initialization vector so developers do not need to becomes experts in encryption to securely store sensitive data.

448.0k](/packages/stymiee-php-simple-encryption)[ukrbublik/openssl_x509_crl

Missing OpenSSL function on PHP to create CRL (certificate revocation list) for CA

182.1k](/packages/ukrbublik-openssl-x509-crl)

PHPackages © 2026

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