phpYahoo Version 2.0 Released
jay
Ok for those following this project I must apologize for the erratic releases and versions.
Starting today Feb 2, 2007 phpYahoo is at a milestone of version 2.0.
This version contains one single class and each of the Yahoo! Services is a method. This borrows heavily from the phpFlickr Class by Dan Coulter where he built a single class for all of the Flicker functions.
Whereas I at one point thought it would be smart to create a base class that hold utility functions for Yahoo and then a separate class for each of the Yahoo Services like Site Explorer, Web Searching, Audio Searching and so on. So what's wrong with that? Well when it came time to build demos it became very unclear on what class need to be added and to which instance you needed to add your Yahoo AppID.
So I decided to condense the search functions fro each of the sub-classes and place all of the functionality in one single manageable class. This now gives you access to any function (that's been coded) in the Yahoo! Services in one single class instance.
So what's in this version?
Version 2.0 Features
- Caching w/ to a Database using either PDO or the file system
- Yahoo! Web, Video, Image and Related Search Services
- Site Explorer APIs from Yahoo! Search Web Services
- My Web APIs from Yahoo! Search Web Services
Caching
To set up caching using a database you'll need to set up MySQL Database and then modify the PDO connection in the enableCache function. A fgew lines below the connection string you can see the code that will create the cache table for you. Once the table is created I'd advice going in and commenting out this code so it doesn't every time the function is invoked.
PHP:
-
$db =new PDO('mysql:host=<SERVER>;dbname=<DATABASE>','<USERNAME>','<PASSWORD>');
Then enable caching like this:
PHP:
-
include_once('api/phpYahoo.php');
-
$y = new phpYahoo('<YAHOOAPPID>');
-
$y->enableCache('db');
If you want file system caching just change the enableCache to 'fs':
PHP:
-
include_once('api/phpYahoo.php');
-
$y = new phpYahoo('<YAHOOAPPID>');
-
$y->enableCache('fs');
And then create a folder named 'yahoo_cache' that is writable on your web server.
Posted in phpYahoo, Documentation, Release |






