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


PHP File_Archive::removeFromSource方法代码示例

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


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

示例1: removeDuplicatesFromSource

 /**
  * Remove duplicates from a source, keeping the most recent one (or the one that has highest pos in
  * the archive if the files have same date or no date specified)
  *
  * @param File_Archive_Reader a reader that may contain duplicates
  */
 function removeDuplicatesFromSource(&$toConvert, $URL = null)
 {
     $source =& File_Archive::_convertToReader($toConvert);
     if (PEAR::isError($source)) {
         return $source;
     }
     if ($URL !== null && substr($URL, -1) != '/') {
         $URL .= '/';
     }
     if ($source === null) {
         $source = File_Archive::read($URL);
     }
     require_once dirname(__FILE__) . "/Archive/Predicate/Duplicate.php";
     $pred = new File_Archive_Predicate_Duplicate($source);
     $source->close();
     return File_Archive::removeFromSource($pred, $source, null);
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:23,代码来源:Archive.php

示例2: _testRemove

 function _testRemove($extension)
 {
     $writer = File_Archive::toArchive("test.{$extension}", File_Archive::toVariable($x));
     $writer->newFile('foo.txt');
     $writer->writeData('ABCDEF');
     $writer->newFile('bla_to_remove.txt');
     $writer->writeData('GHIJKL');
     $writer->newFile('bar.txt');
     $writer->writeData('MNOP');
     $writer->close();
     File_Archive::removeFromSource(File_Archive::predEreg('_to_remove'), $source = File_Archive::readSource(File_Archive::readMemory($x, "test.{$extension}"), "test.{$extension}/"));
     $this->assertEquals("foo.txt\nbar.txt", implode("\n", $source->getFileList()));
 }
开发者ID:andychang88,项目名称:jianzhanseo.com,代码行数:13,代码来源:test.php


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