Index: trunk/extensions/SwiftMedia/SwiftMedia.php |
— | — | @@ -12,7 +12,7 @@ |
13 | 13 | $wgAutoloadClasses['SwiftForeignDBFile'] = |
14 | 14 | $wgAutoloadClasses['SwiftForeignDBRepo'] = |
15 | 15 | $wgAutoloadClasses['SwiftForeignDBviaLBRepo'] = |
16 | | - $wgAutoloadClasses['SwiftRepo'] = dirname(__FILE__) . '/SwiftMedia.body.php'; |
| 16 | + $wgAutoloadClasses['SwiftRepo'] = dirname( __FILE__ ) . '/SwiftMedia.body.php'; |
17 | 17 | $wgAutoloadClasses['CF_Authentication'] = |
18 | 18 | $wgAutoloadClasses['CF_Connection'] = |
19 | 19 | $wgAutoloadClasses['CF_Container'] = |
Index: trunk/extensions/SwiftMedia/SwiftMedia.body.php |
— | — | @@ -29,28 +29,28 @@ |
30 | 30 | */ |
31 | 31 | var |
32 | 32 | $conn; # our connection to the Swift proxy. |
33 | | - #$fileExists, # does the file file exist on disk? (loadFromXxx) |
34 | | - #$historyLine, # Number of line to return by nextHistoryLine() (constructor) |
35 | | - #$historyRes, # result of the query for the file's history (nextHistoryLine) |
36 | | - #$width, # \ |
37 | | - #$height, # | |
38 | | - #$bits, # --- returned by getimagesize (loadFromXxx) |
39 | | - #$attr, # / |
40 | | - #$media_type, # MEDIATYPE_xxx (bitmap, drawing, audio...) |
41 | | - #$mime, # MIME type, determined by MimeMagic::guessMimeType |
42 | | - #$major_mime, # Major mime type |
43 | | - #$minor_mime, # Minor mime type |
44 | | - #$size, # Size in bytes (loadFromXxx) |
45 | | - #$metadata, # Handler-specific metadata |
46 | | - #$timestamp, # Upload timestamp |
47 | | - #$sha1, # SHA-1 base 36 content hash |
48 | | - #$user, $user_text, # User, who uploaded the file |
49 | | - #$description, # Description of current revision of the file |
50 | | - #$dataLoaded, # Whether or not all this has been loaded from the database (loadFromXxx) |
51 | | - #$upgraded, # Whether the row was upgraded on load |
52 | | - #$locked, # True if the image row is locked |
53 | | - #$missing, # True if file is not present in file system. Not to be cached in memcached |
54 | | - #$deleted; # Bitfield akin to rev_deleted |
| 33 | + # $fileExists, # does the file file exist on disk? (loadFromXxx) |
| 34 | + # $historyLine, # Number of line to return by nextHistoryLine() (constructor) |
| 35 | + # $historyRes, # result of the query for the file's history (nextHistoryLine) |
| 36 | + # $width, # \ |
| 37 | + # $height, # | |
| 38 | + # $bits, # --- returned by getimagesize (loadFromXxx) |
| 39 | + # $attr, # / |
| 40 | + # $media_type, # MEDIATYPE_xxx (bitmap, drawing, audio...) |
| 41 | + # $mime, # MIME type, determined by MimeMagic::guessMimeType |
| 42 | + # $major_mime, # Major mime type |
| 43 | + # $minor_mime, # Minor mime type |
| 44 | + # $size, # Size in bytes (loadFromXxx) |
| 45 | + # $metadata, # Handler-specific metadata |
| 46 | + # $timestamp, # Upload timestamp |
| 47 | + # $sha1, # SHA-1 base 36 content hash |
| 48 | + # $user, $user_text, # User, who uploaded the file |
| 49 | + # $description, # Description of current revision of the file |
| 50 | + # $dataLoaded, # Whether or not all this has been loaded from the database (loadFromXxx) |
| 51 | + # $upgraded, # Whether the row was upgraded on load |
| 52 | + # $locked, # True if the image row is locked |
| 53 | + # $missing, # True if file is not present in file system. Not to be cached in memcached |
| 54 | + # $deleted; # Bitfield akin to rev_deleted |
55 | 55 | /**#@-*/ |
56 | 56 | |
57 | 57 | /** |
— | — | @@ -67,7 +67,7 @@ |
68 | 68 | * @return SwiftFile |
69 | 69 | */ |
70 | 70 | static function newFromTitle( $title, $repo, $unused = null ) { |
71 | | - if ( empty($title) ) { |
| 71 | + if ( empty( $title ) ) { |
72 | 72 | return null; |
73 | 73 | } |
74 | 74 | return new self( $title, $repo ); |
— | — | @@ -107,13 +107,13 @@ |
108 | 108 | /** isVisible inherited */ |
109 | 109 | |
110 | 110 | public function getPath() { |
111 | | - $this->tempPath = $this->repo->getLocalCopy($this->repo->container, $this->getRel()); |
| 111 | + $this->tempPath = $this->repo->getLocalCopy( $this->repo->container, $this->getRel() ); |
112 | 112 | return $this->tempPath; |
113 | 113 | } |
114 | 114 | |
115 | 115 | /** Get the path of the archive directory, or a particular file if $suffix is specified */ |
116 | 116 | public function getArchivePath( $suffix = false ) { |
117 | | - $this->tempPath = $this->repo->getLocalCopy($this->repo->getZoneContainer('public'), $this->getArchiveRel( $suffix )); |
| 117 | + $this->tempPath = $this->repo->getLocalCopy( $this->repo->getZoneContainer( 'public' ), $this->getArchiveRel( $suffix ) ); |
118 | 118 | return $this->tempPath; |
119 | 119 | } |
120 | 120 | |
— | — | @@ -123,12 +123,12 @@ |
124 | 124 | if ( $suffix !== false ) { |
125 | 125 | $path .= '/' . $suffix; |
126 | 126 | } |
127 | | - $this->tempPath = $this->repo->getLocalCopy($this->repo->getZoneContainer('thumb'), $path); |
| 127 | + $this->tempPath = $this->repo->getLocalCopy( $this->repo->getZoneContainer( 'thumb' ), $path ); |
128 | 128 | return $this->tempPath; |
129 | 129 | } |
130 | 130 | |
131 | 131 | function __destruct() { |
132 | | - if ($this->tempPath) { |
| 132 | + if ( $this->tempPath ) { |
133 | 133 | // Clean up temporary data. |
134 | 134 | unlink( $this->tempPath ); |
135 | 135 | $this->tempPath = null; |
— | — | @@ -151,25 +151,25 @@ |
152 | 152 | global $wgIgnoreImageErrors, $wgThumbnailEpoch, $wgTmpDirectory; |
153 | 153 | |
154 | 154 | // get a temporary place to put the original. |
155 | | - $thumbPath = tempnam( $wgTmpDirectory, 'transform_out_') . '.' . pathinfo( $thumbName, PATHINFO_EXTENSION ); |
| 155 | + $thumbPath = tempnam( $wgTmpDirectory, 'transform_out_' ) . '.' . pathinfo( $thumbName, PATHINFO_EXTENSION ); |
156 | 156 | |
157 | | - if ( $this->repo && $this->repo->canTransformVia404() && !($flags & self::RENDER_NOW ) ) { |
| 157 | + if ( $this->repo && $this->repo->canTransformVia404() && !( $flags & self::RENDER_NOW ) ) { |
158 | 158 | return $this->handler->getTransform( $this, $thumbPath, $thumbUrl, $params ); |
159 | 159 | } |
160 | 160 | |
161 | 161 | // see if the file exists, and if it exists, is not too old. |
162 | 162 | $conn = $this->repo->connect(); |
163 | | - $container = $this->repo->get_container($conn,$this->repo->container . '%2Fthumb'); |
| 163 | + $container = $this->repo->get_container( $conn, $this->repo->container . '%2Fthumb' ); |
164 | 164 | try { |
165 | | - $pic = $container->get_object($this->getRel() . "/$thumbName"); |
166 | | - } catch (NoSuchObjectException $e) { |
| 165 | + $pic = $container->get_object( $this->getRel() . "/$thumbName" ); |
| 166 | + } catch ( NoSuchObjectException $e ) { |
167 | 167 | $pic = NULL; |
168 | 168 | } |
169 | 169 | if ( $pic ) { |
170 | 170 | $thumbTime = $pic->last_modified; |
171 | | - $tm = strptime($thumbTime, '%a, %d %b %Y %H:%M:%S GMT'); |
172 | | - $thumbGMT = gmmktime($tm['tm_hour'], $tm['tm_min'], $tm['tm_sec'], $tm['tm_mon']+1, $tm['tm_mday'], $tm['tm_year'] + 1900); |
173 | | - wfDebug( __METHOD__.": $thumbName is dated $thumbGMT\n" ); |
| 171 | + $tm = strptime( $thumbTime, '%a, %d %b %Y %H:%M:%S GMT' ); |
| 172 | + $thumbGMT = gmmktime( $tm['tm_hour'], $tm['tm_min'], $tm['tm_sec'], $tm['tm_mon'] + 1, $tm['tm_mday'], $tm['tm_year'] + 1900 ); |
| 173 | + wfDebug( __METHOD__ . ": $thumbName is dated $thumbGMT\n" ); |
174 | 174 | if ( gmdate( 'YmdHis', $thumbGMT ) >= $wgThumbnailEpoch ) { |
175 | 175 | |
176 | 176 | return $this->handler->getTransform( $this, $thumbPath, $thumbUrl, $params ); |
— | — | @@ -182,7 +182,7 @@ |
183 | 183 | $thumb = null; |
184 | 184 | } elseif ( $thumb->isError() ) { |
185 | 185 | $this->lastError = $thumb->toText(); |
186 | | - if ( $wgIgnoreImageErrors && !($flags & self::RENDER_NOW) ) { |
| 186 | + if ( $wgIgnoreImageErrors && !( $flags & self::RENDER_NOW ) ) { |
187 | 187 | $thumb = $this->handler->getTransform( $this, $thumbPath, $thumbUrl, $params ); |
188 | 188 | } |
189 | 189 | } |
— | — | @@ -217,7 +217,7 @@ |
218 | 218 | * Get the public root directory of the repository. |
219 | 219 | */ |
220 | 220 | protected function getRootDirectory() { |
221 | | - throw new MWException( __METHOD__.': not implemented' ); |
| 221 | + throw new MWException( __METHOD__ . ': not implemented' ); |
222 | 222 | } |
223 | 223 | |
224 | 224 | /** getHandler inherited */ |
— | — | @@ -229,18 +229,18 @@ |
230 | 230 | * @param $archiveName string: the article name for the archived file (if archived). |
231 | 231 | * @return a list of files, the first entry of which is the directory name (if applicable). |
232 | 232 | */ |
233 | | - function getThumbnails($archiveName = false) { |
| 233 | + function getThumbnails( $archiveName = false ) { |
234 | 234 | $this->load(); |
235 | 235 | |
236 | | - if ($archiveName) { |
237 | | - $prefix = $this->getArchiveRel($archiveName); |
| 236 | + if ( $archiveName ) { |
| 237 | + $prefix = $this->getArchiveRel( $archiveName ); |
238 | 238 | } else { |
239 | 239 | $prefix = $this->getRel(); |
240 | 240 | } |
241 | 241 | $conn = $this->repo->connect(); |
242 | | - $container = $this->repo->get_container($conn,$this->repo->container . '%2Fthumb'); |
243 | | - $files = $container->list_objects(0, NULL, $prefix); |
244 | | - array_unshift($files, 'unused'); # return an unused $dir. |
| 242 | + $container = $this->repo->get_container( $conn, $this->repo->container . '%2Fthumb' ); |
| 243 | + $files = $container->list_objects( 0, NULL, $prefix ); |
| 244 | + array_unshift( $files, 'unused' ); # return an unused $dir. |
245 | 245 | return $files; |
246 | 246 | } |
247 | 247 | |
— | — | @@ -249,11 +249,11 @@ |
250 | 250 | * @param $dir string If needed for this repo, the directory prefix. |
251 | 251 | * @param $files array of strings listing the thumbs to be deleted. |
252 | 252 | */ |
253 | | - function purgeThumbList($dir, $files) { |
| 253 | + function purgeThumbList( $dir, $files ) { |
254 | 254 | global $wgExcludeFromThumbnailPurge; |
255 | 255 | |
256 | 256 | $conn = $this->repo->connect(); |
257 | | - $container = $this->repo->get_container($conn,$this->repo->container . '%2Fthumb'); |
| 257 | + $container = $this->repo->get_container( $conn, $this->repo->container . '%2Fthumb' ); |
258 | 258 | foreach ( $files as $file ) { |
259 | 259 | // Only remove files not in the $wgExcludeFromThumbnailPurge configuration variable |
260 | 260 | $ext = pathinfo( $file, PATHINFO_EXTENSION ); |
— | — | @@ -261,8 +261,8 @@ |
262 | 262 | continue; |
263 | 263 | } |
264 | 264 | |
265 | | - wfDebug( __METHOD__ . ' deleting ' . $container->name . "/$file\n"); |
266 | | - $this->repo->swift_delete($container, $file); |
| 265 | + wfDebug( __METHOD__ . ' deleting ' . $container->name . "/$file\n" ); |
| 266 | + $this->repo->swift_delete( $container, $file ); |
267 | 267 | } |
268 | 268 | } |
269 | 269 | |
— | — | @@ -311,10 +311,10 @@ |
312 | 312 | $this->deletedDir = false; |
313 | 313 | |
314 | 314 | // Required settings |
315 | | - $this->swiftuser= $info['user']; |
316 | | - $this->swiftkey= $info['key']; |
317 | | - $this->authurl= $info['authurl']; |
318 | | - $this->container= $info['container']; |
| 315 | + $this->swiftuser = $info['user']; |
| 316 | + $this->swiftkey = $info['key']; |
| 317 | + $this->authurl = $info['authurl']; |
| 318 | + $this->container = $info['container']; |
319 | 319 | } |
320 | 320 | |
321 | 321 | /** |
— | — | @@ -323,15 +323,15 @@ |
324 | 324 | * @return CF_Connection |
325 | 325 | */ |
326 | 326 | function connect() { |
327 | | - $auth = new CF_Authentication($this->swiftuser, $this->swiftkey, NULL, $this->authurl); |
| 327 | + $auth = new CF_Authentication( $this->swiftuser, $this->swiftkey, NULL, $this->authurl ); |
328 | 328 | try { |
329 | 329 | $auth->authenticate(); |
330 | | - } catch (AuthenticationException $e) { |
| 330 | + } catch ( AuthenticationException $e ) { |
331 | 331 | throw new MWException( "We can't authenticate ourselves." ); |
332 | | - #} catch (InvalidResponseException $e) { |
| 332 | + # } catch (InvalidResponseException $e) { |
333 | 333 | # throw new MWException( __METHOD__ . "unexpected response '$e'" ); |
334 | 334 | } |
335 | | - return new CF_Connection($auth); |
| 335 | + return new CF_Connection( $auth ); |
336 | 336 | } |
337 | 337 | |
338 | 338 | /** |
— | — | @@ -342,12 +342,12 @@ |
343 | 343 | * |
344 | 344 | * @return CF_Container |
345 | 345 | */ |
346 | | - function get_container($conn, $cont) { |
| 346 | + function get_container( $conn, $cont ) { |
347 | 347 | try { |
348 | | - return $conn->get_container($cont); |
349 | | - } catch (NoSuchContainerException $e) { |
| 348 | + return $conn->get_container( $cont ); |
| 349 | + } catch ( NoSuchContainerException $e ) { |
350 | 350 | throw new MWException( "A container we thought existed, doesn't." ); |
351 | | - #} catch (InvalidResponseException $e) { |
| 351 | + # } catch (InvalidResponseException $e) { |
352 | 352 | # throw new MWException( __METHOD__ . "unexpected response '$e'" ); |
353 | 353 | } |
354 | 354 | } |
— | — | @@ -359,17 +359,17 @@ |
360 | 360 | * |
361 | 361 | * @return CF_Container |
362 | 362 | */ |
363 | | - function write_swift_object( $srcPath, $dstc, $dstRel) { |
| 363 | + function write_swift_object( $srcPath, $dstc, $dstRel ) { |
364 | 364 | try { |
365 | | - $obj = $dstc->create_object($dstRel); |
366 | | - $obj->load_from_filename( $srcPath, True); |
367 | | - } catch (SyntaxException $e) { |
| 365 | + $obj = $dstc->create_object( $dstRel ); |
| 366 | + $obj->load_from_filename( $srcPath, True ); |
| 367 | + } catch ( SyntaxException $e ) { |
368 | 368 | throw new MWException( 'missing required parameters' ); |
369 | | - } catch (BadContentTypeException $e) { |
| 369 | + } catch ( BadContentTypeException $e ) { |
370 | 370 | throw new MWException( 'No Content-Type was/could be set' ); |
371 | | - #} catch (InvalidResponseException $e) { |
| 371 | + # } catch (InvalidResponseException $e) { |
372 | 372 | # throw new MWException( __METHOD__ . "unexpected response '$e'" ); |
373 | | - } catch (IOException $e) { |
| 373 | + } catch ( IOException $e ) { |
374 | 374 | throw new MWException( "error opening file '$e'" ); |
375 | 375 | } |
376 | 376 | } |
— | — | @@ -381,12 +381,12 @@ |
382 | 382 | */ |
383 | 383 | function swift_delete( $container, $rel ) { |
384 | 384 | try { |
385 | | - $container->delete_object($rel); |
386 | | - } catch (SyntaxException $e) { |
| 385 | + $container->delete_object( $rel ); |
| 386 | + } catch ( SyntaxException $e ) { |
387 | 387 | throw new MWException( "Swift object name not well-formed: '$e'" ); |
388 | | - } catch (NoSuchObjectException $e) { |
| 388 | + } catch ( NoSuchObjectException $e ) { |
389 | 389 | throw new MWException( "Swift object we are trying to delete does not exist: '$e'" ); |
390 | | - #} catch (InvalidResponseException $e) { |
| 390 | + # } catch (InvalidResponseException $e) { |
391 | 391 | # throw new MWException( "unexpected response '$e'" ); |
392 | 392 | } |
393 | 393 | } |
— | — | @@ -416,7 +416,7 @@ |
417 | 417 | } |
418 | 418 | |
419 | 419 | // Check overwriting |
420 | | - if (0) { #FIXME |
| 420 | + if ( 0 ) { # FIXME |
421 | 421 | if ( !( $flags & self::OVERWRITE ) && file_exists( $dstPath ) ) { // FIXME: $dstPath is undefined |
422 | 422 | if ( $flags & self::OVERWRITE_SAME ) { |
423 | 423 | $hashSource = sha1_file( $srcPath ); |
— | — | @@ -444,28 +444,28 @@ |
445 | 445 | |
446 | 446 | // Point to the container. |
447 | 447 | $dstContainer = $this->getZoneContainer( $dstZone ); |
448 | | - $dstc = $this->get_container($conn, $dstContainer); |
| 448 | + $dstc = $this->get_container( $conn, $dstContainer ); |
449 | 449 | |
450 | 450 | $good = true; |
451 | 451 | |
452 | 452 | // Where are we copying this from? |
453 | | - if (self::isVirtualUrl( $srcPath )) { |
| 453 | + if ( self::isVirtualUrl( $srcPath ) ) { |
454 | 454 | $src = $this->getContainerRel( $srcPath ); |
455 | | - list ($srcContainer, $srcRel) = $src; |
456 | | - $srcc = $this->get_container($conn, $srcContainer); |
| 455 | + list ( $srcContainer, $srcRel ) = $src; |
| 456 | + $srcc = $this->get_container( $conn, $srcContainer ); |
457 | 457 | |
458 | | - $this->swiftcopy($srcc, $srcRel, $dstc, $dstRel); |
| 458 | + $this->swiftcopy( $srcc, $srcRel, $dstc, $dstRel ); |
459 | 459 | if ( $flags & self::DELETE_SOURCE ) { |
460 | 460 | $this->swift_delete( $srcc, $srcRel ); |
461 | 461 | } |
462 | 462 | } else { |
463 | | - $this->write_swift_object( $srcPath, $dstc, $dstRel); |
| 463 | + $this->write_swift_object( $srcPath, $dstc, $dstRel ); |
464 | 464 | // php-cloudfiles throws exceptions, so failure never gets here. |
465 | 465 | if ( $flags & self::DELETE_SOURCE ) { |
466 | 466 | unlink ( $srcPath ); |
467 | 467 | } |
468 | 468 | } |
469 | | - if (0) { |
| 469 | + if ( 0 ) { |
470 | 470 | $status->error( 'filecopyerror', $srcPath, $dstPath ); |
471 | 471 | $good = false; |
472 | 472 | } |
— | — | @@ -489,19 +489,19 @@ |
490 | 490 | * @return mixed Status or false |
491 | 491 | */ |
492 | 492 | |
493 | | - function append( $srcPath, $toAppendPath, $flags = 0 ){ |
494 | | - throw new MWException( __METHOD__.': Not yet implemented.' ); |
| 493 | + function append( $srcPath, $toAppendPath, $flags = 0 ) { |
| 494 | + throw new MWException( __METHOD__ . ': Not yet implemented.' ); |
495 | 495 | // I think we need to count the number of files whose names |
496 | 496 | // start with $toAppendPath, then add that count (with leading zeroes) to |
497 | 497 | // the end of $toAppendPath and write the chunk there. |
498 | 498 | |
499 | 499 | // Count the number of files whose names start with $toAppendPath |
500 | 500 | $conn = $this->connect(); |
501 | | - $container = $this->repo->get_container($conn,$this->repo->container . "%2Ftemp"); |
502 | | - $nextone = count($container->list_objects(0, NULL, $srcPath)); |
| 501 | + $container = $this->repo->get_container( $conn, $this->repo->container . "%2Ftemp" ); |
| 502 | + $nextone = count( $container->list_objects( 0, NULL, $srcPath ) ); |
503 | 503 | |
504 | 504 | // Do the append to the next name |
505 | | - $status = $this->store( $srcPath, 'temp', sprintf("%s.%05d", $toAppendPath, $nextone) ); |
| 505 | + $status = $this->store( $srcPath, 'temp', sprintf( "%s.%05d", $toAppendPath, $nextone ) ); |
506 | 506 | |
507 | 507 | if ( $flags & self::DELETE_SOURCE ) { |
508 | 508 | unlink( $srcPath ); |
— | — | @@ -513,7 +513,7 @@ |
514 | 514 | * Finish the append operation. |
515 | 515 | * @param $toAppendPath String: path to append to. |
516 | 516 | */ |
517 | | - function appendFinish( $toAppendPath ){ |
| 517 | + function appendFinish( $toAppendPath ) { |
518 | 518 | $conn = $this->connect(); |
519 | 519 | $container = $this->repo->get_container( $conn, $this->repo->container . '%2Ftemp' ); |
520 | 520 | $parts = $container->list_objects( 0, NULL, $srcPath ); // FIXME: $srcPath is undefined |
— | — | @@ -521,7 +521,7 @@ |
522 | 522 | |
523 | 523 | // The first object as the same name as the destination, so |
524 | 524 | // we read it into memory and then write it out as the first chunk. |
525 | | - $obj = $container->get_object( array_shift($parts) ); |
| 525 | + $obj = $container->get_object( array_shift( $parts ) ); |
526 | 526 | $first = $obj->read(); |
527 | 527 | |
528 | 528 | $biggie = $container->create_object( $toAppendPath ); |
— | — | @@ -546,7 +546,7 @@ |
547 | 547 | * @return FileRepoStatus |
548 | 548 | */ |
549 | 549 | function deleteBatch( $sourceDestPairs ) { |
550 | | - wfDebug( __METHOD__ . ' deleting ' . var_export($sourceDestPairs, true) . '\n'); |
| 550 | + wfDebug( __METHOD__ . ' deleting ' . var_export( $sourceDestPairs, true ) . '\n' ); |
551 | 551 | |
552 | 552 | /** |
553 | 553 | * Move the files |
— | — | @@ -576,24 +576,24 @@ |
577 | 577 | * @return Either array of files and existence flags, or false |
578 | 578 | */ |
579 | 579 | function fileExistsBatch( $files, $flags = 0 ) { |
580 | | - if ($flags != self::FILES_ONLY) { |
| 580 | + if ( $flags != self::FILES_ONLY ) { |
581 | 581 | // we ONLY support when $flags & self::FILES_ONLY is set! |
582 | | - throw new MWException( "Swift Media Store doesn't have directories"); |
| 582 | + throw new MWException( "Swift Media Store doesn't have directories" ); |
583 | 583 | } |
584 | 584 | $result = array(); |
585 | 585 | $conn = $this->connect(); |
586 | 586 | |
587 | 587 | foreach ( $files as $key => $file ) { |
588 | 588 | if ( !self::isVirtualUrl( $file ) ) { |
589 | | - throw new MWException( __METHOD__ . " requires a virtual URL, not '$file'"); |
| 589 | + throw new MWException( __METHOD__ . " requires a virtual URL, not '$file'" ); |
590 | 590 | } |
591 | 591 | $rvu = $this->getContainerRel( $file ); |
592 | | - list ($cont, $rel) = $rvu; |
593 | | - $container = $this->get_container($conn,$cont); |
| 592 | + list ( $cont, $rel ) = $rvu; |
| 593 | + $container = $this->get_container( $conn, $cont ); |
594 | 594 | try { |
595 | | - $obj = $container->get_object($rel); |
| 595 | + $obj = $container->get_object( $rel ); |
596 | 596 | $result[$key] = true; |
597 | | - } catch (NoSuchObjectException $e) { |
| 597 | + } catch ( NoSuchObjectException $e ) { |
598 | 598 | $result[$key] = false; |
599 | 599 | } |
600 | 600 | } |
— | — | @@ -604,7 +604,7 @@ |
605 | 605 | |
606 | 606 | // FIXME: do we really need to reject empty titles? |
607 | 607 | function newFile( $title, $time = false ) { |
608 | | - if ( empty($title) ) { |
| 608 | + if ( empty( $title ) ) { |
609 | 609 | return null; |
610 | 610 | } |
611 | 611 | return parent::newFile( $title, $time ); |
— | — | @@ -617,38 +617,38 @@ |
618 | 618 | * @param $dstContainer CF_Container |
619 | 619 | * @param $dstRel String: relative path to the destination. |
620 | 620 | */ |
621 | | - protected function swiftcopy($srcContainer, $srcRel, $dstContainer, $dstRel ) { |
| 621 | + protected function swiftcopy( $srcContainer, $srcRel, $dstContainer, $dstRel ) { |
622 | 622 | // The destination must exist already. |
623 | | - $obj = $dstContainer->create_object($dstRel); |
| 623 | + $obj = $dstContainer->create_object( $dstRel ); |
624 | 624 | $obj->content_type = 'text/plain'; |
625 | 625 | |
626 | 626 | try { |
627 | | - $obj->write('.'); |
628 | | - } catch (SyntaxException $e ) { |
| 627 | + $obj->write( '.' ); |
| 628 | + } catch ( SyntaxException $e ) { |
629 | 629 | throw new MWException( "Write failed: $e" ); |
630 | | - } catch (BadContentTypeException $e ) { |
| 630 | + } catch ( BadContentTypeException $e ) { |
631 | 631 | throw new MWException( "Missing Content-Type: $e" ); |
632 | | - } catch (MisMatchedChecksumException $e ) { |
| 632 | + } catch ( MisMatchedChecksumException $e ) { |
633 | 633 | throw new MWException( __METHOD__ . "should not happen: '$e'" ); |
634 | | - #} catch (InvalidResponseException $e ) { |
| 634 | + # } catch (InvalidResponseException $e ) { |
635 | 635 | # throw new MWException( __METHOD__ . "unexpected response '$e'" ); |
636 | 636 | } |
637 | 637 | |
638 | 638 | try { |
639 | | - $obj = $dstContainer->get_object($dstRel); |
640 | | - } catch (NoSuchObjectException $e) { |
| 639 | + $obj = $dstContainer->get_object( $dstRel ); |
| 640 | + } catch ( NoSuchObjectException $e ) { |
641 | 641 | throw new MWException( 'The object we just created does not exist: ' . $dstContainer->name . "/$dstRel: $e" ); |
642 | 642 | } |
643 | 643 | |
644 | | - wfDebug( __METHOD__ . ' copying to ' . $dstContainer->name . "/$dstRel from " . $srcContainer->name . "/$srcRel\n"); |
| 644 | + wfDebug( __METHOD__ . ' copying to ' . $dstContainer->name . "/$dstRel from " . $srcContainer->name . "/$srcRel\n" ); |
645 | 645 | |
646 | 646 | try { |
647 | | - $obj->copy($srcContainer->name . "/$srcRel"); |
648 | | - } catch (SyntaxException $e ) { |
| 647 | + $obj->copy( $srcContainer->name . "/$srcRel" ); |
| 648 | + } catch ( SyntaxException $e ) { |
649 | 649 | throw new MWException( 'Source file does not exist: ' . $srcContainer->name . "/$srcRel: $e" ); |
650 | | - } catch (MisMatchedChecksumException $e ) { |
| 650 | + } catch ( MisMatchedChecksumException $e ) { |
651 | 651 | throw new MWException( "Checksums do not match: $e" ); |
652 | | - #} catch (InvalidResponseException $e ) { |
| 652 | + # } catch (InvalidResponseException $e ) { |
653 | 653 | # throw new MWException( __METHOD__ . "unexpected response '$e'" ); |
654 | 654 | } |
655 | 655 | } |
— | — | @@ -663,7 +663,7 @@ |
664 | 664 | |
665 | 665 | # paranoia |
666 | 666 | $status = $this->newGood( array() ); |
667 | | - foreach ( $triplets as $i => $triplet ) { |
| 667 | + foreach ( $triplets as $triplet ) { |
668 | 668 | list( $srcPath, $dstRel, $archiveRel ) = $triplet; |
669 | 669 | |
670 | 670 | if ( !$this->validateFilename( $dstRel ) ) { |
— | — | @@ -680,9 +680,9 @@ |
681 | 681 | |
682 | 682 | try { |
683 | 683 | $conn = $this->connect(); |
684 | | - $container = $this->get_container($conn,$this->container); |
685 | | - } catch (InvalidResponseException $e) { |
686 | | - $status->fatal("Unexpected Swift response: '$e'"); |
| 684 | + $container = $this->get_container( $conn, $this->container ); |
| 685 | + } catch ( InvalidResponseException $e ) { |
| 686 | + $status->fatal( "Unexpected Swift response: '$e'" ); |
687 | 687 | } |
688 | 688 | |
689 | 689 | if ( !$status->ok ) { |
— | — | @@ -694,18 +694,18 @@ |
695 | 695 | |
696 | 696 | // Archive destination file if it exists |
697 | 697 | try { |
698 | | - $pic = $container->get_object($dstRel); |
699 | | - } catch (InvalidResponseException $e) { |
700 | | - $status->error("Unexpected Swift response: '$e'"); |
| 698 | + $pic = $container->get_object( $dstRel ); |
| 699 | + } catch ( InvalidResponseException $e ) { |
| 700 | + $status->error( "Unexpected Swift response: '$e'" ); |
701 | 701 | $status->failCount++; |
702 | 702 | continue; |
703 | | - } catch (NoSuchObjectException $e) { |
| 703 | + } catch ( NoSuchObjectException $e ) { |
704 | 704 | $pic = NULL; |
705 | 705 | } |
706 | 706 | |
707 | | - if( $pic ) { |
708 | | - $this->swiftcopy($container, $dstRel, $container, $archiveRel ); |
709 | | - wfDebug(__METHOD__.": moved file $dstRel to $archiveRel\n"); |
| 707 | + if ( $pic ) { |
| 708 | + $this->swiftcopy( $container, $dstRel, $container, $archiveRel ); |
| 709 | + wfDebug( __METHOD__ . ": moved file $dstRel to $archiveRel\n" ); |
710 | 710 | $status->value[$i] = 'archived'; |
711 | 711 | } else { |
712 | 712 | $status->value[$i] = 'new'; |
— | — | @@ -714,30 +714,30 @@ |
715 | 715 | $good = true; |
716 | 716 | try { |
717 | 717 | // Where are we copying this from? |
718 | | - if (self::isVirtualUrl( $srcPath )) { |
| 718 | + if ( self::isVirtualUrl( $srcPath ) ) { |
719 | 719 | $src = $this->getContainerRel( $srcPath ); |
720 | | - list ($srcContainer, $srcRel) = $src; |
721 | | - $srcc = $this->get_container($conn, $srcContainer); |
| 720 | + list ( $srcContainer, $srcRel ) = $src; |
| 721 | + $srcc = $this->get_container( $conn, $srcContainer ); |
722 | 722 | |
723 | | - $this->swiftcopy($srcc, $srcRel, $container, $dstRel); |
| 723 | + $this->swiftcopy( $srcc, $srcRel, $container, $dstRel ); |
724 | 724 | if ( $flags & self::DELETE_SOURCE ) { |
725 | 725 | $this->swift_delete( $srcc, $srcRel ); |
726 | 726 | } |
727 | 727 | } else { |
728 | | - $this->write_swift_object( $srcPath, $container, $dstRel); |
| 728 | + $this->write_swift_object( $srcPath, $container, $dstRel ); |
729 | 729 | // php-cloudfiles throws exceptions, so failure never gets here. |
730 | 730 | if ( $flags & self::DELETE_SOURCE ) { |
731 | 731 | unlink ( $srcPath ); |
732 | 732 | } |
733 | 733 | } |
734 | | - } catch (InvalidResponseException $e) { |
735 | | - $status->error("Unexpected Swift response: '$e'"); |
| 734 | + } catch ( InvalidResponseException $e ) { |
| 735 | + $status->error( "Unexpected Swift response: '$e'" ); |
736 | 736 | $good = false; |
737 | 737 | } |
738 | 738 | |
739 | 739 | if ( $good ) { |
740 | 740 | $status->successCount++; |
741 | | - wfDebug(__METHOD__.": wrote tempfile $srcPath to $dstRel\n"); |
| 741 | + wfDebug( __METHOD__ . ": wrote tempfile $srcPath to $dstRel\n" ); |
742 | 742 | } else { |
743 | 743 | $status->failCount++; |
744 | 744 | } |
— | — | @@ -762,15 +762,15 @@ |
763 | 763 | if ( self::isVirtualUrl( $file ) ) { |
764 | 764 | // This is a virtual url, resolve it |
765 | 765 | $path = $this->getContainerRel( $file ); |
766 | | - list( $cont, $rel) = $path; |
| 766 | + list( $cont, $rel ) = $path; |
767 | 767 | } else { |
768 | 768 | // FIXME: This is a full file name |
769 | | - throw new MWException( __METHOD__.": $file needs an unlink()" ); |
| 769 | + throw new MWException( __METHOD__ . ": $file needs an unlink()" ); |
770 | 770 | } |
771 | 771 | } |
772 | 772 | |
773 | | - wfDebug( __METHOD__.": $cont/$rel\n" ); |
774 | | - $container = $this->get_container($conn,$cont); |
| 773 | + wfDebug( __METHOD__ . ": $cont/$rel\n" ); |
| 774 | + $container = $this->get_container( $conn, $cont ); |
775 | 775 | $this->swift_delete( $container, $rel ); |
776 | 776 | } |
777 | 777 | } |
— | — | @@ -785,7 +785,7 @@ |
786 | 786 | function cleanupDeletedBatch( $storageKeys ) { |
787 | 787 | $conn = $this->connect(); |
788 | 788 | $cont = $this->getZoneContainer( 'deleted' ); |
789 | | - $container = $this->get_container($conn,$cont); |
| 789 | + $container = $this->get_container( $conn, $cont ); |
790 | 790 | |
791 | 791 | $dbw = $this->getMasterDB(); |
792 | 792 | $status = $this->newGood(); |
— | — | @@ -797,14 +797,14 @@ |
798 | 798 | $inuse = $dbw->selectField( 'filearchive', '1', |
799 | 799 | array( 'fa_storage_group' => 'deleted', 'fa_storage_key' => $key ), |
800 | 800 | __METHOD__, array( 'FOR UPDATE' ) ); |
801 | | - if( !$inuse ) { |
| 801 | + if ( !$inuse ) { |
802 | 802 | $sha1 = self::getHashFromKey( $key ); |
803 | 803 | $ext = substr( $key, strcspn( $key, '.' ) + 1 ); |
804 | | - $ext = File::normalizeExtension($ext); |
| 804 | + $ext = File::normalizeExtension( $ext ); |
805 | 805 | $inuse = $dbw->selectField( 'oldimage', '1', |
806 | 806 | array( 'oi_sha1' => $sha1, |
807 | 807 | 'oi_archive_name ' . $dbw->buildLike( $dbw->anyString(), ".$ext" ), |
808 | | - $dbw->bitAnd('oi_deleted', File::DELETED_FILE) => File::DELETED_FILE ), |
| 808 | + $dbw->bitAnd( 'oi_deleted', File::DELETED_FILE ) => File::DELETED_FILE ), |
809 | 809 | __METHOD__, array( 'FOR UPDATE' ) ); |
810 | 810 | } |
811 | 811 | if ( !$inuse ) { |
— | — | @@ -823,13 +823,13 @@ |
824 | 824 | * Makes no sense in our context -- don't let anybody call it. |
825 | 825 | */ |
826 | 826 | function getZonePath( $zone ) { |
827 | | - throw new MWException( __METHOD__.': not implemented' ); |
| 827 | + throw new MWException( __METHOD__ . ': not implemented' ); |
828 | 828 | } |
829 | 829 | |
830 | 830 | /** |
831 | 831 | * Get the Swift container corresponding to one of the three basic zones |
832 | 832 | */ |
833 | | - protected function getZoneContainer( $zone ) { |
| 833 | + public function getZoneContainer( $zone ) { |
834 | 834 | switch ( $zone ) { |
835 | 835 | case 'public': |
836 | 836 | return $this->container; |
— | — | @@ -849,22 +849,22 @@ |
850 | 850 | */ |
851 | 851 | protected function getContainerRel( $url ) { |
852 | 852 | if ( substr( $url, 0, 9 ) != 'mwrepo://' ) { |
853 | | - throw new MWException( __METHOD__.': unknown protocol' ); |
| 853 | + throw new MWException( __METHOD__ . ': unknown protocol' ); |
854 | 854 | } |
855 | 855 | |
856 | 856 | $bits = explode( '/', substr( $url, 9 ), 3 ); |
857 | 857 | if ( count( $bits ) != 3 ) { |
858 | | - throw new MWException( __METHOD__.": invalid mwrepo URL: $url" ); |
| 858 | + throw new MWException( __METHOD__ . ": invalid mwrepo URL: $url" ); |
859 | 859 | } |
860 | 860 | list( $repo, $zone, $rel ) = $bits; |
861 | 861 | if ( $repo !== $this->name ) { |
862 | | - throw new MWException( __METHOD__.': fetching from a foreign repo is not supported' ); |
| 862 | + throw new MWException( __METHOD__ . ': fetching from a foreign repo is not supported' ); |
863 | 863 | } |
864 | 864 | $container = $this->getZoneContainer( $zone ); |
865 | | - if ( $container === false) { |
866 | | - throw new MWException( __METHOD__.": invalid zone: $zone" ); |
| 865 | + if ( $container === false ) { |
| 866 | + throw new MWException( __METHOD__ . ": invalid zone: $zone" ); |
867 | 867 | } |
868 | | - return array($container, rawurldecode( $rel )); |
| 868 | + return array( $container, rawurldecode( $rel ) ); |
869 | 869 | } |
870 | 870 | |
871 | 871 | /** |
— | — | @@ -875,14 +875,14 @@ |
876 | 876 | function freeTemp( $virtualUrl ) { |
877 | 877 | $temp = "mwrepo://{$this->name}/temp"; |
878 | 878 | if ( substr( $virtualUrl, 0, strlen( $temp ) ) != $temp ) { |
879 | | - wfDebug( __METHOD__.": Invalid virtual URL\n" ); |
| 879 | + wfDebug( __METHOD__ . ": Invalid virtual URL\n" ); |
880 | 880 | return false; |
881 | 881 | } |
882 | 882 | $path = $this->getContainerRel( $virtualUrl ); |
883 | | - list ($c, $r) = $path; |
| 883 | + list ( $c, $r ) = $path; |
884 | 884 | $conn = $this->connect(); |
885 | | - $container = $this->get_container($conn,$c); |
886 | | - $this->swift_delete($container, $r); |
| 885 | + $container = $this->get_container( $conn, $c ); |
| 886 | + $this->swift_delete( $container, $r ); |
887 | 887 | } |
888 | 888 | |
889 | 889 | /** |
— | — | @@ -891,8 +891,8 @@ |
892 | 892 | */ |
893 | 893 | function resolveVirtualUrl( $url ) { |
894 | 894 | $path = $this->getContainerRel( $url ); |
895 | | - list($c, $r) = $path; |
896 | | - return $this->getLocalCopy($c, $r); |
| 895 | + list( $c, $r ) = $path; |
| 896 | + return $this->getLocalCopy( $c, $r ); |
897 | 897 | } |
898 | 898 | |
899 | 899 | |
— | — | @@ -903,27 +903,27 @@ |
904 | 904 | * scope. |
905 | 905 | * FIXME: how do we return a fatal error from Swift? |
906 | 906 | */ |
907 | | - function getLocalCopy($container, $rel) { |
| 907 | + function getLocalCopy( $container, $rel ) { |
908 | 908 | |
909 | 909 | // get a temporary place to put the original. |
910 | 910 | $tempPath = tempnam( wfTempDir(), 'swift_in_' ) . '.' . pathinfo( $rel, PATHINFO_EXTENSION ); |
911 | 911 | |
912 | 912 | /* Fetch the image out of Swift */ |
913 | 913 | $conn = $this->connect(); |
914 | | - $cont = $this->get_container($conn,$container); |
| 914 | + $cont = $this->get_container( $conn, $container ); |
915 | 915 | |
916 | 916 | try { |
917 | | - $obj = $cont->get_object($rel); |
918 | | - } catch (NoSuchObjectException $e) { |
919 | | - throw new MWException( "Unable to open original file at $container/$rel"); |
| 917 | + $obj = $cont->get_object( $rel ); |
| 918 | + } catch ( NoSuchObjectException $e ) { |
| 919 | + throw new MWException( "Unable to open original file at $container/$rel" ); |
920 | 920 | } |
921 | 921 | |
922 | | - wfDebug( __METHOD__ . " writing to $tempPath\n"); |
| 922 | + wfDebug( __METHOD__ . " writing to $tempPath\n" ); |
923 | 923 | try { |
924 | | - $obj->save_to_filename( $tempPath); |
925 | | - } catch (IOException $e) { |
| 924 | + $obj->save_to_filename( $tempPath ); |
| 925 | + } catch ( IOException $e ) { |
926 | 926 | throw new MWException( __METHOD__ . ": error opening '$e'" ); |
927 | | - } catch (InvalidResponseException $e) { |
| 927 | + } catch ( InvalidResponseException $e ) { |
928 | 928 | throw new MWException( __METHOD__ . "unexpected response '$e'" ); |
929 | 929 | } |
930 | 930 | |
— | — | @@ -965,7 +965,7 @@ |
966 | 966 | } |
967 | 967 | |
968 | 968 | class SwiftStashFile extends UploadStashFile { |
969 | | - //public function __construct( $stash, $repo, $path, $key, $data ) { |
| 969 | + // public function __construct( $stash, $repo, $path, $key, $data ) { |
970 | 970 | // // We don't call parent:: because UploadStashFile expects to be able to call $this->resolveURL() and get a pathname. |
971 | 971 | // $this->sessionStash = $stash; |
972 | 972 | // $this->sessionKey = $key; |
— | — | @@ -975,10 +975,10 @@ |
976 | 976 | // UnregisteredLocalFile::__construct( false, $repo, $path, false ); |
977 | 977 | // $this->name = basename( $this->path ); |
978 | 978 | |
979 | | - //} |
| 979 | + // } |
980 | 980 | |
981 | | - //function getPath() { |
982 | | - //} |
| 981 | + // function getPath() { |
| 982 | + // } |
983 | 983 | } |
984 | 984 | |
985 | 985 | /** |
— | — | @@ -1001,8 +1001,8 @@ |
1002 | 1002 | |
1003 | 1003 | static function newFromTitle( $title, $repo, $time = null ) { |
1004 | 1004 | # The null default value is only here to avoid an E_STRICT |
1005 | | - if( $time === null ) |
1006 | | - throw new MWException( __METHOD__.' got null for $time parameter' ); |
| 1005 | + if ( $time === null ) |
| 1006 | + throw new MWException( __METHOD__ . ' got null for $time parameter' ); |
1007 | 1007 | return new self( $title, $repo, $time, null ); |
1008 | 1008 | } |
1009 | 1009 | |
— | — | @@ -1026,12 +1026,12 @@ |
1027 | 1027 | */ |
1028 | 1028 | static function newFromKey( $sha1, $repo, $timestamp = false ) { |
1029 | 1029 | $conds = array( 'oi_sha1' => $sha1 ); |
1030 | | - if( $timestamp ) { |
| 1030 | + if ( $timestamp ) { |
1031 | 1031 | $conds['oi_timestamp'] = $timestamp; |
1032 | 1032 | } |
1033 | 1033 | $dbr = $repo->getSlaveDB(); |
1034 | 1034 | $row = $dbr->selectRow( 'oldimage', self::selectFields(), $conds, __METHOD__ ); |
1035 | | - if( $row ) { |
| 1035 | + if ( $row ) { |
1036 | 1036 | return self::newFromRow( $row, $repo ); |
1037 | 1037 | } else { |
1038 | 1038 | return false; |
— | — | @@ -1073,7 +1073,7 @@ |
1074 | 1074 | $this->requestedTime = $time; |
1075 | 1075 | $this->archive_name = $archiveName; |
1076 | 1076 | if ( is_null( $time ) && is_null( $archiveName ) ) { |
1077 | | - throw new MWException( __METHOD__.': must specify at least one of $time or $archiveName' ); |
| 1077 | + throw new MWException( __METHOD__ . ': must specify at least one of $time or $archiveName' ); |
1078 | 1078 | } |
1079 | 1079 | } |
1080 | 1080 | |
— | — | @@ -1093,7 +1093,7 @@ |
1094 | 1094 | } |
1095 | 1095 | |
1096 | 1096 | function isVisible() { |
1097 | | - return $this->exists() && !$this->isDeleted(File::DELETED_FILE); |
| 1097 | + return $this->exists() && !$this->isDeleted( File::DELETED_FILE ); |
1098 | 1098 | } |
1099 | 1099 | |
1100 | 1100 | function loadFromDB() { |
— | — | @@ -1137,7 +1137,7 @@ |
1138 | 1138 | |
1139 | 1139 | # Don't destroy file info of missing files |
1140 | 1140 | if ( !$this->fileExists ) { |
1141 | | - wfDebug( __METHOD__.': file does not exist, aborting\n' ); |
| 1141 | + wfDebug( __METHOD__ . ': file does not exist, aborting\n' ); |
1142 | 1142 | wfProfileOut( __METHOD__ ); |
1143 | 1143 | return; |
1144 | 1144 | } |
— | — | @@ -1145,7 +1145,7 @@ |
1146 | 1146 | $dbw = $this->repo->getMasterDB(); |
1147 | 1147 | list( $major, $minor ) = self::splitMime( $this->mime ); |
1148 | 1148 | |
1149 | | - wfDebug(__METHOD__.': upgrading '.$this->archive_name.' to the current schema\n'); |
| 1149 | + wfDebug( __METHOD__ . ': upgrading ' . $this->archive_name . ' to the current schema\n' ); |
1150 | 1150 | $dbw->update( 'oldimage', |
1151 | 1151 | array( |
1152 | 1152 | 'oi_width' => $this->width, |
— | — | @@ -1171,7 +1171,7 @@ |
1172 | 1172 | */ |
1173 | 1173 | function isDeleted( $field ) { |
1174 | 1174 | $this->load(); |
1175 | | - return ($this->deleted & $field) == $field; |
| 1175 | + return ( $this->deleted & $field ) == $field; |
1176 | 1176 | } |
1177 | 1177 | |
1178 | 1178 | /** |
— | — | @@ -1244,7 +1244,7 @@ |
1245 | 1245 | function move( $target ) { |
1246 | 1246 | $this->readOnlyError(); |
1247 | 1247 | } |
1248 | | - |
| 1248 | + |
1249 | 1249 | function getDescriptionUrl() { |
1250 | 1250 | // Restore remote behaviour |
1251 | 1251 | return File::getDescriptionUrl(); |
— | — | @@ -1287,7 +1287,7 @@ |
1288 | 1288 | * @return DatabaseBase |
1289 | 1289 | */ |
1290 | 1290 | function getMasterDB() { |
1291 | | - wfDebug( __METHOD__.": {$this->dbServer}\n" ); |
| 1291 | + wfDebug( __METHOD__ . ": {$this->dbServer}\n" ); |
1292 | 1292 | if ( !isset( $this->dbConn ) ) { |
1293 | 1293 | $this->dbConn = DatabaseBase::factory( $this->dbType, |
1294 | 1294 | array( |
— | — | @@ -1316,7 +1316,7 @@ |
1317 | 1317 | |
1318 | 1318 | /** |
1319 | 1319 | * Get a key on the primary cache for this repository. |
1320 | | - * Returns false if the repository's cache is not accessible at this site. |
| 1320 | + * Returns false if the repository's cache is not accessible at this site. |
1321 | 1321 | * The parameters are the parts of the key, as for wfMemcKey(). |
1322 | 1322 | */ |
1323 | 1323 | function getSharedCacheKey( /*...*/ ) { |
— | — | @@ -1330,15 +1330,15 @@ |
1331 | 1331 | } |
1332 | 1332 | |
1333 | 1333 | function store( $srcPath, $dstZone, $dstRel, $flags = 0 ) { |
1334 | | - throw new MWException( get_class($this) . ': write operations are not supported' ); |
| 1334 | + throw new MWException( get_class( $this ) . ': write operations are not supported' ); |
1335 | 1335 | } |
1336 | 1336 | |
1337 | 1337 | function publish( $srcPath, $dstRel, $archiveRel, $flags = 0 ) { |
1338 | | - throw new MWException( get_class($this) . ': write operations are not supported' ); |
| 1338 | + throw new MWException( get_class( $this ) . ': write operations are not supported' ); |
1339 | 1339 | } |
1340 | 1340 | |
1341 | 1341 | function deleteBatch( $sourceDestPairs ) { |
1342 | | - throw new MWException( get_class($this) . ': write operations are not supported' ); |
| 1342 | + throw new MWException( get_class( $this ) . ': write operations are not supported' ); |
1343 | 1343 | } |
1344 | 1344 | } |
1345 | 1345 | |
— | — | @@ -1354,7 +1354,7 @@ |
1355 | 1355 | * |
1356 | 1356 | * @ingroup FileRepo |
1357 | 1357 | */ |
1358 | | -class SwiftForeignDBViaLBRepo extends SwiftRepo{ |
| 1358 | +class SwiftForeignDBViaLBRepo extends SwiftRepo { |
1359 | 1359 | var $wiki, $dbName, $tablePrefix; |
1360 | 1360 | var $fileFactory = array( 'SwiftForeignDBFile', 'newFromTitle' ); |
1361 | 1361 | var $fileFromRowFactory = array( 'SwiftForeignDBFile', 'newFromRow' ); |
— | — | @@ -1389,7 +1389,7 @@ |
1390 | 1390 | |
1391 | 1391 | /** |
1392 | 1392 | * Get a key on the primary cache for this repository. |
1393 | | - * Returns false if the repository's cache is not accessible at this site. |
| 1393 | + * Returns false if the repository's cache is not accessible at this site. |
1394 | 1394 | * The parameters are the parts of the key, as for wfMemcKey(). |
1395 | 1395 | */ |
1396 | 1396 | function getSharedCacheKey( /*...*/ ) { |
— | — | @@ -1403,14 +1403,14 @@ |
1404 | 1404 | } |
1405 | 1405 | |
1406 | 1406 | function store( $srcPath, $dstZone, $dstRel, $flags = 0 ) { |
1407 | | - throw new MWException( get_class($this) . ': write operations are not supported' ); |
| 1407 | + throw new MWException( get_class( $this ) . ': write operations are not supported' ); |
1408 | 1408 | } |
1409 | 1409 | |
1410 | 1410 | function publish( $srcPath, $dstRel, $archiveRel, $flags = 0 ) { |
1411 | | - throw new MWException( get_class($this) . ': write operations are not supported' ); |
| 1411 | + throw new MWException( get_class( $this ) . ': write operations are not supported' ); |
1412 | 1412 | } |
1413 | 1413 | |
1414 | 1414 | function deleteBatch( $fileMap ) { |
1415 | | - throw new MWException( get_class($this) . ': write operations are not supported' ); |
| 1415 | + throw new MWException( get_class( $this ) . ': write operations are not supported' ); |
1416 | 1416 | } |
1417 | 1417 | } |