dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed slave check when the job type is not specified.
[lhc/web/wiklou.git]
/
maintenance
/
fixExtLinksProtocolRelative.php
diff --git
a/maintenance/fixExtLinksProtocolRelative.php
b/maintenance/fixExtLinksProtocolRelative.php
index
e10b194
..
2403ec6
100644
(file)
--- a/
maintenance/fixExtLinksProtocolRelative.php
+++ b/
maintenance/fixExtLinksProtocolRelative.php
@@
-19,11
+19,18
@@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html
*
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html
*
+ * @file
* @ingroup Maintenance
*/
* @ingroup Maintenance
*/
-require_once(
dirname( __FILE__ )
. '/Maintenance.php' );
+require_once(
__DIR__
. '/Maintenance.php' );
+/**
+ * Maintenance script that fixes any entriy for protocol-relative URLs
+ * in the externallinks table.
+ *
+ * @ingroup Maintenance
+ */
class FixExtLinksProtocolRelative extends LoggedUpdateMaintenance {
public function __construct() {
parent::__construct();
class FixExtLinksProtocolRelative extends LoggedUpdateMaintenance {
public function __construct() {
parent::__construct();
@@
-37,7
+44,7
@@
class FixExtLinksProtocolRelative extends LoggedUpdateMaintenance {
protected function updateSkippedMessage() {
return 'protocol-relative URLs in externallinks table already fixed.';
}
protected function updateSkippedMessage() {
return 'protocol-relative URLs in externallinks table already fixed.';
}
-
+
protected function doDBUpdates() {
$db = wfGetDB( DB_MASTER );
if ( !$db->tableExists( 'externallinks' ) ) {
protected function doDBUpdates() {
$db = wfGetDB( DB_MASTER );
if ( !$db->tableExists( 'externallinks' ) ) {
@@
-53,7
+60,7
@@
class FixExtLinksProtocolRelative extends LoggedUpdateMaintenance {
foreach ( $res as $row ) {
$count++;
if ( $count % 100 == 0 ) {
foreach ( $res as $row ) {
$count++;
if ( $count % 100 == 0 ) {
- $this->output( $count );
+ $this->output( $count
. "\n"
);
wfWaitForSlaves();
}
$db->insert( 'externallinks',
wfWaitForSlaves();
}
$db->insert( 'externallinks',
@@
-70,7
+77,7
@@
class FixExtLinksProtocolRelative extends LoggedUpdateMaintenance {
)
), __METHOD__, array( 'IGNORE' )
);
)
), __METHOD__, array( 'IGNORE' )
);
- $db->delete( 'externallinks', array( 'el_index' => $row->el_index ), __METHOD__ );
+ $db->delete( 'externallinks', array( 'el_index' => $row->el_index
, 'el_from' => $row->el_from, 'el_to' => $row->el_to
), __METHOD__ );
}
$this->output( "Done, $count rows updated.\n" );
return true;
}
$this->output( "Done, $count rows updated.\n" );
return true;