本文整理汇总了PHP中eZFile::downloadContent方法的典型用法代码示例。如果您正苦于以下问题:PHP eZFile::downloadContent方法的具体用法?PHP eZFile::downloadContent怎么用?PHP eZFile::downloadContent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZFile
的用法示例。
在下文中一共展示了eZFile::downloadContent方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: passthrough
/**
* Sends the contents of $filePath to default output
*
* @param string $filePath File path
* @param int $startOffset Starting offset
* @param bool|int $length Length to transmit, false means everything
* @return bool true, or false if operation failed
*/
public function passthrough($filePath, $startOffset = 0, $length = false)
{
return eZFile::downloadContent($this->makeDFSPath($filePath), $startOffset, $length);
}
示例2: passthrough
/**
* Outputs file contents to the browser
* Note: does not handle headers. eZFile::downloadHeaders() can be used for this
*
* @param int $offset Transfer start offset
* @param int $length Transfer length, in bytes
*/
function passthrough($offset = 0, $length = false)
{
eZDebugSetting::writeDebug('kernel-clustering', "fs::passthrough( '{$this->filePath}' )", __METHOD__);
eZDebug::accumulatorStart('dbfile', false, 'dbfile');
eZFile::downloadContent($this->filePath, $offset, $length);
eZDebug::accumulatorStop('dbfile');
}
示例3: testDownloadNoFile
public function testDownloadNoFile()
{
ob_start();
$this->assertFalse(eZFile::downloadContent("unexisting.txt"));
$this->assertEquals("", ob_get_clean());
}