Skip to content

pxgamer/phishtank-php

Repository files navigation

phishtank-php

Latest Version on Packagist Software License Build Status Style CI Code Coverage Total Downloads

A simple PHP wrapper for the PhishTank API.

Structure

If any of the following are applicable to your project, then the directory structure should follow industry best practises by being named the following.

src/
tests/
vendor/

Install

Via Composer

$ composer require pxgamer/phishtank-php

Usage

__construct($url, $api_key = null)

This will initialise the object with all details.

// Api Key parameter is optional. Should be a string if included.
$client = new \pxgamer\PhishTank\Hook($url);

getResults()

This will refresh the results and fetch new ones from the server.

Example code

use pxgamer\PhishTank\Hook;

$result = new Hook('https://github.com');

echo '<pre>' . print_r($result, true) . '</pre>';

Example response

pxgamer\PhishTank\Hook Object
(
    [url:pxgamer\PhishTank\Hook:private] => https://github.com
    [requestData:pxgamer\PhishTank\Hook:private] => Array
        (
            [format] => json
            [url] => https://github.com
        )

    [app_key:pxgamer\PhishTank\Hook:private] => 
    [meta:pxgamer\PhishTank\Hook:private] => pxgamer\PhishTank\Meta Object
        (
            [timestamp:protected] => DateTime Object
                (
                    [date] => 2017-08-07 13:18:13.000000
                    [timezone_type] => 1
                    [timezone] => +00:00
                )

            [serverid:protected] => ab9f6c17
            [status:protected] => 1
            [requestid:protected] => 146.112.225.22.59886895b52782.72884672
        )

    [results:pxgamer\PhishTank\Hook:private] => pxgamer\PhishTank\Results Object
        (
            [url:protected] => https://github.com
            [in_database:protected] => 
            [phish_id:protected] => 
            [phish_detail_page:protected] => 
            [verified:protected] => 
            [verified_at:protected] => 
            [valid:protected] => 
        )

)

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.