X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Ffilebackend%2FFileOpBatch.php;h=b0d83e01dbb032cf7a9b2d0c73816c6008db8c6a;hb=496e14b0b25ae24cdf486bffe8140023b3e1281e;hp=56d70009822459d266b530110f87cbc951ceccf1;hpb=cf8adc462e623a0a101ddfdf3de4fc7d7e891e60;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/filebackend/FileOpBatch.php b/includes/filebackend/FileOpBatch.php index 56d7000982..b0d83e01db 100644 --- a/includes/filebackend/FileOpBatch.php +++ b/includes/filebackend/FileOpBatch.php @@ -167,7 +167,11 @@ class FileOpBatch { // or the backend does not support async ops and did it synchronously. foreach ( $performOpsBatch as $i => $fileOp ) { if ( !isset( $status->success[$i] ) ) { // didn't already fail in precheck() - $subStatus = $fileOp->attemptAsync(); + // Parallel ops may be disabled in config due to missing dependencies, + // (e.g. needing popen()). When they are, $performOpsBatch has size 1. + $subStatus = ( count( $performOpsBatch ) > 1 ) + ? $fileOp->attemptAsync() + : $fileOp->attempt(); if ( $subStatus->value instanceof FileBackendStoreOpHandle ) { $opHandles[$i] = $subStatus->value; // deferred } else {