README

Installation

Composer

// change this to point correctly according// to your folder structure.require'./vendor/autoload.php';useVinelab\ITunes\AgentasiTunes;$iTunes=newiTunes();$response=$iTunes->search('Porcupine Tree')); // The original iTunes response$json=json_encode($response);

Laravel

Edit app.php and add 'Vinelab\ITunes\ITunesServiceProvider' to the 'providers' array.
It will automatically alias itself as ITunes which can be used as a Facade class.

Run php artisan vendor:publish to publish the config file.

This library supports Laravel 4 and Laravel 5.x, for installation in L4 use version 1.1.x.

Caching

you can specify the duration (in minutes) of caching per request as follows

NOTE: The last cache duration value set will remain for the rest of the requests so make sure you reset afterwards.

<?phpITunes::cacheFor(10);ITunes::search('Gangnam Style'); // will be cached for 10 min.ITunes::cacheFor(1);ITunes::search('Yesterday'); // will be cached for 1 min.// To bypass caching pass 0ITunes::cacheFor(0);ITunes::search('Hallelujah'); // won't be cached