本文整理汇总了PHP中File_Archive::cache方法的典型用法代码示例。如果您正苦于以下问题:PHP File_Archive::cache方法的具体用法?PHP File_Archive::cache怎么用?PHP File_Archive::cache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类File_Archive
的用法示例。
在下文中一共展示了File_Archive::cache方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
/**
* 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;
}
}
}
示例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)) {
$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;
}
}
}