library safebrowser
Client for the Google Safe Browser API
xsist10/safebrowser
Client for the Google Safe Browser API
- Monday, April 7, 2014
- by xsist10
- Repository
- 2 Watchers
- 3 Stars
- 47 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 1 Forks
- 2 Open issues
- 3 Versions
- 0 % Grown
Google SafeBrowsing Client
Demo code for PHPSA14 (http://phpsouthafrica.com/) conference, (*1)
, (*2)
Get an API key
Installing
This library is available via Composer:, (*3)
{
"require": {
"xsist10/safebrowser": "v1.0.0"
}
}
Using
<?php
require 'vendor/autoload.php';
use xsist10\SafeBrowsing\SafeBrowsing;
use xsist10\SafeBrowsing\Strategy\Chain;
use xsist10\SafeBrowsing\Strategy\Post;
use xsist10\SafeBrowsing\Strategy\Get;
$chain = new Chain();
$chain->append(new Post());
$chain->append(new Get());
$safeBrowsing = new SafeBrowsing("[API KEY]", $chain);
$response = $safeBrowsing->isUrlSafe('http://ianfette.org/');
if (!$response->isSecure()) {
// Oh no! Panic!
if ($response->hasMalware()) {
// Malware detected
}
if ($response->hasPhishing()) {
// Phising detected
}
}
dev-master
9999999-dev
Client for the Google Safe Browser API
Sources
Download
MIT
The Development Requires
v1.0.1
1.0.1.0
Client for the Google Safe Browser API
Sources
Download
MIT
The Development Requires
v1.0.0
1.0.0.0
Client for the Google Safe Browser API
Sources
Download
MIT
The Requires
The Development Requires