# Airship PHP Library

PHP library for using Airship's messaging platform and related features.
## Resources

- [GitHub](https://github.com/urbanairship/php-library2/)
- [Packagist](https://packagist.org/packages/urbanairship/urbanairship)
- [Airship API Reference](https://www.airship.com/docs/developer/rest-api/ua/)
- [PHP Library API Reference](https://www.airship.com/docs/reference/libraries/php/latest)
    > **Important:** Airship is no longer actively developing this library but will respond to feature requests, issues, and pull requests submitted to the [Airship Support site](https://support.airship.com). This library provides sample code, and Airship makes no guarantees as to completeness or regularity of updates.

## Requirements

- PHP >= 5.3
Dependencies
- Composer
- Httpful
- Monolog
- Development dependencies: PHPUnit

## Example usage

**Basic usage example**

```php
<?php

require_once 'vendor/autoload.php';

use UrbanAirship\Airship;
use UrbanAirship\AirshipException;
use UrbanAirship\UALog;
use UrbanAirship\Push as P;
use Monolog\Logger;
use Monolog\Handler\StreamHandler;

UALog::setLogHandlers(array(new StreamHandler("php://stdout", Logger::DEBUG)));

$airship = new Airship("<app key>", "<master secret>");

try {
    $response = $airship->push()
        ->setAudience(P\iosChannel("Insert your iOS channel here!"))
        ->setNotification(P\notification("Hello from PHP"))
        ->setDeviceTypes(P\deviceTypes("ios"))
        ->send();
} catch (AirshipException $e) {
    print_r($e);
}
```

