当前位置: 首页>>代码示例>>PHP>>正文


PHP FileBackend::doQuickOperations方法代码示例

本文整理汇总了PHP中FileBackend::doQuickOperations方法的典型用法代码示例。如果您正苦于以下问题:PHP FileBackend::doQuickOperations方法的具体用法?PHP FileBackend::doQuickOperations怎么用?PHP FileBackend::doQuickOperations使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FileBackend的用法示例。


在下文中一共展示了FileBackend::doQuickOperations方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: quickPurgeBatch

 /**
  * Purge a batch of files from the repo.
  * This function can be used to write to otherwise read-only foreign repos.
  * This does no locking nor journaling and is intended for purging thumbnails.
  *
  * @param array $paths List of virtual URLs or storage paths
  * @return FileRepoStatus
  */
 public function quickPurgeBatch(array $paths)
 {
     $status = $this->newGood();
     $operations = array();
     foreach ($paths as $path) {
         $operations[] = array('op' => 'delete', 'src' => $this->resolveToStoragePath($path), 'ignoreMissingSource' => true);
     }
     $status->merge($this->backend->doQuickOperations($operations));
     return $status;
 }
开发者ID:whysasse,项目名称:kmwiki,代码行数:18,代码来源:FileRepo.php

示例2: create

 private function create(array $params)
 {
     $params['op'] = 'create';
     return $this->backend->doQuickOperations(array($params));
 }
开发者ID:biribogos,项目名称:wikihow-src,代码行数:5,代码来源:FileBackendTest.php

示例3: delFileBatch

	/**
	 * @param array $dstPathsRel
	 * @param string $backendRel
	 * @param FileBackend $dst
	 * @return void
	 */
	protected function delFileBatch(
		array $dstPathsRel, $backendRel, FileBackend $dst
	) {
		$ops = array();
		$deletedRel = array(); // for output message
		$wikiId = $dst->getWikiId();

		// Determine what files need to be copied over...
		foreach ( $dstPathsRel as $dstPathRel ) {
			$dstPath = $dst->getRootStoragePath() . "/$backendRel/$dstPathRel";
			$ops[] = array( 'op' => 'delete', 'src' => $dstPath );
			$deletedRel[] = $dstPathRel;
		}

		// Delete the batch of source files...
		$t_start = microtime( true );
		$status = $dst->doQuickOperations( $ops, array( 'bypassReadOnly' => 1 ) );
		if ( !$status->isOK() ) {
			sleep( 10 ); // wait and retry copy again
			$status = $dst->doQuickOperations( $ops, array( 'bypassReadOnly' => 1 ) );
		}
		$ellapsed_ms = floor( ( microtime( true ) - $t_start ) * 1000 );
		if ( !$status->isOK() ) {
			$this->error( print_r( $status->getErrorsArray(), true ) );
			$this->error( "$wikiId: Could not delete file batch.", 1 ); // die
		} elseif ( count( $deletedRel ) ) {
			$this->output( "\n\tDeleted these file(s) [{$ellapsed_ms}ms]:\n\t" .
				implode( "\n\t", $deletedRel ) . "\n\n" );
		}
	}
开发者ID:nahoj,项目名称:mediawiki_ynh,代码行数:36,代码来源:copyFileBackend.php


注:本文中的FileBackend::doQuickOperations方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。