cvs: pear /MDB2 package_mysql.php package_mysqli.php /MDB2/MDB2/Driver/Manager mysql.php mysqli.php

From: Date: Sun, 04 Mar 2007 22:50:17 +0000
Subject: cvs: pear /MDB2 package_mysql.php package_mysqli.php /MDB2/MDB2/Driver/Manager mysql.php mysqli.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-44962@lists.php.net to get a copy of this message
quipo Sun Mar 4 22:50:17 2007 UTC Modified files: /pear/MDB2/MDB2/Driver/Manager mysql.php mysqli.php /pear/MDB2 package_mysql.php package_mysqli.php Log: implemented listFunctions() in the Manager module http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/Manager/mysql.php?r1=1.93&r2=1.94&diff_format=u Index: pear/MDB2/MDB2/Driver/Manager/mysql.php diff -u pear/MDB2/MDB2/Driver/Manager/mysql.php:1.93 pear/MDB2/MDB2/Driver/Manager/mysql.php:1.94 --- pear/MDB2/MDB2/Driver/Manager/mysql.php:1.93 Fri Feb 16 16:41:25 2007 +++ pear/MDB2/MDB2/Driver/Manager/mysql.php Sun Mar 4 22:50:16 2007 @@ -2,7 +2,7 @@ // +----------------------------------------------------------------------+ // | PHP versions 4 and 5 | // +----------------------------------------------------------------------+ -// | Copyright (c) 1998-2006 Manuel Lemos, Tomas V.V.Cox, | +// | Copyright (c) 1998-2007 Manuel Lemos, Tomas V.V.Cox, | // | Stig. S. Bakken, Lukas Smith | // | All rights reserved. | // +----------------------------------------------------------------------+ @@ -42,7 +42,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: mysql.php,v 1.93 2007/02/16 16:41:25 quipo Exp $ +// $Id: mysql.php,v 1.94 2007/03/04 22:50:16 quipo Exp $ // require_once 'MDB2/Driver/Manager/Common.php'; @@ -419,6 +419,38 @@ } // }}} + // {{{ listFunctions() + + /** + * list all functions in the current database + * + * @return mixed array of function names on success, a MDB2 error on failure + * @access public + */ + function listFunctions() + { + $db =& $this->getDBInstance(); + if (PEAR::isError($db)) { + return $db; + } + + $query = "SELECT name FROM mysql.proc"; + /* + SELECT ROUTINE_NAME + FROM INFORMATION_SCHEMA.ROUTINES + WHERE ROUTINE_TYPE = 'FUNCTION' + */ + $result = $db->queryCol($query); + if (PEAR::isError($result)) { + return $result; + } + if ($db->options['portability'] & MDB2_PORTABILITY_FIX_CASE) { + $result = array_map(($db->options['field_case'] == CASE_LOWER ? 'strtolower' : 'strtoupper'), $result); + } + return $result; + } + + // }}} // {{{ listTableTriggers() /** http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/Manager/mysqli.php?r1=1.80&r2=1.81&diff_format=u Index: pear/MDB2/MDB2/Driver/Manager/mysqli.php diff -u pear/MDB2/MDB2/Driver/Manager/mysqli.php:1.80 pear/MDB2/MDB2/Driver/Manager/mysqli.php:1.81 --- pear/MDB2/MDB2/Driver/Manager/mysqli.php:1.80 Fri Feb 16 16:41:25 2007 +++ pear/MDB2/MDB2/Driver/Manager/mysqli.php Sun Mar 4 22:50:16 2007 @@ -2,7 +2,7 @@ // +----------------------------------------------------------------------+ // | PHP versions 4 and 5 | // +----------------------------------------------------------------------+ -// | Copyright (c) 1998-2006 Manuel Lemos, Tomas V.V.Cox, | +// | Copyright (c) 1998-2007 Manuel Lemos, Tomas V.V.Cox, | // | Stig. S. Bakken, Lukas Smith | // | All rights reserved. | // +----------------------------------------------------------------------+ @@ -42,7 +42,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: mysqli.php,v 1.80 2007/02/16 16:41:25 quipo Exp $ +// $Id: mysqli.php,v 1.81 2007/03/04 22:50:16 quipo Exp $ // require_once 'MDB2/Driver/Manager/Common.php'; @@ -419,6 +419,38 @@ } // }}} + // {{{ listFunctions() + + /** + * list all functions in the current database + * + * @return mixed array of function names on success, a MDB2 error on failure + * @access public + */ + function listFunctions() + { + $db =& $this->getDBInstance(); + if (PEAR::isError($db)) { + return $db; + } + + $query = "SELECT name FROM mysql.proc"; + /* + SELECT ROUTINE_NAME + FROM INFORMATION_SCHEMA.ROUTINES + WHERE ROUTINE_TYPE = 'FUNCTION' + */ + $result = $db->queryCol($query); + if (PEAR::isError($result)) { + return $result; + } + if ($db->options['portability'] & MDB2_PORTABILITY_FIX_CASE) { + $result = array_map(($db->options['field_case'] == CASE_LOWER ? 'strtolower' : 'strtoupper'), $result); + } + return $result; + } + + // }}} // {{{ listTableTriggers() /** http://cvs.php.net/viewvc.cgi/pear/MDB2/package_mysql.php?r1=1.100&r2=1.101&diff_format=u Index: pear/MDB2/package_mysql.php diff -u pear/MDB2/package_mysql.php:1.100 pear/MDB2/package_mysql.php:1.101 --- pear/MDB2/package_mysql.php:1.100 Wed Feb 28 16:05:45 2007 +++ pear/MDB2/package_mysql.php Sun Mar 4 22:50:17 2007 @@ -10,6 +10,7 @@ - propagate errors in getTableFieldDefinition() in the Reverse module - implemented getTriggerDefinition() in the Reverse module (mysql > 5.0.2) [experimental] - implemented listTableTriggers() in the Manager module (mysql > 5.0.2) +- implemented listFunctions() in the Manager module - setCharset() now uses "SET NAMES" instead of "SET character_set_client" - select the mysql database in listUsers() in the Manager module - added error codes for MySQL 5 (patch by Adam Harvey) http://cvs.php.net/viewvc.cgi/pear/MDB2/package_mysqli.php?r1=1.103&r2=1.104&diff_format=u Index: pear/MDB2/package_mysqli.php diff -u pear/MDB2/package_mysqli.php:1.103 pear/MDB2/package_mysqli.php:1.104 --- pear/MDB2/package_mysqli.php:1.103 Wed Feb 28 16:05:45 2007 +++ pear/MDB2/package_mysqli.php Sun Mar 4 22:50:17 2007 @@ -10,6 +10,7 @@ - propagate errors in getTableFieldDefinition() in the Reverse module - implemented getTriggerDefinition() in the Reverse module (mysql > 5.0.2) [experimental] - implemented listTableTriggers() in the Manager module (mysql > 5.0.2) +- implemented listFunctions() in the Manager module - setCharset() now uses "SET NAMES" instead of "SET character_set_client" - select the mysql database in listUsers() in the Manager module - added error codes for MySQL 5 (patch by Adam Harvey)

« previous php.pear.cvs (#44962) next »