当前位置: 首页>>代码示例>>PHP>>正文


PHP Phpfox::getlib方法代码示例

本文整理汇总了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);
 }
开发者ID:nima7r,项目名称:phpfox-dist,代码行数:23,代码来源:export.class.php

示例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);		
	}
开发者ID:hoanghd,项目名称:tools,代码行数:24,代码来源:export.class.php


注:本文中的Phpfox::getlib方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。