本文整理汇总了PHP中Phpfox::getlib方法的典型用法代码示例。如果您正苦于以下问题:PHP Phpfox::getlib方法的具体用法?PHP Phpfox::getlib怎么用?PHP Phpfox::getlib使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Phpfox
的用法示例。
在下文中一共展示了Phpfox::getlib方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: download
/**
* Method used to compress data and then send it to the user to download on the spot.
*
* @param string $sName Name of the archive
* @param string $sExt File extension of the archive (zip, tar.gz, xml)
* @param string $sFolder Folder to compress. Must be located within the "file/cache/" folder.
* @return bool Only returns false if we were unable to compress the data
*/
public function download($sName, $sExt, $sFolder, $iServerId = 0)
{
if (!($sNewFile = Phpfox::getLib('phpfox.archive', $sExt)->compress($sName, $sFolder))) {
return false;
}
if (Phpfox::getParam('core.allow_cdn')) {
Phpfox::getLib('cdn')->put($sNewFile);
}
if (is_dir(PHPFOX_DIR_CACHE . $sFolder . PHPFOX_DS)) {
Phpfox_File::instance()->delete_directory(PHPFOX_DIR_CACHE . $sFolder . PHPFOX_DS);
}
($sPlugin = Phpfox_Plugin::get('archive_export_download')) ? eval($sPlugin) : false;
// Phpfox::getlib('phpfox.file')->forceDownload($sNewFile, $sName . '.' . $sExt);
Phpfox::getlib('phpfox.file')->forceDownload($sNewFile, $sName . '.' . $sExt, '', '', $iServerId);
}
示例2: download
/**
* Method used to compress data and then send it to the user to download on the spot.
*
* @param string $sName Name of the archive
* @param string $sExt File extension of the archive (zip, tar.gz, xml)
* @param string $sFolder Folder to compress. Must be located within the "file/cache/" folder.
* @return bool Only returns false if we were unable to compress the data
*/
public function download($sName, $sExt, $sFolder)
{
if (!($sNewFile = Phpfox::getLib('phpfox.archive', $sExt)->compress($sName, $sFolder)))
{
return false;
}
if (is_dir(PHPFOX_DIR_CACHE . $sFolder . PHPFOX_DS))
{
Phpfox::getLib('file')->delete_directory(PHPFOX_DIR_CACHE . $sFolder . PHPFOX_DS);
}
(($sPlugin = Phpfox_Plugin::get('archive_export_download')) ? eval($sPlugin) : false);
Phpfox::getlib('phpfox.file')->forceDownload($sNewFile, $sName . '.' . $sExt);
}