cvs: pear /Services_YouTube ChangeLog YouTube.php makepackage.php package.xml package2.xml /Services_YouTube/YouTube Exception.php
/Services_YouTube/examples example.php
| From: | Shin OHNO | Date: | Fri, 20 Oct 2006 03:24:49 +0000 |
| Subject: | cvs: pear /Services_YouTube ChangeLog YouTube.php makepackage.php package.xml package2.xml /Services_YouTube/YouTube Exception.php /Services_YouTube/examples example.php |
||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-42667@lists.php.net to get a copy of this message | ||
shin Fri Oct 20 03:24:49 2006 UTC
Modified files:
/pear/Services_YouTube ChangeLog YouTube.php makepackage.php
package.xml package2.xml
/pear/Services_YouTube/YouTube Exception.php
/pear/Services_YouTube/examples example.php
Log:
next release VERSION 0.2.0
- Added errorHandlerCallback in Services_YouTube_Exception class.
- Added set_error_hander in constructor of Services_YouTube class.
http://cvs.php.net/viewvc.cgi/pear/Services_YouTube/ChangeLog?r1=1.3&r2=1.4&diff_format=u Index: pear/Services_YouTube/ChangeLog diff -u pear/Services_YouTube/ChangeLog:1.3 pear/Services_YouTube/ChangeLog:1.4 --- pear/Services_YouTube/ChangeLog:1.3 Wed Oct 4 00:08:28 2006 +++ pear/Services_YouTube/ChangeLog Fri Oct 20 03:24:48 2006 @@ -1,7 +1,14 @@ -$Id: ChangeLog,v 1.3 2006/10/04 00:08:28 shin Exp $ +$Id: ChangeLog,v 1.4 2006/10/20 03:24:48 shin Exp $ see package.xml for newer changlogs +2006-10-20 Shin Ohno<ganchiku@gmail.com> + * VERSION: version 0.2.0 (alpha) released. + + - Added errorHandlerCallback in Services_YouTube_Exception class. + - Added set_error_hander in constructor of Services_YouTube class. + 2006-10-01 Shin Ohno<ganchiku@gmail.com> * VERSION: version 0.1.4 (alpha) released. + - Added Unit Tests. - Removed my personal YouTube DEV_ID from example.php @@ -10,7 +17,7 @@ - Removed unnecessary docblock. - Removed string "Exception :" to avoid redundancy. - - Moved Services_YouTube_Exception Class in Services/YouTube/Exception.php + - Moved Services_YouTube_Exception class in Services/YouTube/Exception.php - Fixed private vars and methods to protected to allow class extension. - Fixed define state, and use const instead. - Fixed spelling. (developper to developer, RespnseFormat to ResponseFormat. http://cvs.php.net/viewvc.cgi/pear/Services_YouTube/YouTube.php?r1=1.2&r2=1.3&diff_format=u Index: pear/Services_YouTube/YouTube.php diff -u pear/Services_YouTube/YouTube.php:1.2 pear/Services_YouTube/YouTube.php:1.3 --- pear/Services_YouTube/YouTube.php:1.2 Sat Sep 30 18:10:01 2006 +++ pear/Services_YouTube/YouTube.php Fri Oct 20 03:24:48 2006 @@ -17,7 +17,7 @@ * @package Services_YouTube * @author Shin Ohno <ganchiku@gmail.com> * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version 0.1.4 $Id: YouTube.php,v 1.2 2006/09/30 18:10:01 shin Exp $ + * @version 0.2.0 $Id: YouTube.php,v 1.3 2006/10/20 03:24:48 shin Exp $ * @see http://www.youtube.com/dev * @since 0.1 */ @@ -31,7 +31,7 @@ * Services_YouTube * * @package Services_YouTube - * @version 0.1.4 + * @version 0.2.0 * @author Shin Ohno <ganchiku@gmail.com> */ class Services_YouTube @@ -40,7 +40,7 @@ /** * Version of this package */ - const VERSION = '0.1.3'; + const VERSION = '0.2.0'; /** * URL of the YouTube Server @@ -109,6 +109,7 @@ */ public function __construct($developerId, $options = array()) { + set_error_handler(array('Services_YouTube_Exception', 'errorHandlerCallback'), E_ALL); $this->developerId = $developerId; $availableOptions = array('useCache', 'cacheOptions', 'responseFormat', 'driver'); foreach ($options as $key => $value) { @@ -282,7 +283,9 @@ // }}} // {{{ protected /** - * Send XML_RPC Request and unserialize the response xml to the array + * Send Request either rest or xmlrpc approach, and return simplexml_element of the response. + * When $this->usesCaches is true, use Cache_Lite the response xml. + * If $this->responseFormat is "array", return array, instead simplexml_element. * * @param string $method * @param array $parameters @@ -423,7 +426,6 @@ } return $return; } - // }}} } http://cvs.php.net/viewvc.cgi/pear/Services_YouTube/makepackage.php?r1=1.4&r2=1.5&diff_format=u Index: pear/Services_YouTube/makepackage.php diff -u pear/Services_YouTube/makepackage.php:1.4 pear/Services_YouTube/makepackage.php:1.5 --- pear/Services_YouTube/makepackage.php:1.4 Wed Oct 4 00:08:28 2006 +++ pear/Services_YouTube/makepackage.php Fri Oct 20 03:24:48 2006 @@ -1,16 +1,16 @@ <?php -/* $Id: makepackage.php,v 1.4 2006/10/04 00:08:28 shin Exp $ */ +/* $Id: makepackage.php,v 1.5 2006/10/20 03:24:48 shin Exp $ */ require_once 'PEAR/PackageFileManager2.php'; PEAR::setErrorHandling(PEAR_ERROR_DIE); unlink('package.xml'); -$releaseVersion = '0.1.4'; +$releaseVersion = '0.2.0'; $apiVersion = '0.1.0'; $changelog = ' - - Added Unit Tests - - Removed my personal YouTube DEV_ID from example.php + - Added errorHandlerCallback in Services_YouTube_Exception class. + - Added set_error_hander in constructor of Services_YouTube class. '; -$notes = 'Added Unit Tests'; +$notes = $changelog; $packagexml = new PEAR_PackageFileManager2(); $packagexml->setOptions(array('filelistgenerator' => 'file', 'packagefile' => 'package2.xml', http://cvs.php.net/viewvc.cgi/pear/Services_YouTube/package.xml?r1=1.4&r2=1.5&diff_format=u Index: pear/Services_YouTube/package.xml diff -u pear/Services_YouTube/package.xml:1.4 pear/Services_YouTube/package.xml:1.5 --- pear/Services_YouTube/package.xml:1.4 Wed Oct 4 00:08:28 2006 +++ pear/Services_YouTube/package.xml Fri Oct 20 03:24:48 2006 @@ -14,11 +14,12 @@ </maintainer> </maintainers> <release> - <version>0.1.4</version> - <date>2006-10-04</date> + <version>0.2.0</version> + <date>2006-10-20</date> <license>PHP License</license> <state>alpha</state> - <notes>Added Unit Tests + <notes>- Added errorHandlerCallback in Services_YouTube_Exception class. + - Added set_error_hander in constructor of Services_YouTube class. </notes> <deps> <dep type="php" rel="ge" version="5.1.0" optional="no"/> @@ -481,7 +482,16 @@ <license>PHP License</license> <state>alpha</state> <notes>- Added Unit Tests - - Removed my personal YouTube DEV_ID from example.php +- Removed my personal YouTube DEV_ID from example.php + </notes> + </release> + <release> + <version>0.2.0</version> + <date>2006-10-20</date> + <license>PHP License</license> + <state>alpha</state> + <notes>- Added errorHandlerCallback in Services_YouTube_Exception class. + - Added set_error_hander in constructor of Services_YouTube class. </notes> </release> </changelog> http://cvs.php.net/viewvc.cgi/pear/Services_YouTube/package2.xml?r1=1.4&r2=1.5&diff_format=u Index: pear/Services_YouTube/package2.xml diff -u pear/Services_YouTube/package2.xml:1.4 pear/Services_YouTube/package2.xml:1.5 --- pear/Services_YouTube/package2.xml:1.4 Wed Oct 4 00:08:28 2006 +++ pear/Services_YouTube/package2.xml Fri Oct 20 03:24:48 2006 @@ -13,10 +13,10 @@ <email>ganchiku@gmail.com</email> <active>yes</active> </lead> - <date>2006-10-04</date> - <time>08:59:46</time> + <date>2006-10-20</date> + <time>12:18:50</time> <version> - <release>0.1.4</release> + <release>0.2.0</release> <api>0.1.0</api> </version> <stability> @@ -24,7 +24,10 @@ <api>alpha</api> </stability> <license uri="http://www.php.net/license">PHP License</license> - <notes>Added Unit Tests</notes> + <notes> + - Added errorHandlerCallback in Services_YouTube_Exception class. + - Added set_error_hander in constructor of Services_YouTube class. + </notes> <contents> <dir baseinstalldir="Services" name="/"> <dir name="docs"> @@ -530,9 +533,23 @@ </stability> <date>2006-10-04</date> <license uri="http://www.php.net/license">PHP License</license> + <notes>- Added Unit Tests +- Removed my personal YouTube DEV_ID from example.php</notes> + </release> + <release> + <version> + <release>0.2.0</release> + <api>0.1.0</api> + </version> + <stability> + <release>alpha</release> + <api>alpha</api> + </stability> + <date>2006-10-20</date> + <license uri="http://www.php.net/license">PHP License</license> <notes> - - Added Unit Tests - - Removed my personal YouTube DEV_ID from example.php + - Added errorHandlerCallback in Services_YouTube_Exception class. + - Added set_error_hander in constructor of Services_YouTube class. </notes> </release> </changelog> http://cvs.php.net/viewvc.cgi/pear/Services_YouTube/YouTube/Exception.php?r1=1.1.1.1&r2=1.2&diff_format=u Index: pear/Services_YouTube/YouTube/Exception.php diff -u pear/Services_YouTube/YouTube/Exception.php:1.1.1.1 pear/Services_YouTube/YouTube/Exception.php:1.2 --- pear/Services_YouTube/YouTube/Exception.php:1.1.1.1 Wed Sep 6 16:47:56 2006 +++ pear/Services_YouTube/YouTube/Exception.php Fri Oct 20 03:24:48 2006 @@ -30,5 +30,23 @@ */ class Services_YouTube_Exception extends PEAR_Exception { + /** + * errorHandlerCallback + * + * @param int $code + * @param string $string + * @param string $file + * @param int $line + * @param array $context + * @static + * @access public + * throw Services_YouTube_Exception + */ + public static function errorHandlerCallback($code, $string, $file, $line, $context) { + $e = new self($string, $code); + $e->line = $line; + $e->file = $file; + throw $e; + } } ?> http://cvs.php.net/viewvc.cgi/pear/Services_YouTube/examples/example.php?r1=1.3&r2=1.4&diff_format=u Index: pear/Services_YouTube/examples/example.php diff -u pear/Services_YouTube/examples/example.php:1.3 pear/Services_YouTube/examples/example.php:1.4 --- pear/Services_YouTube/examples/example.php:1.3 Wed Oct 4 00:08:28 2006 +++ pear/Services_YouTube/examples/example.php Fri Oct 20 03:24:48 2006 @@ -113,6 +113,7 @@ print '<hr>'; print '<div>Here is the sample using my dev id.</div>'; print '<a href="http://www.unchiku.com/example.php">Featured List</a>'; + print "error"; exit; } $table = getVideoTable($videos);
http://cvs.php.net/viewvc.cgi/pear/Services_YouTube/ChangeLog?r1=1.3&r2=1.4&diff_format=u Index: pear/Services_YouTube/ChangeLog diff -u pear/Services_YouTube/ChangeLog:1.3 pear/Services_YouTube/ChangeLog:1.4 --- pear/Services_YouTube/ChangeLog:1.3 Wed Oct 4 00:08:28 2006 +++ pear/Services_YouTube/ChangeLog Fri Oct 20 03:24:48 2006 @@ -1,7 +1,14 @@ -$Id: ChangeLog,v 1.3 2006/10/04 00:08:28 shin Exp $ +$Id: ChangeLog,v 1.4 2006/10/20 03:24:48 shin Exp $ see package.xml for newer changlogs +2006-10-20 Shin Ohno<ganchiku@gmail.com> + * VERSION: version 0.2.0 (alpha) released. + + - Added errorHandlerCallback in Services_YouTube_Exception class. + - Added set_error_hander in constructor of Services_YouTube class. + 2006-10-01 Shin Ohno<ganchiku@gmail.com> * VERSION: version 0.1.4 (alpha) released. + - Added Unit Tests. - Removed my personal YouTube DEV_ID from example.php @@ -10,7 +17,7 @@ - Removed unnecessary docblock. - Removed string "Exception :" to avoid redundancy. - - Moved Services_YouTube_Exception Class in Services/YouTube/Exception.php + - Moved Services_YouTube_Exception class in Services/YouTube/Exception.php - Fixed private vars and methods to protected to allow class extension. - Fixed define state, and use const instead. - Fixed spelling. (developper to developer, RespnseFormat to ResponseFormat. http://cvs.php.net/viewvc.cgi/pear/Services_YouTube/YouTube.php?r1=1.2&r2=1.3&diff_format=u Index: pear/Services_YouTube/YouTube.php diff -u pear/Services_YouTube/YouTube.php:1.2 pear/Services_YouTube/YouTube.php:1.3 --- pear/Services_YouTube/YouTube.php:1.2 Sat Sep 30 18:10:01 2006 +++ pear/Services_YouTube/YouTube.php Fri Oct 20 03:24:48 2006 @@ -17,7 +17,7 @@ * @package Services_YouTube * @author Shin Ohno <ganchiku@gmail.com> * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version 0.1.4 $Id: YouTube.php,v 1.2 2006/09/30 18:10:01 shin Exp $ + * @version 0.2.0 $Id: YouTube.php,v 1.3 2006/10/20 03:24:48 shin Exp $ * @see http://www.youtube.com/dev * @since 0.1 */ @@ -31,7 +31,7 @@ * Services_YouTube * * @package Services_YouTube - * @version 0.1.4 + * @version 0.2.0 * @author Shin Ohno <ganchiku@gmail.com> */ class Services_YouTube @@ -40,7 +40,7 @@ /** * Version of this package */ - const VERSION = '0.1.3'; + const VERSION = '0.2.0'; /** * URL of the YouTube Server @@ -109,6 +109,7 @@ */ public function __construct($developerId, $options = array()) { + set_error_handler(array('Services_YouTube_Exception', 'errorHandlerCallback'), E_ALL); $this->developerId = $developerId; $availableOptions = array('useCache', 'cacheOptions', 'responseFormat', 'driver'); foreach ($options as $key => $value) { @@ -282,7 +283,9 @@ // }}} // {{{ protected /** - * Send XML_RPC Request and unserialize the response xml to the array + * Send Request either rest or xmlrpc approach, and return simplexml_element of the response. + * When $this->usesCaches is true, use Cache_Lite the response xml. + * If $this->responseFormat is "array", return array, instead simplexml_element. * * @param string $method * @param array $parameters @@ -423,7 +426,6 @@ } return $return; } - // }}} } http://cvs.php.net/viewvc.cgi/pear/Services_YouTube/makepackage.php?r1=1.4&r2=1.5&diff_format=u Index: pear/Services_YouTube/makepackage.php diff -u pear/Services_YouTube/makepackage.php:1.4 pear/Services_YouTube/makepackage.php:1.5 --- pear/Services_YouTube/makepackage.php:1.4 Wed Oct 4 00:08:28 2006 +++ pear/Services_YouTube/makepackage.php Fri Oct 20 03:24:48 2006 @@ -1,16 +1,16 @@ <?php -/* $Id: makepackage.php,v 1.4 2006/10/04 00:08:28 shin Exp $ */ +/* $Id: makepackage.php,v 1.5 2006/10/20 03:24:48 shin Exp $ */ require_once 'PEAR/PackageFileManager2.php'; PEAR::setErrorHandling(PEAR_ERROR_DIE); unlink('package.xml'); -$releaseVersion = '0.1.4'; +$releaseVersion = '0.2.0'; $apiVersion = '0.1.0'; $changelog = ' - - Added Unit Tests - - Removed my personal YouTube DEV_ID from example.php + - Added errorHandlerCallback in Services_YouTube_Exception class. + - Added set_error_hander in constructor of Services_YouTube class. '; -$notes = 'Added Unit Tests'; +$notes = $changelog; $packagexml = new PEAR_PackageFileManager2(); $packagexml->setOptions(array('filelistgenerator' => 'file', 'packagefile' => 'package2.xml', http://cvs.php.net/viewvc.cgi/pear/Services_YouTube/package.xml?r1=1.4&r2=1.5&diff_format=u Index: pear/Services_YouTube/package.xml diff -u pear/Services_YouTube/package.xml:1.4 pear/Services_YouTube/package.xml:1.5 --- pear/Services_YouTube/package.xml:1.4 Wed Oct 4 00:08:28 2006 +++ pear/Services_YouTube/package.xml Fri Oct 20 03:24:48 2006 @@ -14,11 +14,12 @@ </maintainer> </maintainers> <release> - <version>0.1.4</version> - <date>2006-10-04</date> + <version>0.2.0</version> + <date>2006-10-20</date> <license>PHP License</license> <state>alpha</state> - <notes>Added Unit Tests + <notes>- Added errorHandlerCallback in Services_YouTube_Exception class. + - Added set_error_hander in constructor of Services_YouTube class. </notes> <deps> <dep type="php" rel="ge" version="5.1.0" optional="no"/> @@ -481,7 +482,16 @@ <license>PHP License</license> <state>alpha</state> <notes>- Added Unit Tests - - Removed my personal YouTube DEV_ID from example.php +- Removed my personal YouTube DEV_ID from example.php + </notes> + </release> + <release> + <version>0.2.0</version> + <date>2006-10-20</date> + <license>PHP License</license> + <state>alpha</state> + <notes>- Added errorHandlerCallback in Services_YouTube_Exception class. + - Added set_error_hander in constructor of Services_YouTube class. </notes> </release> </changelog> http://cvs.php.net/viewvc.cgi/pear/Services_YouTube/package2.xml?r1=1.4&r2=1.5&diff_format=u Index: pear/Services_YouTube/package2.xml diff -u pear/Services_YouTube/package2.xml:1.4 pear/Services_YouTube/package2.xml:1.5 --- pear/Services_YouTube/package2.xml:1.4 Wed Oct 4 00:08:28 2006 +++ pear/Services_YouTube/package2.xml Fri Oct 20 03:24:48 2006 @@ -13,10 +13,10 @@ <email>ganchiku@gmail.com</email> <active>yes</active> </lead> - <date>2006-10-04</date> - <time>08:59:46</time> + <date>2006-10-20</date> + <time>12:18:50</time> <version> - <release>0.1.4</release> + <release>0.2.0</release> <api>0.1.0</api> </version> <stability> @@ -24,7 +24,10 @@ <api>alpha</api> </stability> <license uri="http://www.php.net/license">PHP License</license> - <notes>Added Unit Tests</notes> + <notes> + - Added errorHandlerCallback in Services_YouTube_Exception class. + - Added set_error_hander in constructor of Services_YouTube class. + </notes> <contents> <dir baseinstalldir="Services" name="/"> <dir name="docs"> @@ -530,9 +533,23 @@ </stability> <date>2006-10-04</date> <license uri="http://www.php.net/license">PHP License</license> + <notes>- Added Unit Tests +- Removed my personal YouTube DEV_ID from example.php</notes> + </release> + <release> + <version> + <release>0.2.0</release> + <api>0.1.0</api> + </version> + <stability> + <release>alpha</release> + <api>alpha</api> + </stability> + <date>2006-10-20</date> + <license uri="http://www.php.net/license">PHP License</license> <notes> - - Added Unit Tests - - Removed my personal YouTube DEV_ID from example.php + - Added errorHandlerCallback in Services_YouTube_Exception class. + - Added set_error_hander in constructor of Services_YouTube class. </notes> </release> </changelog> http://cvs.php.net/viewvc.cgi/pear/Services_YouTube/YouTube/Exception.php?r1=1.1.1.1&r2=1.2&diff_format=u Index: pear/Services_YouTube/YouTube/Exception.php diff -u pear/Services_YouTube/YouTube/Exception.php:1.1.1.1 pear/Services_YouTube/YouTube/Exception.php:1.2 --- pear/Services_YouTube/YouTube/Exception.php:1.1.1.1 Wed Sep 6 16:47:56 2006 +++ pear/Services_YouTube/YouTube/Exception.php Fri Oct 20 03:24:48 2006 @@ -30,5 +30,23 @@ */ class Services_YouTube_Exception extends PEAR_Exception { + /** + * errorHandlerCallback + * + * @param int $code + * @param string $string + * @param string $file + * @param int $line + * @param array $context + * @static + * @access public + * throw Services_YouTube_Exception + */ + public static function errorHandlerCallback($code, $string, $file, $line, $context) { + $e = new self($string, $code); + $e->line = $line; + $e->file = $file; + throw $e; + } } ?> http://cvs.php.net/viewvc.cgi/pear/Services_YouTube/examples/example.php?r1=1.3&r2=1.4&diff_format=u Index: pear/Services_YouTube/examples/example.php diff -u pear/Services_YouTube/examples/example.php:1.3 pear/Services_YouTube/examples/example.php:1.4 --- pear/Services_YouTube/examples/example.php:1.3 Wed Oct 4 00:08:28 2006 +++ pear/Services_YouTube/examples/example.php Fri Oct 20 03:24:48 2006 @@ -113,6 +113,7 @@ print '<hr>'; print '<div>Here is the sample using my dev id.</div>'; print '<a href="http://www.unchiku.com/example.php">Featured List</a>'; + print "error"; exit; } $table = getVideoTable($videos);