|
|
Mozy Online Backup: 2GB Free. Automatic. Secure.
Subject: cvs: pear /DB_DataObject DataObject.php - msg#00518
List: php.cvs.pear
alan_k Wed Aug 28 00:12:30 2002 EDT
Modified files:
/pear/DB_DataObject DataObject.php
Log:
oops typo
Index: pear/DB_DataObject/DataObject.php
diff -u pear/DB_DataObject/DataObject.php:1.23
pear/DB_DataObject/DataObject.php:1.24
--- pear/DB_DataObject/DataObject.php:1.23 Wed Aug 28 00:11:25 2002
+++ pear/DB_DataObject/DataObject.php Wed Aug 28 00:12:30 2002
@@ -15,7 +15,7 @@
// | Author: Alan Knowles <alan@xxxxxxxxxxxx>
// +----------------------------------------------------------------------+
//
-// $Id: DataObject.php,v 1.23 2002/08/28 04:11:25 alan_k Exp $
+// $Id: DataObject.php,v 1.24 2002/08/28 04:12:30 alan_k Exp $
//
// Object Based Database Query Builder and data store
//
@@ -1161,7 +1161,7 @@
* @access public
* @return mixed object on success
*/
- function &getLink($row, $table=NULL,$link = FALSE;) {
+ function &getLink($row, $table=NULL,$link = FALSE) {
/* see if autolinking is available
This will do a recursive call!
*/
--
PEAR CVS Mailing List ( http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Was this page helpful?
Thread at a glance:
Previous Message by Date:
click to view message preview
cvs: pear /DB_DataObject DataObject.php package.xml /DB_DataObject/DataObject Generator.php
alan_k Wed Aug 28 00:11:26 2002 EDT
Modified files:
/pear/DB_DataObject DataObject.php package.xml
/pear/DB_DataObject/DataObject Generator.php
Log:
adding multiple link support, and ZE2 FC/BC support
Index: pear/DB_DataObject/DataObject.php
diff -u pear/DB_DataObject/DataObject.php:1.22
pear/DB_DataObject/DataObject.php:1.23
--- pear/DB_DataObject/DataObject.php:1.22 Mon Aug 26 20:34:43 2002
+++ pear/DB_DataObject/DataObject.php Wed Aug 28 00:11:25 2002
@@ -15,7 +15,7 @@
// | Author: Alan Knowles <alan@xxxxxxxxxxxx>
// +----------------------------------------------------------------------+
//
-// $Id: DataObject.php,v 1.22 2002/08/27 00:34:43 alan_k Exp $
+// $Id: DataObject.php,v 1.23 2002/08/28 04:11:25 alan_k Exp $
//
// Object Based Database Query Builder and data store
//
@@ -1118,9 +1118,13 @@
$cols = $this->_get_table();
$links =
&PEAR::getStaticProperty('DB_DataObject',"{$this->_database}.links");
if ($links) {
- foreach(array_keys($links[$this->__table]) as $key) {
- $k = "_{$key}";
- $this->$k = $this->getLink($key);
+ foreach($links[$this->__table] as $key=>$match) {
+ list($table,$link) = explode(':',$match);
+ $k = "_".str_replace('.','_',$key);
+ if ($p = strpos($row,".")) {
+ $key = substr($key,0,$p);
+ }
+ $this->$k = $this->getLink($key,$table,$link);
}
return;
}
@@ -1145,17 +1149,31 @@
* looks up table xxxxx, for value id=$this->xxxxx
* stores it in $this->_xxxxx_yyyyy
*
+ * you can also use
$this->getLink('rowname.othertablecol','table','othertablecol')
+ *
+ *
+ * @param string $row either row or row.xxxxx
+ * @param string optional $table name of table to look up value in
+ * @param string optional $link name of column in other table to match
+ *
+ *
* @author Tim White <tim@xxxxxxxxxx>
* @access public
* @return mixed object on success
*/
- function &getLink($row, $table=NULL) {
- $links =
&PEAR::getStaticProperty('DB_DataObject',"{$this->_database}.links");
- $link = FALSE;
+ function &getLink($row, $table=NULL,$link = FALSE;) {
+ /* see if autolinking is available
+ This will do a recursive call!
+ */
if ($table === NULL) {
+ $links =
&PEAR::getStaticProperty('DB_DataObject',"{$this->_database}.links");
if (@$links[$this->__table]) {
if ( @$links[$this->__table][$row]) {
list($table,$link) =
explode(':',$links[$this->__table][$row]);
+ if ($p = strpos($row,".")) {
+ $row = substr($row,0,$p);
+ }
+ return $this->getLink($row,$table,$link);
} else {
DB_DataObject::raiseError("getLink:
$row is not defined as a link", DB_DATAOBJECT_ERROR_NODATA);
return; // technically a possible error
condition?
@@ -1165,6 +1183,7 @@
return;
}
$table = substr($row,0,$p);
+ return $this->getLink($row,$table);
}
}
if (!isset($this->$row)) {
Index: pear/DB_DataObject/package.xml
diff -u pear/DB_DataObject/package.xml:1.5 pear/DB_DataObject/package.xml:1.6
--- pear/DB_DataObject/package.xml:1.5 Wed Aug 21 10:03:15 2002
+++ pear/DB_DataObject/package.xml Wed Aug 28 00:11:25 2002
@@ -21,10 +21,13 @@
</maintainer>
</maintainers>
<release>
- <version>0.4</version>
- <date>2002-08-21</date>
+ <version>0.5</version>
+ <date>2002-08-28</date>
<notes>
- - Bug fix release - createTables used wrong argv
+ - fixed database.links.ini file loading in wrong location (Jens
Fischer)
+ - fixed type on extends (Jens Fischer)
+ - added clone support to pre- php5 classes
+ - added multiple linked table support
</notes>
<state>beta</state>
<filelist>
@@ -39,6 +42,28 @@
</filelist>
</release>
<changelog>
+ <release>
+ <version>0.5</version>
+ <date>2002-08-28</date>
+ <notes>
+ - fixed database.links.ini file loading in wrong location (Jens
Fischer)
+ - fixed type on extends (Jens Fischer)
+ - added clone support to pre- php5 classes
+ - added multiple linked table support
+ </notes>
+ <state>beta</state>
+ <filelist>
+ <dir name="/" baseinstalldir="DB" role="php">
+ <file>DataObject.php</file>
+ <dir name="DataObject" role="php">
+ <file>Generator.php</file>
+ <file>createTables.php</file>
+ <file>example.ini</file>
+ </dir>
+ </dir>
+ </filelist>
+ </release>
+ </release>
<release>
<version>0.4</version>
<date>2002-08-21</date>
Index: pear/DB_DataObject/DataObject/Generator.php
diff -u pear/DB_DataObject/DataObject/Generator.php:1.6
pear/DB_DataObject/DataObject/Generator.php:1.7
--- pear/DB_DataObject/DataObject/Generator.php:1.6 Mon Aug 26 20:34:43 2002
+++ pear/DB_DataObject/DataObject/Generator.php Wed Aug 28 00:11:26 2002
@@ -352,6 +352,16 @@
// $sets[$t->Field] = "array".substr($t->Type,3);
}
+
+ /* FC/BC compatible with ZE2 */
+ $x = new StdClass;
+ if (!method_exists($x,'__clone')) {
+ $body .= "\n\n";
+ $body .= " /* ZE2 compatibility trick*/\n";
+ $body .= " function __clone() { return \$this;}\n\n";
+ }
+
+
// simple creation tools ! (static stuff!)
$body .= "\n\n";
$body .= " /* Static get */\n";
@@ -394,4 +404,4 @@
}
-?>
+?>
\ No newline at end of file
--
PEAR CVS Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Next Message by Date:
click to view message preview
cvs: pear /DB_DataObject package.xml
alan_k Wed Aug 28 00:22:48 2002 EDT
Modified files:
/pear/DB_DataObject package.xml
Log:
fix package file ready for next release
Index: pear/DB_DataObject/package.xml
diff -u pear/DB_DataObject/package.xml:1.6 pear/DB_DataObject/package.xml:1.7
--- pear/DB_DataObject/package.xml:1.6 Wed Aug 28 00:11:25 2002
+++ pear/DB_DataObject/package.xml Wed Aug 28 00:22:48 2002
@@ -26,7 +26,7 @@
<notes>
- fixed database.links.ini file loading in wrong location (Jens
Fischer)
- fixed type on extends (Jens Fischer)
- - added clone support to pre- php5 classes
+ - added __clone() support to pre- php5 classes
- added multiple linked table support
</notes>
<state>beta</state>
@@ -48,24 +48,14 @@
<notes>
- fixed database.links.ini file loading in wrong location (Jens
Fischer)
- fixed type on extends (Jens Fischer)
- - added clone support to pre- php5 classes
+ - added __clone() support to pre- php5 classes
- added multiple linked table support
</notes>
<state>beta</state>
- <filelist>
- <dir name="/" baseinstalldir="DB" role="php">
- <file>DataObject.php</file>
- <dir name="DataObject" role="php">
- <file>Generator.php</file>
- <file>createTables.php</file>
- <file>example.ini</file>
- </dir>
- </dir>
- </filelist>
- </release>
</release>
- <release>
- <version>0.4</version>
+
+ <release>
+ <version>0.4</version>
<date>2002-08-21</date>
<notes>
- Bug fix release - createTables used wrong argv
--
PEAR CVS Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Previous Message by Thread:
click to view message preview
cvs: pear /DB_DataObject DataObject.php
alan_k Fri Aug 16 01:15:55 2002 EDT
Modified files:
/pear/DB_DataObject DataObject.php
Log:
bug fixes by Tim White
alan_k-20020816011555.txt
Description: Text document
--
PEAR CVS Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Next Message by Thread:
click to view message preview
cvs: pearweb /public_html package-stats.php
tal Sat Aug 3 15:59:54 2002 EDT
Modified files:
/pearweb/public_html package-stats.php
Log:
* Made total downloads more visible..
Index: pearweb/public_html/package-stats.php
diff -u pearweb/public_html/package-stats.php:1.25
pearweb/public_html/package-stats.php:1.26
--- pearweb/public_html/package-stats.php:1.25 Wed Jul 31 10:17:14 2002
+++ pearweb/public_html/package-stats.php Sat Aug 3 15:59:54 2002
@@ -16,7 +16,7 @@
| Authors: Martin Jansen <mj@xxxxxxx> |
| Richard Heyes <richard@xxxxxxx> |
+----------------------------------------------------------------------+
- $Id: package-stats.php,v 1.25 2002/07/31 14:17:14 tal Exp $
+ $Id: package-stats.php,v 1.26 2002/08/03 19:59:54 tal Exp $
*/
require_once "HTML/Form.php";
@@ -299,6 +299,7 @@
$total_maintainers = number_format($dbh->getOne("SELECT COUNT(DISTINCT
handle) FROM maintains"), 0, '.', ',');
$total_releases = number_format($dbh->getOne("SELECT COUNT(*) FROM
package_stats"), 0, '.', ',');
$total_categories = number_format($dbh->getOne("SELECT COUNT(*) FROM
categories"), 0, '.', ',');
+ $total_downloads = number_format($dbh->getOne("SELECT COUNT(*) FROM
downloads"), 0, '.', ',');
$query = "SELECT dl_number, package, release, pid, rid, cid
FROM package_stats ORDER BY dl_number DESC";
}
@@ -323,6 +324,10 @@
<td width="25%">Total Categories:</td>
<td width="25%" align="center"
bgcolor="#cccccc"><?=$total_categories?></td>
</tr>
+ <tr>
+ <td width="25%">Total Downloads:</td>
+ <td width="25%" align="center"
bgcolor="#cccccc"><?=$total_downloads?></td>
+ </tr>
</table>
<?php
$bb->end();
@@ -350,7 +355,6 @@
echo "</tr>\n";
$lastPackage = "";
- $total_dl = 0;
while ($row = $sth->fetchRow(DB_FETCHMODE_ASSOC)) {
if ($row['package'] == $lastPackage) {
@@ -368,15 +372,7 @@
echo "<td>" . number_format($row['dl_number'], 0, '.', ',') .
"</td>\n";
echo "<td>[". make_link("/package-stats.php?cid=" . $row['cid'] .
"&pid=" . $row['pid'] . "&rid=" . $row['rid'], "Details") . "]</td>\n";
echo "</tr>\n";
- $total_dl += $row['dl_number'];
}
- echo "<tr bgcolor=\"#eeeeee\">\n";
- echo "<td>\n<b>Total</b></td>\n";
- echo "<td> </td>\n";
- echo "<td>\n<b>" . number_format($total_dl, 0, '.', ',') . "</b></td>\n";
- echo "<td> </td>\n";
- echo "</tr>\n";
-
echo "</table>\n";
$bb->end();
--
PEAR CVS Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
|
|