From: Reedy Date: Mon, 17 Dec 2012 21:18:50 +0000 (+0000) Subject: Suppress warnings around copy call X-Git-Tag: 1.31.0-rc.0~21227^2 X-Git-Url: https://git.cyclocoop.org/%27.%24link.%27?a=commitdiff_plain;h=bfbabaab02ae0273229e0bc3745d0f84c6e81014;p=lhc%2Fweb%2Fwiklou.git Suppress warnings around copy call Attempt to shut some noise in production logs Change-Id: I4bac4027d82e4194b6ec46658d52f49038db573c Warning: copy(/mnt/thumbs2/wikipedia/commons/thumb/8/8c/Map_of_USA_AK_full.png/120px-Map_of_USA_AK_full.png) [function.copy]: failed to open stream: No such file or directory in /usr/local/apache/common-local/php-1.21wmf6/includes/filebackend/FSFileBackend.php on line 254 --- diff --git a/includes/filebackend/FSFileBackend.php b/includes/filebackend/FSFileBackend.php index c60abb1d25..94502571a8 100644 --- a/includes/filebackend/FSFileBackend.php +++ b/includes/filebackend/FSFileBackend.php @@ -251,7 +251,9 @@ class FSFileBackend extends FileBackendStore { ) ); $status->value = new FSFileOpHandle( $this, $params, 'Store', $cmd, $dest ); } else { // immediate write + wfSuppressWarnings(); $ok = copy( $params['src'], $dest ); + wfRestoreWarnings(); // In some cases (at least over NFS), copy() returns true when it fails if ( !$ok || ( filesize( $params['src'] ) !== filesize( $dest ) ) ) { if ( $ok ) { // PHP bug