http://www.mediawiki.org/wiki/Special:Code/MediaWiki/96557
Revision: 96557
Author: reedy
Date: 2011-09-08 12:38:49 +0000 (Thu, 08 Sep 2011)
Log Message:
-----------
MFT r80167, r81689, r87498, r89253
Modified Paths:
--------------
branches/REL1_17/phase3/includes/db/DatabaseOracle.php
branches/REL1_17/phase3/includes/filerepo/ForeignDBRepo.php
branches/REL1_17/phase3/includes/resourceloader/ResourceLoader.php
branches/REL1_17/phase3/includes/resourceloader/ResourceLoaderStartUpModule.php
branches/REL1_17/phase3/includes/resourceloader/ResourceLoaderUserOptionsModule.php
Property Changed:
----------------
branches/REL1_17/phase3/includes/filerepo/ForeignDBRepo.php
branches/REL1_17/phase3/includes/resourceloader/ResourceLoader.php
Modified: branches/REL1_17/phase3/includes/db/DatabaseOracle.php
===================================================================
--- branches/REL1_17/phase3/includes/db/DatabaseOracle.php 2011-09-08
12:28:26 UTC (rev 96556)
+++ branches/REL1_17/phase3/includes/db/DatabaseOracle.php 2011-09-08
12:38:49 UTC (rev 96557)
@@ -791,6 +791,7 @@
$this->delete( $table, $deleteConds, $fname );
}
+
if ( $sequenceData !== false && !isset(
$row[$sequenceData['column']] ) ) {
$row[$sequenceData['column']] =
$this->nextSequenceValue( $sequenceData['sequence'] );
}
@@ -1157,28 +1158,41 @@
return $s;
}
- function selectRow( $table, $vars, $conds, $fname =
'DatabaseOracle::selectRow', $options = array(), $join_conds = array() ) {
+ private function wrapFieldForWhere( $table, &$col, &$val ) {
global $wgContLang;
+
+ $col_info = $this->fieldInfoMulti( $table, $col );
+ $col_type = $col_info != false ? $col_info->type() : 'CONSTANT';
+ if ( $col_type == 'CLOB' ) {
+ $col = 'TO_CHAR(' . $col . ')';
+ $val = $wgContLang->checkTitleEncoding( $val );
+ } elseif ( $col_type == 'VARCHAR2' && !mb_check_encoding( $val
) ) {
+ $val = $wgContLang->checkTitleEncoding( $val );
+ }
+ }
- if ($conds != null) {
- $conds2 = array();
- $conds = ( !is_array( $conds ) ) ? array( $conds ) :
$conds;
- foreach ( $conds as $col => $val ) {
- $col_info = $this->fieldInfoMulti( $table, $col
);
- $col_type = $col_info != false ?
$col_info->type() : 'CONSTANT';
- if ( $col_type == 'CLOB' ) {
- $conds2['TO_CHAR(' . $col . ')'] =
$wgContLang->checkTitleEncoding( $val );
- } elseif ( $col_type == 'VARCHAR2' &&
!mb_check_encoding( $val ) ) {
- $conds2[$col] =
$wgContLang->checkTitleEncoding( $val );
+ private function wrapConditionsForWhere ( $table, $conds, $parentCol =
null ) {
+ $conds2 = array();
+ foreach ( $conds as $col => $val ) {
+ if ( is_array( $val ) ) {
+ $conds2[$col] = $this->wrapConditionsForWhere (
$table, $val, $col );
+ } else {
+ if ( is_numeric( $col ) && $parentCol != null )
{
+ $this->wrapFieldForWhere ( $table,
$parentCol, $val );
} else {
- $conds2[$col] = $val;
+ $this->wrapFieldForWhere ( $table,
$col, $val );
}
+ $conds2[$col] = $val;
}
+ }
+ return $conds2;
+ }
- return parent::selectRow( $table, $vars, $conds2,
$fname, $options, $join_conds );
- } else {
- return parent::selectRow( $table, $vars, $conds,
$fname, $options, $join_conds );
+ function selectRow( $table, $vars, $conds, $fname =
'DatabaseOracle::selectRow', $options = array(), $join_conds = array() ) {
+ if ( is_array($conds) ) {
+ $conds = $this->wrapConditionsForWhere( $table, $conds
);
}
+ return parent::selectRow( $table, $vars, $conds, $fname,
$options, $join_conds );
}
/**
@@ -1225,32 +1239,10 @@
}
public function delete( $table, $conds, $fname =
'DatabaseOracle::delete' ) {
- global $wgContLang;
-
- if ( $wgContLang != null && $conds != null && $conds != '*' ) {
- $conds2 = array();
- $conds = ( !is_array( $conds ) ) ? array( $conds ) :
$conds;
- foreach ( $conds as $col => $val ) {
- $col_info = $this->fieldInfoMulti( $table, $col
);
- $col_type = $col_info != false ?
$col_info->type() : 'CONSTANT';
- if ( $col_type == 'CLOB' ) {
- $conds2['TO_CHAR(' . $col . ')'] =
$wgContLang->checkTitleEncoding( $val );
- } else {
- if ( is_array( $val ) ) {
- $conds2[$col] = $val;
- foreach ( $conds2[$col] as
&$val2 ) {
- $val2 =
$wgContLang->checkTitleEncoding( $val2 );
- }
- } else {
- $conds2[$col] =
$wgContLang->checkTitleEncoding( $val );
- }
- }
- }
-
- return parent::delete( $table, $conds2, $fname );
- } else {
- return parent::delete( $table, $conds, $fname );
+ if ( is_array($conds) ) {
+ $conds = $this->wrapConditionsForWhere( $table, $conds
);
}
+ return parent::delete( $table, $conds, $fname );
}
function update( $table, $values, $conds, $fname =
'DatabaseOracle::update', $options = array() ) {
@@ -1273,6 +1265,7 @@
}
if ( $conds != '*' ) {
+ $conds = $this->wrapConditionsForWhere( $table, $conds
);
$sql .= ' WHERE ' . $this->makeList( $conds, LIST_AND );
}
Modified: branches/REL1_17/phase3/includes/filerepo/ForeignDBRepo.php
===================================================================
--- branches/REL1_17/phase3/includes/filerepo/ForeignDBRepo.php 2011-09-08
12:28:26 UTC (rev 96556)
+++ branches/REL1_17/phase3/includes/filerepo/ForeignDBRepo.php 2011-09-08
12:38:49 UTC (rev 96557)
@@ -37,7 +37,7 @@
if ( !isset( $this->dbConn ) ) {
$this->dbConn = DatabaseBase::newFromType(
$this->dbType,
array(
- 'server' => $this->dbServer,
+ 'host' => $this->dbServer,
'user' => $this->dbUser,
'password' => $this->dbPassword,
'dbname' => $this->dbName,
Property changes on: branches/REL1_17/phase3/includes/filerepo/ForeignDBRepo.php
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/REL1_15/phase3/includes/filerepo/ForeignDBRepo.php:51646
/branches/new-installer/phase3/includes/filerepo/ForeignDBRepo.php:43664-66004
/branches/sqlite/includes/filerepo/ForeignDBRepo.php:58211-58321
/branches/wmf-deployment/includes/filerepo/ForeignDBRepo.php:53381
/trunk/phase3/includes/filerepo/ForeignDBRepo.php:79591,79655,79706,79828,79830,79848,79853,79950-79951,79954,79989,80006-80007,80013,80016,80080,80083,80124,80128,80238,80864
+ /branches/REL1_15/phase3/includes/filerepo/ForeignDBRepo.php:51646
/branches/new-installer/phase3/includes/filerepo/ForeignDBRepo.php:43664-66004
/branches/sqlite/includes/filerepo/ForeignDBRepo.php:58211-58321
/branches/wmf-deployment/includes/filerepo/ForeignDBRepo.php:53381
/trunk/phase3/includes/filerepo/ForeignDBRepo.php:79591,79655,79706,79828,79830,79848,79853,79950-79951,79954,79989,80006-80007,80013,80016,80080,80083,80124,80128,80167,80238,80864,81689,87498,89253
Modified: branches/REL1_17/phase3/includes/resourceloader/ResourceLoader.php
===================================================================
--- branches/REL1_17/phase3/includes/resourceloader/ResourceLoader.php
2011-09-08 12:28:26 UTC (rev 96556)
+++ branches/REL1_17/phase3/includes/resourceloader/ResourceLoader.php
2011-09-08 12:38:49 UTC (rev 96557)
@@ -96,7 +96,8 @@
), __METHOD__
);
foreach ( $res as $row ) {
- $this->getModule( $row->mr_resource
)->setMsgBlobMtime( $lang, $row->mr_timestamp );
+ $this->getModule( $row->mr_resource
)->setMsgBlobMtime( $lang,
+ wfTimestamp( TS_UNIX,
$row->mr_timestamp ) );
unset(
$modulesWithoutMessages[$row->mr_resource] );
}
}
Property changes on:
branches/REL1_17/phase3/includes/resourceloader/ResourceLoader.php
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/REL1_15/phase3/includes/ResourceLoader.php:51646
/branches/new-installer/phase3/includes/ResourceLoader.php:43664-66004
/branches/resourceloader/phase3/includes/ResourceLoader.php:68366-69676,69678-71999,72001-72255,72257-72305,72307-72342
/branches/sqlite/includes/ResourceLoader.php:58211-58321
/branches/wmf-deployment/includes/ResourceLoader.php:53381
/trunk/phase3/includes/resourceloader/ResourceLoader.php:78011,78014-78016,78078,78099,78117,78161,78170,78172,78199,78248,78285,78393,78506-78507,78510-78511,78536,78539,78544,78565,78574,78660,78679,78774,78808,78886-78887,78924,78926,78943,79013,79018-79019,79034,79072,79115,79122,79246,79358,79480,79693,79732,79839,79862,79891,79900,80109,80113,80223,80475,80554,80575-80576,80583,80620,80656,80666,80842,80900,80913,80918-80920,80973-80974,80979,80993,81729,81765,81778,81812,81854,81890-81894,81896-81898,81900,81955,82247,83885,83891,83897,83902-83903,83979,83988-83989,83997-83998,84118,84228,84271,84343,84353,84392,84430-84431,84464,84543,84553,84573-84574,84577,84579,84729,84765,84820,84846,84905,84985,85032,85140,85143,85152,85178,85194,85199,87203,87265,87494,87497,87840,88076,89615
+ /branches/REL1_15/phase3/includes/ResourceLoader.php:51646
/branches/new-installer/phase3/includes/ResourceLoader.php:43664-66004
/branches/resourceloader/phase3/includes/ResourceLoader.php:68366-69676,69678-71999,72001-72255,72257-72305,72307-72342
/branches/sqlite/includes/ResourceLoader.php:58211-58321
/branches/wmf-deployment/includes/ResourceLoader.php:53381
/trunk/phase3/includes/resourceloader/ResourceLoader.php:78011,78014-78016,78078,78099,78117,78161,78170,78172,78199,78248,78285,78393,78506-78507,78510-78511,78536,78539,78544,78565,78574,78660,78679,78774,78808,78886-78887,78924,78926,78943,79013,79018-79019,79034,79072,79115,79122,79246,79358,79480,79693,79732,79839,79862,79891,79900,80109,80113,80167,80223,80475,80554,80575-80576,80583,80620,80656,80666,80842,80900,80913,80918-80920,80973-80974,80979,80993,81689,81729,81765,81778,81812,81854,81890-81894,81896-81898,81900,81955,82247,83885,83891,83897,83902-83903,83979,83988-83989,83997-83998,84118,84228,84271,84343,84353,84392,84430-84431,84464,84543,84553,84573-84574,84577,84579,84729,84765,84820,84846,84905,84985,85032,85140,85143,85152,85178,85194,85199,87203,87265,87494,87497-87498,87840,88076,89253,89615
Modified:
branches/REL1_17/phase3/includes/resourceloader/ResourceLoaderStartUpModule.php
===================================================================
---
branches/REL1_17/phase3/includes/resourceloader/ResourceLoaderStartUpModule.php
2011-09-08 12:28:26 UTC (rev 96556)
+++
branches/REL1_17/phase3/includes/resourceloader/ResourceLoaderStartUpModule.php
2011-09-08 12:38:49 UTC (rev 96557)
@@ -119,7 +119,10 @@
}
// Automatically register module
else {
- $mtime = max( $module->getModifiedTime(
$context ), wfTimestamp( TS_UNIX, $wgCacheEpoch ) );
+ // getModifiedTime() is supposed to return a
UNIX timestamp, but it doesn't always
+ // seem to do that, and custom implementations
might forget. Coerce it to TS_UNIX
+ $moduleMtime = wfTimestamp( TS_UNIX,
$module->getModifiedTime( $context ) );
+ $mtime = max( $moduleMtime, wfTimestamp(
TS_UNIX, $wgCacheEpoch ) );
// Modules without dependencies or a group pass
two arguments (name, timestamp) to
// mediaWiki.loader.register()
if ( !count( $module->getDependencies() &&
$module->getGroup() === null ) ) {
Modified:
branches/REL1_17/phase3/includes/resourceloader/ResourceLoaderUserOptionsModule.php
===================================================================
---
branches/REL1_17/phase3/includes/resourceloader/ResourceLoaderUserOptionsModule.php
2011-09-08 12:28:26 UTC (rev 96556)
+++
branches/REL1_17/phase3/includes/resourceloader/ResourceLoaderUserOptionsModule.php
2011-09-08 12:38:49 UTC (rev 96557)
@@ -40,7 +40,7 @@
global $wgUser;
if ( $context->getUser() === $wgUser->getName() ) {
- return $this->modifiedTime[$hash] =
$wgUser->getTouched();
+ return $this->modifiedTime[$hash] = wfTimestamp(
TS_UNIX, $wgUser->getTouched() );
} else {
return 1;
}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs