Index: trunk/extensions/SemanticMediaWiki/maintenance/SMW_conceptCache.php |
— | — | @@ -15,11 +15,11 @@ |
16 | 16 | $optionsWithArgs = array( 'concept', 'old', 's', 'e' ); |
17 | 17 | |
18 | 18 | require_once ( getenv( 'MW_INSTALL_PATH' ) !== false |
19 | | - ? getenv( 'MW_INSTALL_PATH' ) . "/maintenance/commandLine.inc" |
| 19 | + ? getenv( 'MW_INSTALL_PATH' ) . '/maintenance/commandLine.inc' |
20 | 20 | : dirname( __FILE__ ) . '/../../../maintenance/commandLine.inc' ); |
21 | 21 | |
22 | 22 | $output_level = array_key_exists( 'quiet', $options ) ? 0: |
23 | | - ( array_key_exists( 'verbose', $options ) ? 2:1 ); |
| 23 | + ( array_key_exists( 'verbose', $options ) ? 2 : 1 ); |
24 | 24 | |
25 | 25 | if ( array_key_exists( 'help', $options ) ) { |
26 | 26 | $action = 'help'; |
— | — | @@ -40,7 +40,7 @@ |
41 | 41 | // wfCountDown as soon as we switch to MediaWiki 1.16. |
42 | 42 | // Currently, wfCountDown is only supported from |
43 | 43 | // revision 51650 (Jun 9 2009) onward. |
44 | | - if ( function_exists( "wfCountDown" ) ) { |
| 44 | + if ( function_exists( 'wfCountDown' ) ) { |
45 | 45 | wfCountDown( $delay ); |
46 | 46 | } else { |
47 | 47 | for ( $i = $delay; $i >= 0; $i-- ) { |
— | — | @@ -124,7 +124,7 @@ |
125 | 125 | |
126 | 126 | $select_hard = array_key_exists( 'hard', $options ); |
127 | 127 | $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; |
129 | 129 | |
130 | 130 | if ( isset( $options['concept'] ) ) { // single concept mode |
131 | 131 | // $concept = SMWDataValueFactory::newTypeIDValue('_wpg'); |
— | — | @@ -177,34 +177,36 @@ |
178 | 178 | } |
179 | 179 | if ( $skip ) { |
180 | 180 | $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; |
182 | 182 | } |
183 | 183 | if ( $numlines !== false ) { |
184 | 184 | outputMessage( "($numlines) " ); |
185 | 185 | } |
186 | 186 | switch ( $action ) { |
187 | 187 | case 'delete': |
188 | | - outputMessage( "Deleting cache for \"" . $title->getPrefixedText() . "\" ...\n" ); |
| 188 | + outputMessage( 'Deleting cache for "' . $title->getPrefixedText() . "\" ...\n" ); |
189 | 189 | $errors = $store->deleteConceptCache( $title ); |
190 | 190 | break; |
191 | 191 | case 'create': |
192 | | - outputMessage( "Creating cache for \"" . $title->getPrefixedText() . "\" ...\n" ); |
| 192 | + outputMessage( 'Creating cache for "' . $title->getPrefixedText() . "\" ...\n" ); |
193 | 193 | $errors = $store->refreshConceptCache( $title ); |
194 | 194 | break; |
195 | 195 | default: |
196 | | - outputMessage( "Status of cache for \"" . $title->getPrefixedText() . "\": " ); |
| 196 | + outputMessage( 'Status of cache for "' . $title->getPrefixedText() . '": ' ); |
197 | 197 | if ( $status['status'] == 'no' ) { |
198 | 198 | outputMessage( "Concept not known or redirect.\n" ); |
199 | 199 | } 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" ); |
201 | 201 | } else { |
202 | 202 | outputMessage( "Not cached.\n" ); |
203 | 203 | } |
204 | 204 | break; |
205 | 205 | } |
| 206 | + |
206 | 207 | if ( count( $errors ) > 0 ) { |
207 | | - outputMessage( " " . implode( $errors, "\n " ) . "\n" ); |
| 208 | + outputMessage( ' ' . implode( $errors, "\n " ) . "\n" ); |
208 | 209 | } |
| 210 | + |
209 | 211 | return 1; |
210 | 212 | } |
211 | 213 | |