本文整理汇总了PHP中File_Archive::readMulti方法的典型用法代码示例。如果您正苦于以下问题:PHP File_Archive::readMulti方法的具体用法?PHP File_Archive::readMulti怎么用?PHP File_Archive::readMulti使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类File_Archive
的用法示例。
在下文中一共展示了File_Archive::readMulti方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testConcatReader
function testConcatReader()
{
$source = File_Archive::readMulti();
$source->addSource(File_Archive::readMemory("ABCDE", "fo"));
$source->addSource(File_Archive::readMemory("FGHIJ", "ob"));
$source->addSource(File_Archive::readMemory("KLMNO", "ar"));
$reader = File_Archive::readConcat($source, "foobar");
$this->assertTrue($reader->next());
$this->assertEquals("ABC", $reader->getData(3));
$this->assertEquals("DEF", $reader->getData(3));
$this->assertEquals("GHIJKLMNO", $reader->getData());
$this->assertFalse($reader->next());
$reader->close();
}
示例2:
/**
* Try to interpret the object as a reader
* Strings are converted to readers using File_Archive::read
* Arrays are converted to readers using File_Archive::readMulti
*
* @access private
*/
function &_convertToReader(&$source)
{
if (is_string($source)) {
$cacheCondition = File_Archive::getOption('cacheCondition');
if ($cacheCondition !== false && preg_match($cacheCondition, $source)) {
return File_Archive::cache(File_Archive::read($source));
} else {
return File_Archive::read(@$source);
}
} else {
if (is_array($source)) {
return File_Archive::readMulti($source);
} else {
return $source;
}
}
}
示例3:
/**
* Try to interpret the object as a reader
* Strings are converted to readers using File_Archive::read
* Arrays are converted to readers using File_Archive::readMulti
*
* @access private
*/
function &_convertToReader(&$source)
{
if (is_string($source)) {
$cacheCondition = File_Archive::getOption('cacheCondition');
if ($cacheCondition !== false && preg_match($cacheCondition, $source)) {
$obj = File_Archive::cache(File_Archive::read($source));
return $obj;
} else {
$obj = File_Archive::read($source);
return $obj;
}
} else {
if (is_array($source)) {
// PHP_Noticeがでるため修正 by S.Nakajima
$obj = File_Archive::readMulti($source);
return $obj;
} else {
return $source;
}
}
}