[Openfirst-cvscommit] SF.net SVN: openfirst: [218] trunk/src
Brought to you by:
xtimg
|
From: <ast...@us...> - 2007-04-06 21:10:27
|
Revision: 218
http://svn.sourceforge.net/openfirst/?rev=218&view=rev
Author: astronouth7303
Date: 2007-04-06 14:10:28 -0700 (Fri, 06 Apr 2007)
Log Message:
-----------
- Fixed some warnings/notices in xmlModule.php and Module.php
- Fixed DataBase::replace()
Modified Paths:
--------------
trunk/src/config/first.php
trunk/src/config/install.php
trunk/src/includes/Module.php
trunk/src/includes/dbase.php
trunk/src/includes/xmlModule.php
Modified: trunk/src/config/first.php
===================================================================
--- trunk/src/config/first.php 2007-03-25 21:29:23 UTC (rev 217)
+++ trunk/src/config/first.php 2007-04-06 21:10:28 UTC (rev 218)
@@ -33,7 +33,7 @@
// Initialize header/footer vars
$Title = 'openFIRST Installation';
- $StylePath = 'http://openfirst.sourceforge.net';
+ $ogStylePath = 'http://openfirst.sourceforge.net';
define('OPENFIRST_INSTALLATION_SCRIPT', true); // Only define if it's the installation script
@@ -130,7 +130,7 @@
to the configuration options. You should be able to login using the username
<b class=\"user\">admin</b> and the password <b class=\"password\">openfirst</b>, if not, then either
the password for that account has been changed, or the MySQL settings are incorrect.</p>");
- echo '<p class="big">Continue to the <a href="'.htmlentities($BasePath).'/config/">administration page</a>.</p>';
+ echo '<p class="big">Continue to the <a href="'.htmlentities($ogBasePath).'/config/">administration page</a>.</p>';
}
include_once($ogFooter);
die;
Modified: trunk/src/config/install.php
===================================================================
--- trunk/src/config/install.php 2007-03-25 21:29:23 UTC (rev 217)
+++ trunk/src/config/install.php 2007-04-06 21:10:28 UTC (rev 218)
@@ -99,6 +99,7 @@
$IsInstalled = true;
} else {
$InstallFailed = true;
+ #$err .= "\n".$ogLastQuery;
}
}
echo '<tr><td><input type="checkbox" name="'.htmlentities($dir).'" ';
Modified: trunk/src/includes/Module.php
===================================================================
--- trunk/src/includes/Module.php 2007-03-25 21:29:23 UTC (rev 217)
+++ trunk/src/includes/Module.php 2007-04-06 21:10:28 UTC (rev 218)
@@ -77,7 +77,8 @@
if (isset($this->modules[$dir])) {
return $this->modules[$dir];
} else {
- return false;
+ $rv = false;
+ return $rv;
}
}
@@ -251,4 +252,6 @@
}
require_once('BaseModule.php');
+
+# vim:set expandtab tabwidth=2 :
?>
Modified: trunk/src/includes/dbase.php
===================================================================
--- trunk/src/includes/dbase.php 2007-03-25 21:29:23 UTC (rev 217)
+++ trunk/src/includes/dbase.php 2007-04-06 21:10:28 UTC (rev 218)
@@ -373,11 +373,15 @@
* @param array $values An array of values to use, as if they had been passed to insert().
*/
function replace( $table, $unique, $values ) {
- $etable = $this->quoteTable($table);
- $eunique = $this->quoteFDPairs($unique, ' AND ');
- $sql = "DELTE FROM {$etable} WHERE {$eunique};
- INSERT INTO {$etable} (".$this->quoteField(array_keys($values)).") VALUES (".$this->quoteData(array_values($values)).")";
- return $this->query( $sql );
+ #$etable = $this->quoteTable($table);
+ #$eunique = $this->quoteFDPairs($unique, ' AND ');
+ #$sql = "DELETE FROM {$etable} WHERE {$eunique}; ".
+ #"INSERT INTO {$etable} (".$this->quoteField(array_keys($values)).") VALUES (".$this->quoteData(array_values($values)).")";
+ #return $this->query( $sql );
+ $rv = $this->delete($table, $unique);
+ if ($rv === false) return $rv;
+ $rv = $this->insert($table, $values);
+ return $rv;
}
/** INSERT query wrapper.
@@ -403,7 +407,7 @@
$table = $this->quoteTable( $table );
$sql = "DELETE FROM $table";
if ( $conds != '*' ) {
- $sql .= ' WHERE ' . $this->quoteFDPairs( $conds );
+ $sql .= ' WHERE ' . $this->quoteFDPairs( $conds, ' AND ' );
}
return $this->query( $sql );
}
Modified: trunk/src/includes/xmlModule.php
===================================================================
--- trunk/src/includes/xmlModule.php 2007-03-25 21:29:23 UTC (rev 217)
+++ trunk/src/includes/xmlModule.php 2007-04-06 21:10:28 UTC (rev 218)
@@ -414,7 +414,9 @@
return $this->mName;
}
function &setCol($value) {
- return $this->mCols[$value->getName()] = $value;
+ $rv = $value;
+ $this->mCols[$value->getName()] =& $rv;
+ return $rv;
}
function getCol($name) {
@@ -434,7 +436,9 @@
}
function &setKey($value) {
- return $this->mKeys[$value->getName()] = $value;
+ $rv = $value;
+ $this->mKeys[$value->getName()] =& $rv;
+ return $rv;
}
function getKey($name) {
@@ -456,12 +460,14 @@
function &addRow($values) {
if (is_array($values)) {
- return $this->mRows[] = new xmlRow($values);
+ $rv = new xmlRow($values);
} else if (is_object($values)) {
- return $this->mRows[] = $values;
+ $rv = $values;
} else {
- return $this->mRows[] = new xmlRow();
+ $rv = new xmlRow();
}
+ $this->mRows[] =& $rv;
+ return $rv;
}
function clearRows($values) {
@@ -807,7 +813,9 @@
/*public*/ function &addElement($Name, $Attrs) {
global $xmlClassNames;
$ClassName = $xmlClassNames['Element'];
- return $this->Contents[] =& new xmlElement($Name, $Attrs, &$this);
+ $rv =& new xmlElement($Name, $Attrs, &$this);
+ $this->Contents[] =& $rv;
+ return $rv;
}
/*public*/ function &getParent() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|