|
@@ 423-440 (lines=18) @@
|
| 420 |
|
* @param array $opts Batch operation options |
| 421 |
|
* @return StatusValue |
| 422 |
|
*/ |
| 423 |
|
final public function doOperations( array $ops, array $opts = [] ) { |
| 424 |
|
if ( empty( $opts['bypassReadOnly'] ) && $this->isReadOnly() ) { |
| 425 |
|
return $this->newStatus( 'backend-fail-readonly', $this->name, $this->readOnly ); |
| 426 |
|
} |
| 427 |
|
if ( !count( $ops ) ) { |
| 428 |
|
return $this->newStatus(); // nothing to do |
| 429 |
|
} |
| 430 |
|
|
| 431 |
|
$ops = $this->resolveFSFileObjects( $ops ); |
| 432 |
|
if ( empty( $opts['force'] ) ) { // sanity |
| 433 |
|
unset( $opts['nonLocking'] ); |
| 434 |
|
} |
| 435 |
|
|
| 436 |
|
/** @noinspection PhpUnusedLocalVariableInspection */ |
| 437 |
|
$scope = $this->getScopedPHPBehaviorForOps(); // try to ignore client aborts |
| 438 |
|
|
| 439 |
|
return $this->doOperationsInternal( $ops, $opts ); |
| 440 |
|
} |
| 441 |
|
|
| 442 |
|
/** |
| 443 |
|
* @see FileBackend::doOperations() |
|
@@ 661-678 (lines=18) @@
|
| 658 |
|
* @return StatusValue |
| 659 |
|
* @since 1.20 |
| 660 |
|
*/ |
| 661 |
|
final public function doQuickOperations( array $ops, array $opts = [] ) { |
| 662 |
|
if ( empty( $opts['bypassReadOnly'] ) && $this->isReadOnly() ) { |
| 663 |
|
return $this->newStatus( 'backend-fail-readonly', $this->name, $this->readOnly ); |
| 664 |
|
} |
| 665 |
|
if ( !count( $ops ) ) { |
| 666 |
|
return $this->newStatus(); // nothing to do |
| 667 |
|
} |
| 668 |
|
|
| 669 |
|
$ops = $this->resolveFSFileObjects( $ops ); |
| 670 |
|
foreach ( $ops as &$op ) { |
| 671 |
|
$op['overwrite'] = true; // avoids RTTs in key/value stores |
| 672 |
|
} |
| 673 |
|
|
| 674 |
|
/** @noinspection PhpUnusedLocalVariableInspection */ |
| 675 |
|
$scope = $this->getScopedPHPBehaviorForOps(); // try to ignore client aborts |
| 676 |
|
|
| 677 |
|
return $this->doQuickOperationsInternal( $ops ); |
| 678 |
|
} |
| 679 |
|
|
| 680 |
|
/** |
| 681 |
|
* @see FileBackend::doQuickOperations() |