Class: WindPack
Source Location: /utility/WindPack.php
Class WindPack
Methods
string callBack(
string
$content, [string
$replace = '']
)
|
|
回调函数调用
Parameters:
string |
$content: |
被回调的内容 |
string |
$replace: |
替换内容,默认为空 |
API Tags:
string getContentBySuffix(
string
$content, string
$suffix, [string
$replace = ' ']
)
|
|
根据文件后缀得取对应的mime内容
Parameters:
string |
$content: |
要打包的内容内容 |
string |
$suffix: |
文件后缀类型 |
string |
$replace: |
替换的字串,默认为空 |
API Tags:
string getContentFromFile(
string
$filename
)
|
|
从文件读取内容
Parameters:
API Tags:
Return: | 如果给出的文件不是一个有效文件则返回false |
Access: | public |
boolean packFromDir(
mixed
$dir, string
$dst, [string
$packMethod = WindPack::STRIP_PHP], [boolean
$compress = true], [string
$absolutePath = ''], [array
$ndir = array('.','..','.svn')], [array
$suffix = array()], [array
$nfile = array()]
)
|
|
将指定文件类型且指定文件夹下的所指定文件打包成一个易阅读的文件,
Parameters:
mixed |
$dir: |
要打包的目录 |
string |
$dst: |
文件名 |
string |
$packMethod: |
打包方式,默认为stripWhiteSpaceByPhp |
boolean |
$compress: |
是否压缩,默认为true |
string |
$absolutePath: |
文件路径,默认为空 |
array |
$ndir: |
不须要打包的目录,默认包括'.', '..', '.svn'三个 |
array |
$suffix: |
不允许打包的文件类型,默认为空数组 |
array |
$nfile: |
不允许打包的文件,默认为空数组 |
API Tags:
boolean packFromFileList(
mixed
$fileList, string
$dst, [method
$packMethod = WindPack::STRIP_PHP], [boolean
$compress = true], [string
$absolutePath = '']
)
|
|
将给出的文件列表进行打包
Parameters:
mixed |
$fileList: |
文件列表 |
string |
$dst: |
打包文件的存放位置 |
method |
$packMethod: |
打包的方式,默认为stripWhiteSpaceByPhp |
boolean |
$compress: |
打包是否采用压缩的方式,默认为true |
string |
$absolutePath: |
文件路径,默认为空 |
API Tags:
array readContentFromDir(
[string
$packMethod = WindPack::STRIP_PHP], [mixed
$dir = array()], [string
$absolutePath = ''], [array
$ndir = array('.','..','.svn')], [array
$suffix = array()], [array
$nfile = array()]
)
|
|
从各个目录中取得对应的每个文件的内容
Parameters:
string |
$packMethod: |
打包方式,默认为stripWhiteSpaceByPhp |
mixed |
$dir: |
目录名,默认为空数组 |
string |
$absolutePath: |
绝对路径名,默认为空 |
array |
$ndir: |
不须要打包的目录,默认包括'.', '..', '.svn'三个 |
array |
$suffix: |
不允许打包的文件类型,默认为空数组 |
array |
$nfile: |
不允许打包的文件,默认为空数组 |
API Tags:
array: readContentFromFileList(
mixed
$fileList, [method
$packMethod = WindPack::STRIP_PHP], [string
$absolutePath = ''], [
&$content = array()], array
$content
)
|
|
从文件列表中取得对应的每个文件的内容
Parameters:
mixed |
$fileList: |
文件列表 |
method |
$packMethod: |
打包方式,默认为stripWhiteSpaceByPhp |
string |
$absolutePath: |
绝对路径名,默认为空 |
array |
$content: |
保存文件内容,默认为空数组 |
|
&$content: |
|
API Tags:
void setContentInjectionCallBack(
array
$contentInjectionCallBack, [string
$position = 'before']
)
|
|
设置回调
Parameters:
array |
$contentInjectionCallBack: |
回调函数 |
string |
$position: |
调用位置(before|after)默认为before |
API Tags:
Information Tags:
string stripComment(
string
$content, [mixed
$replace = '']
)
|
|
去除注释
Parameters:
string |
$content: |
要去除的内容 |
mixed |
$replace: |
要替换的文本 |
API Tags:
string stripImport(
string
$content, [mixed
$replace = '']
)
|
|
去除多余的文件导入信息
Parameters:
string |
$content: |
需要处理的内容 |
mixed |
$replace: |
用来替换将匹配出来的结果,默认为空 |
API Tags:
string stripNR(
string
$content, [mixed
$replace = array('\n','\r\n','\r')]
)
|
|
去除换行
Parameters:
string |
$content: |
要去除的内容 |
mixed |
$replace: |
要替换的文本 |
API Tags:
string stripPhpIdentify(
string
$content, [mixed
$replace = '']
)
|
|
去除php标识
Parameters:
string |
$content: |
需要处理的内容 |
mixed |
$replace: |
将php标识替换为该值,默认为空 |
API Tags:
string stripSpace(
string
$content, [mixed
$replace = ' ']
)
|
|
去除空格符
Parameters:
string |
$content: |
要去除的内容 |
mixed |
$replace: |
要替换的文本,默认为空 |
API Tags:
string stripStrByRule(
string
$content, string
$rule, [$mixed
$replace = '']
)
|
|
根据指定规则替换指定内容中相应的内容
Parameters:
string |
$content: |
需要处理的内容 |
string |
$rule: |
需要匹配的正则 |
$mixed |
$replace: |
用来替换将匹配出来的结果,默认为空 |
API Tags:
string stripWhiteSpaceByPhp(
string
$filename
)
|
|
通过php自身方式去除指定文件的注释及空白
Parameters:
API Tags:
string stripWhiteSpaceBySelf(
string
$filename, [boolean
$compress = true]
)
|
|
通过正则方式去除指定文件的注释及空白
Parameters:
string |
$filename: |
文件名字 |
boolean |
$compress: |
是否采用压缩,默认为true |
API Tags:
string stripWhiteSpaceByToken(
string
$filename
)
|
|
通过token方式去除指定文件的注释及空白
Parameters:
API Tags:
|
|