app/lib/class/sdcms_zip.php

(完整代码) 751B

<?php
final class sdcms_zip
{
	public static function check()
	{
		if(!function_exists('gzopen'))
		{
			exit('zlib扩展未启用');
		}
		require_once APP_SYS_PATH."/lib/class/zip/pclzip.php";
	}

	public static function zip($from,$new)
	{
		self::check();
		$zip=new PclZip($new);
		$result=$zip->create($from,PCLZIP_OPT_REMOVE_PATH,$from);
		if($result==0)
		{
			return "Error : ".$zip->errorInfo(true);
		}
		else
		{
			return true;
		}
	}

	public static function unzip($from,$to)
	{
		self::check();
		$zip=new PclZip($from);
		$result=$zip->extract(PCLZIP_OPT_PATH,$to,PCLZIP_OPT_REPLACE_NEWER);
		if($result==0)
		{
			return "Error : ".$zip->errorInfo(true);
		}
		else
		{
			return true;
		}
	}
}

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。