Coder Social home page Coder Social logo

pingback-php's Introduction

Pingback-PHP Build Status

What is this!

Library for performing Pingback requests in a simple way (Pingback 1.0 compliant).

Pingback-PHP is Pingback 1.0 standard specification compliant. Please refer to its original webpage to get deeper information about how it works.

A quick example:

To inform to this article that you have referenced it from one of your posts by using the Pingback protocol, you can make it like this:

// Prepare the Pingback client
$requestHandler = new Pingback\RequestHandler();
$client = new Pingback\Client($requestHandler);

// Perform the pingback call
try {

    $client->ping(
        "http://www.mabishu.com/blog/2012/12/14/get-better-performance-and-life-from-your-ssd-in-linux-based-systems/",
        "http://www.mabishu.com/blog/2012/12/14/object-calisthenics-write-better-object-oriented-code/";
    );

} catch (Pingback\Exception $e) {
  printf("Exception raised with code (%d) : %s\n", $e->getCode(), $e->getMessage());
}

Exception-aware

Pingback-PHP raises different exceptions if some error happens in the target server or between client-server communication.

All the exceptions has a direct correlation with the server reported faults:

  • 0: A generic fault code.
  • 0×0010 (16): The source URI does not exist.
  • 0×0011 (17): The source URI does not contain a link to the target URI
  • 0×0020 (32): The specified target URI does not exist.
  • 0×0021 (33): The specified target URI cannot be used as a target.
  • 0×0030 (48): The pingback has already been registered.
  • 0×0031 (49): Access denied.
  • 0×0032 (50): The server could not communicate with an upstream server.

So take care of this raised exceptions in your code.

Install it!

  1. Just put in one of your include_path folders, and make sure to use an PSR-0-compatible autoloader.

Dependencies

This library is only compatible with PHP 5.3 or later.

  • For now the unique dependency is the xmlrpc php extension for encoding/decing the protocol messages. We are looking to replace this with a simple library.

Test it!

Help us to mantain this library updated. Run our unit tests with phpunit to give us feedback about what doesn't work.

For running tests:

  1. Install in your system PHPUnit: http://pear.phpunit.de/
  2. And simply run phpunit from the root of projct: phpunit

And... what else?

If you find a bug or want to suggest a new video service, please let us know in a ticket.

Thanks!!

pingback-php's People

Contributors

frandieguez avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.