Class Upgrade
Methods summary
public
array
|
#
fetchUpdateFileList( array $upgradeInfo )
获取更新文件列表 原名fetch_updatefile_list
获取更新文件列表 原名fetch_updatefile_list
Parameters
Returns
array array('file'=>文件名列表, 'md5'=>每个文件对应的md5码)
Author
Ring
|
public
array
|
#
compareBaseFile( array $upgradeInfo, array $upgradeFileList )
对比文件,筛选出需要更新的文件列表 原名compare_basefile
对比文件,筛选出需要更新的文件列表 原名compare_basefile
Parameters
- $upgradeInfo
- 更新信息
- $upgradeFileList
- 需要更新的文件列表
Returns
array array(需要更新的文件列表, 不需要更新的文件列表, 被忽略的文件列表(不存在或者被忽略的文件))
Author
Ring
|
public
boolean
|
#
compareFileContent( string $file, string $remoteFile )
原名compare_file_content
Parameters
Returns
boolean
Author
Ring
|
public
boolean
|
#
checkUpgrade( )
检查更新信息,这些信息将被记录在setting中的upgrade中
检查更新信息,这些信息将被记录在setting中的upgrade中
Returns
boolean
Author
Ring
|
public
boolean
|
#
checkFolderPerm( array $updateFileList )
原名check_folder_perm
Parameters
Returns
boolean
Author
Ring
|
public
integer
|
#
testWritAble( string $dir )
测试是否有写文件的权限,有返回1 原名test_writable
测试是否有写文件的权限,有返回1 原名test_writable
Parameters
Returns
integer
Author
Ring
|
public
boolean|integer
|
#
downloadFile( array $upgradeInfo, string $file, string $folder = 'upload', string $md5 = '', integer $position = 0, integer $offset = 0 )
下载文件 原名download_file
Parameters
- $upgradeInfo
- 更新信息
- $file
- 文件名(包括目录名)
- $folder
- 目录名,此目录名并不是指本地,而是官方服务器的目录
- $md5
- md5码
- $position
- $position 文件指针,指定文件指针后,下载器将从这个指针开始下载
- $offset
- $offset 指定本文内容长度,仅仅检验下载文件的长度是否和$offset相等,如果相等将不执行md5检验
Returns
boolean|integer 0 md5检验失败 1 断点文件下载成功 2 md5检验成功(文件完全下载完成才会进行)
Author
Ring
|
public
boolean
|
#
mkdirs( string $dir )
新建目录
Parameters
Returns
boolean
Author
Ring
|
public
boolean
|
#
copyFile( string $srcFile, string $desFile, string $type )
原名copy_file
Parameters
Returns
boolean
Author
Ring
|
public
string
|
#
versionPath( )
versionPath
Returns
string
|
public
|
#
copyDir( string $srcDir, string $destDir )
|
public
|
#
rmdirs( string $srcDir )
|