r108768 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108767‎ | r108768 | r108769 >
Date:22:10, 12 January 2012
Author:reedy
Status:resolved (Comments)
Tags:core 
Comment:
Add $inputCsllback to sourceStream(), to return full lines back to the calling function

Will be used soooon
Modified paths:
  • /trunk/phase3/includes/db/Database.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/db/Database.php
@@ -3151,13 +3151,13 @@
31523152 * @param $lineCallback Callback: Optional function called before reading each line
31533153 * @param $resultCallback Callback: Optional function called for each MySQL result
31543154 * @param $fname String: Calling function name
 3155+ * @param $inputCallback Callback: Optional function called for each complete line (ended with ;) sent
31553156 * @return bool|string
31563157 */
31573158 function sourceStream( $fp, $lineCallback = false, $resultCallback = false,
3158 - $fname = 'DatabaseBase::sourceStream' )
 3159+ $fname = 'DatabaseBase::sourceStream', $inputCallback = false )
31593160 {
31603161 $cmd = '';
3161 - $done = false;
31623162
31633163 while ( !feof( $fp ) ) {
31643164 if ( $lineCallback ) {
@@ -3184,6 +3184,9 @@
31853185
31863186 if ( $done || feof( $fp ) ) {
31873187 $cmd = $this->replaceVars( $cmd );
 3188+ if ( $inputCallback ) {
 3189+ call_user_func( $resultCallback, $cmd );
 3190+ }
31883191 $res = $this->query( $cmd, $fname );
31893192
31903193 if ( $resultCallback ) {
@@ -3196,7 +3199,6 @@
31973200 }
31983201
31993202 $cmd = '';
3200 - $done = false;
32013203 }
32023204 }
32033205

Follow-up revisions

RevisionCommit summaryAuthorDate
r108773Followup r108768, callign the right callback helps tooreedy22:35, 12 January 2012
r110575Strict Standards: Declaration of DatabaseOracle::sourceStream() should be com...reedy15:12, 2 February 2012

Comments

#Comment by Nikerabbit (talk | contribs)   11:50, 2 February 2012

Strict Standards: Declaration of DatabaseOracle::sourceStream() should be compatible with that of DatabaseBase::sourceStream()

#Comment by Nikerabbit (talk | contribs)   11:50, 2 February 2012

Strict Standards: Declaration of DatabaseOracle::sourceStream() should be compatible with that of DatabaseBase::sourceStream()

#Comment by Nikerabbit (talk | contribs)   11:50, 2 February 2012

Strict Standards: Declaration of DatabaseOracle::sourceStream() should be compatible with that of DatabaseBase::sourceStream()

#Comment by Nikerabbit (talk | contribs)   11:51, 2 February 2012

Strict Standards: Declaration of DatabaseOracle::sourceStream() should be compatible with that of DatabaseBase::sourceStream()

#Comment by Hashar (talk | contribs)   12:26, 2 February 2012

spamming people

#Comment by Hashar (talk | contribs)   12:28, 2 February 2012

spamming people

#Comment by Hashar (talk | contribs)   14:22, 2 February 2012

spamming people after r110571 deployement.

Status & tagging log