r73294 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r73293‎ | r73294 | r73295 >
Date:15:30, 18 September 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Style fix
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/maintenance/SMW_conceptCache.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/maintenance/SMW_conceptCache.php
@@ -15,11 +15,11 @@
1616 $optionsWithArgs = array( 'concept', 'old', 's', 'e' );
1717
1818 require_once ( getenv( 'MW_INSTALL_PATH' ) !== false
19 - ? getenv( 'MW_INSTALL_PATH' ) . "/maintenance/commandLine.inc"
 19+ ? getenv( 'MW_INSTALL_PATH' ) . '/maintenance/commandLine.inc'
2020 : dirname( __FILE__ ) . '/../../../maintenance/commandLine.inc' );
2121
2222 $output_level = array_key_exists( 'quiet', $options ) ? 0:
23 - ( array_key_exists( 'verbose', $options ) ? 2:1 );
 23+ ( array_key_exists( 'verbose', $options ) ? 2 : 1 );
2424
2525 if ( array_key_exists( 'help', $options ) ) {
2626 $action = 'help';
@@ -40,7 +40,7 @@
4141 // wfCountDown as soon as we switch to MediaWiki 1.16.
4242 // Currently, wfCountDown is only supported from
4343 // revision 51650 (Jun 9 2009) onward.
44 - if ( function_exists( "wfCountDown" ) ) {
 44+ if ( function_exists( 'wfCountDown' ) ) {
4545 wfCountDown( $delay );
4646 } else {
4747 for ( $i = $delay; $i >= 0; $i-- ) {
@@ -124,7 +124,7 @@
125125
126126 $select_hard = array_key_exists( 'hard', $options );
127127 $select_update = array_key_exists( 'update', $options );
128 -$select_old = isset( $options['old'] ) ? intval( $options['old'] ):false;
 128+$select_old = isset( $options['old'] ) ? intval( $options['old'] ) : false;
129129
130130 if ( isset( $options['concept'] ) ) { // single concept mode
131131 // $concept = SMWDataValueFactory::newTypeIDValue('_wpg');
@@ -177,34 +177,36 @@
178178 }
179179 if ( $skip ) {
180180 $pref = ( $numlines !== false ) ? "($numlines) ":'';
181 - return ( outputMessage( $pref . "Skipping concept \"" . $title->getPrefixedText() . "\": $skip\n", 2 ) ) ? 1:0;
 181+ return ( outputMessage( $pref . 'Skipping concept "' . $title->getPrefixedText() . "\": $skip\n", 2 ) ) ? 1 : 0;
182182 }
183183 if ( $numlines !== false ) {
184184 outputMessage( "($numlines) " );
185185 }
186186 switch ( $action ) {
187187 case 'delete':
188 - outputMessage( "Deleting cache for \"" . $title->getPrefixedText() . "\" ...\n" );
 188+ outputMessage( 'Deleting cache for "' . $title->getPrefixedText() . "\" ...\n" );
189189 $errors = $store->deleteConceptCache( $title );
190190 break;
191191 case 'create':
192 - outputMessage( "Creating cache for \"" . $title->getPrefixedText() . "\" ...\n" );
 192+ outputMessage( 'Creating cache for "' . $title->getPrefixedText() . "\" ...\n" );
193193 $errors = $store->refreshConceptCache( $title );
194194 break;
195195 default:
196 - outputMessage( "Status of cache for \"" . $title->getPrefixedText() . "\": " );
 196+ outputMessage( 'Status of cache for "' . $title->getPrefixedText() . '": ' );
197197 if ( $status['status'] == 'no' ) {
198198 outputMessage( "Concept not known or redirect.\n" );
199199 } elseif ( $status['status'] == 'full' ) {
200 - outputMessage( "Cache created at " . date( "Y-m-d H:i:s", $status['date'] ) . " (" . floor( ( strtotime( "now" ) - $status['date'] ) / 60 ) . " minutes old), " . $status['count'] . " elements in cache\n" );
 200+ outputMessage( 'Cache created at ' . date( "Y-m-d H:i:s", $status['date'] ) . ' (' . floor( ( strtotime( "now" ) - $status['date'] ) / 60 ) . " minutes old), " . $status['count'] . " elements in cache\n" );
201201 } else {
202202 outputMessage( "Not cached.\n" );
203203 }
204204 break;
205205 }
 206+
206207 if ( count( $errors ) > 0 ) {
207 - outputMessage( " " . implode( $errors, "\n " ) . "\n" );
 208+ outputMessage( ' ' . implode( $errors, "\n " ) . "\n" );
208209 }
 210+
209211 return 1;
210212 }
211213

Status & tagging log