sgrodzicki / pagespeed
A PHP library to interact with the PageSpeed Insights API
Installs: 117 599
Dependents: 0
Suggesters: 0
Security: 0
Stars: 46
Watchers: 6
Forks: 8
Open Issues: 1
Requires
- php: >=5.3.3
- guzzlehttp/guzzle: >=3.0, <4.0
This package is not auto-updated.
Last update: 2024-11-09 13:05:08 UTC
README
A PHP module to interact with the PageSpeed Insights API.
Installation
The best way to install the library is by using Composer. Add the following to composer.json
in the root of your project:
{ "require": { "sgrodzicki/pagespeed": "~2.0" } }
Then, on the command line:
curl -s http://getcomposer.org/installer | php
php composer.phar install
Use the generated vendor/.composer/autoload.php
file to autoload the library classes.
Basic usage
<?php $pageSpeed = new \PageSpeed\Insights\Service(); $pageSpeed->getResults('http://www.example.com');
Tests
The client is tested with phpunit; you can run the tests, from the repository's root, by doing:
phpunit
Some tests may fail, due to requiring an internet connection (to test against a real API response). Make sure that you are connected to the internet before running the full test suite.