cvs: pear /MDB manager_common.php
| From: | Lukas Smith | Date: | Wed, 10 Jul 2002 11:18:57 +0000 |
| Subject: | cvs: pear /MDB manager_common.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-5015@lists.php.net to get a copy of this message | ||
lsmith Wed Jul 10 07:18:57 2002 EDT
Modified files:
/pear/MDB manager_common.php
Log:
added _isSrquenceName
Index: pear/MDB/manager_common.php
diff -u pear/MDB/manager_common.php:1.6 pear/MDB/manager_common.php:1.7
--- pear/MDB/manager_common.php:1.6 Thu Jul 4 15:10:17 2002
+++ pear/MDB/manager_common.php Wed Jul 10 07:18:57 2002
@@ -42,7 +42,7 @@
// | Author: Lukas Smith <smith@dybnet.de> |
// +----------------------------------------------------------------------+
//
-// $Id: manager_common.php,v 1.6 2002/07/04 19:10:17 lsmith Exp $
+// $Id: manager_common.php,v 1.7 2002/07/10 11:18:57 lsmith Exp $
//
// MDB proxy class for RDBMS management methods.
//
@@ -117,7 +117,30 @@
}
return (DB_OK);
}
-
+
+ // }}}
+ // {{{ _isSequenceName()
+
+ /**
+ * list all tables in the current database
+ *
+ * @param $dbs (reference) array where database names will be stored
+ * @param string $sqn string that containts name of a potential sequence
+ *
+ * @access privat
+ *
+ * @return mixed name of the sequence if $sqn is a name of a sequence, else FALSE
+ */
+ function _isSequenceName(&$db, $sqn)
+ {
+ $seq_pattern = '/^'.preg_replace('/%s/', '([a-z0-9_]+)',
$db->options['seqname_format']).'$/i';
+ $seq_name = preg_replace($seq_pattern, '\\1', $sqn);
+ if($seq_name && $sqn == $db->getSequenceName($seq_name)) {
+ return $seq_name;
+ }
+ return FALSE;
+ }
+
/* PUBLIC METHODS */
function createDatabase(&$db, $database)