Fastly PHP Client
Installation via Composer
The recommended method to install Fastly-PHP is through Composer.
-
Add
fastly/fastly
as a dependency in your project'scomposer.json
:{ "require": { "fastly/fastly": "dev-master" } }
-
Download and install Composer:
curl -s http://getcomposer.org/installer | php
-
Install your dependencies:
php composer.phar install --no-dev
-
Require Composer's autoloader
Composer also prepares an autoload file that's capable of autoloading all of the classes in any of the libraries that it downloads. To use it, just add the following line to your code's bootstrap process:
<?php require 'vendor/autoload.php'; $client = new Fastly\API();
You can find out more on how to install Composer, configure autoloading, and other best-practices for defining dependencies at getcomposer.org.
You'll notice that the installation command specified --no-dev
. This prevents Composer from installing the various testing and development dependencies. For average users, there is no need to install the test suite. If you wish to contribute to development, just omit the --no-dev
flag to be able to run tests.
Example
$fastly = new Fastly\API();
$fastly->API_purge( 'http://example.com/page.html' );
TODO
docs consistantly formatted docs rest of the API functions unit test files