本文整理匯總了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());
}