joomlaclass4Word格式文档下载.docx
- 文档编号:22403767
- 上传时间:2023-02-03
- 格式:DOCX
- 页数:22
- 大小:20.80KB
joomlaclass4Word格式文档下载.docx
《joomlaclass4Word格式文档下载.docx》由会员分享,可在线阅读,更多相关《joomlaclass4Word格式文档下载.docx(22页珍藏版)》请在冰豆网上搜索。
解析用户代理串并且初始化与所有已知的特点和突变的对象特定浏览器的
setBrowser
设置当前浏览器
setFeature
设置当前浏览器的插件
setQuirk
设置当前浏览器的独特的行为
_setPlatform
匹配浏览器的平台.
方法应用:
getAgentString()
意义:
语法:
stringgetAgentString();
实际应用:
$temp=&
newJBrowser();
echo$temp->
getAgentString();
getBrowser()
stringgetBrowser()
getBrowser();
getFeature()
getFeature();
getHTTPProtocol()
stringgetHTTPProtocol()
getHTTPProtocol();
getInstance()
getInstance([string$userAgent=null],[string$accept=null])
string$userAgent:
Thebrowserstringtoparse.
string$accept:
TheHTTP_ACCEPTsettingstouse.
print_r($temp->
getInstance());
getMajor()
getMajor();
getMinor()
getMinor();
getPlatform()
检索当前浏览器的平台
getPlatform();
getVersion()
检索当前浏览器的版本
stringgetVersion()
getVersion();
isBrowser()
检索当前浏览器的名称
booleanisBrowser(string$browser)
string$browser:
Thebrowsertocheck.
isBrowser('
mozilla'
);
isRobot()
booleanisRobot()
var_dump($temp->
isRobot());
isSSLConnection()
booleanisSSLConnection()
isSSLConnection());
isViewable()
booleanisViewable(string$mimetype)
string$mimetype:
TheMIMEtypetocheck.
isViewable('
text/html'
));
setBrowser()
voidsetBrowser(string$browser)
$temp->
setBrowser('
ie'
_browser;
JRequest
这类服务提供Joomla框架以一个共同的接口给通入请求变量。
这包括$_POST、$_GET和$_REQUEST。
变量可以通过输入过滤器避免注射或返回未加工的变量。
clean
清除请求信息
get
返回请求数组
getBool
取指令和回归特定被过滤的变量,bool过滤器只将退回真实或错误bool值。
getCmd
取指令和回归特定被过滤的变量,cmd过滤器只允许字符[A-Za-z0-9。
-_]。
getFloat
取指令和回归特定被过滤的变量,浮点过滤器只允许数字和期间
getInt
取指令和回归特定被过滤的变量,整数过滤器将允许仅数字返回。
getMethod
得到请求方法.
getString
取指令和回归特定被过滤的变量,串过滤器删除‘非法’HTML代码,
getURI
得到请求路径
getVar
取指令和回归特定变量.
getWord
取指令和回归特定被过滤的变量,cmd过滤器只允许字符[A-Za-z]
set
setVar
设置请求变量.
_cleanArray
增加一个数组到GLOBALS数组并且检查GLOBALS变量没有被攻击
_cleanVar
清除输入变量
_stripSlashesRecursive
clean()
voidclean()
$temp=newJRequest();
clean();
get()
mixedget([string$hash='
default'
],int$mask)
$tem=$temp->
get();
var_dump($tem);
setVar()
设置请求变量
stringsetVar(string$name,[string$value=null],[string$hash='
method'
],[boolean$overwrite=true])
getVar()
取指令和回归特定变量
mixedgetVar(string$name,[string$default=null],[string$hash='
],[string$type='
none'
setVar('
tmp'
'
123456'
getVar('
getMethod()
得到请求方法
stringgetMethod()
$temp=newJRequest();
getMethod();
getURI()
stringgetURI()
getURI();
Jerror
attachHandler
把错误付给JError方法
customErrorHandler
显示自定义错误信息并且退出.
detachHandler
取消把错误付给JError方法
getError
在错误堆检索最后对象的方法
getErrorHandling
在当前错误设置的方法得到一个指定的错误级别
getErrors
检索例外堆的方法
handleCallback
回收
handleDie
结束错误句柄
handleEcho
输出错误句柄
handleIgonre
乎略错误句柄
handleLog
记录错误句柄
handleMessage
消息错误句柄
handleVerbose
冗长错误句柄
isError
确定属性是否为列外对象的方法.
Raise
通过的参数创造指定的一个新的JException对象
raiseError
定义一个错误代码并且用消息替换.
raiseNotice
raiseWarning
用预定义的E_warning和backtrace封装raise()方法
registerErrorLevel
登记处理的错误一个新的错误级别的方法
setErrorHandling
设置方式的方法JError将处理不同的错误级别。
translateErrorLevel
即翻译错误级别整数为人类易读的串E_ERROR将被翻译为‘错误’
实际应用:
getErrors()
array&
JError:
:
setErrorHandling(E_ALL,’store’);
raiseNotice(‘253’,’Thisisonlyatest!
’);
$errors=JError:
getErrors();
Foreach($errorsas$error)
{
Echo$error->
message;
}
结果:
Thisisonlyatest!
!
isError()
确定属性是否为列外对象的方法
BooleanisError(mixed&
$object)
Mixed&
$object:
objecttocheck
$template=JTemplate:
getInstance();
$template->
readTemplatesFromInput(‘page.html’);
$result=$template->
fetch(‘wrongname’);
If(JError:
isError($result)){
Echo“yesitisanerror”;
}else{
Echo“noitisnotanerror”;
Result:
Yes.itisanerror.
Raise()
意义:
通过的参数创造指定的一个新的JException对象.
语法:
mixed&
raise(int$level,string$code,string$msg,[mixed$info=null],[$backtrace=false])
Int$level:
theerrorlevel-useanyofphp’sownerrorlevelsforthis:
E_ERROR,E_WARING,E_NOTICE,E_USER_ERROR,E_USER_WARNING,E_USER_NOTICE.
String$code:
theapplication-internalerrorcodeforthiserror.
String$msg:
theerrormessage,whichmayalsobeshowntheuserifneedbe.
Mixed$info:
optional:
additionalerrorinformation(usuallyonlydeveloper-revantinformationthattheusershouldneversee,likeadatabasedsn).
$backtrace
实际应用:
raise(E_NOTICE,’6000’,’fileaccesserror!
Jos-Notice:
fileaccesserror!
object&
raiseError(string$code,string$msg,[mixed$info=null])
theapplication-internalerrorcodeforthiserror
additionalerrorinformation(usuallyonlydeveloper-revantinformationthattheusershouldneversee,likeadatabasedsn)
setErrorHandling(E_ALL,’echo’);
raiseError(‘6000’,’fileaccesserror!
Jos-Error:
.
serErrorHandling
设置方式的方法JError将处理不同的错误级别。
mixedsetErrorHandling(int
$level,string
$mode,[mixed
$options=null])
int$level:
Theerrorlevelforwhichtosettheerrorhandling
string$mode:
Themodetousefortheerrorhandling.
mixed$options:
Optional:
Anyoptionsneededforthegivenmode.
setErrorHandling(E_ERROR,'
echo'
);
setErrorHandling(E_NOTICE|E_WARNING,'
verbose'
setErrorHandling(E_ALL^E_ERROR);
raise(E_ERROR,'
6000'
'
Fileaccesserror!
'
jos-Error:
Fileaccesserror!
JException
getCode
的带扩展代码
getFile
得到扩展的源文件名
getLine
得到扩展的源文件行数
getMessage
得到扩展信息
getTrace
得到backtrace()数组
getTraceAsString
得到backtrace信息格式
toString
返回错误信息
$tem=&
newJException(‘errors’);
$temp1=$tem->
getCode();
$temp2=$tem->
getMessage();
$temp3=$tem->
getFile();
JProfiler
公共类协助在benchmarking代码的部分的施行过程中了解何处花费时间。
getBuffer
得到当前profiler标记
JProfiler&
返回一个全局profiler指针,没有就创建一个
getMemory
得到当前使用内存信息
Getmicrotime
得到当前时间
mark
输出时间标记
Jimport(“joomla.error.profiler”);
$temp=&
newJProfiler;
$tem=$temp->
getMemory();
结果:
输出当前使用内存量.
JFile
文件处理类
Copy
复制文件.
Delete
删除文件或者数组文件
Exists
封装为标准的file_exists函数
getExt
得到文件的扩展名
getName
返回文件名
makeSafe
使用文件的安全模式
Move
移动文件
Read
读取文件目录
stripExt
过滤最后引伸文件名
Upload
上传文件
Write
把目录写入文件
实际应用
Copy()
复制文件
booleancopy(string$src,string$dest,[string$path=null])
String$src:
thepathtothesourcefile
String$dest:
thepathtothedestinationfile
String$path:
anoptionalbasepathtoprefixtothefilenames
Jimport(‘joomla.filesystem.file’);
$sfile=‘foo.php’;
$tfile=‘images/bar.php’;
If(JFile:
exists($sfile))
Echo“fileexists.”;
If(JFile:
copy($sfile,$tfile))
Echo“filecopyed”;
在images文件夹下创建个bar.php文件.
Move()
意义;
booleanmove(string$src,string$dest,[string$path=’’])
string$src:
Thepathtothesourcefile
string$dest:
Thepathtothedestinationfile
string$path:
Anoptionalbasepathtoprefixtothefilenames
Jimport(‘joomla.filesystem.file’);
$sfile=‘foo.php’;
$tfile=‘images/bar.php’;
{
Echo“fileexists.”;
If(JFile:
move($sfile,$tfile))
Echo“filemoved”;
}
在images文件夹下创建个bar.php文件,并且原来的foo.php文件不存在了
Delete()
删除单个文件或者数组文件
booleandelete(mixed
$file)
mixed$file:
Thefilenameoranarrayoffilenames
$files=array(JPATH_COMPONENT.DS.'
foo.php'
JPATH_COMPONENT.DS.'
bar.php'
if(JFile:
delete($files))
{
Echo“allfileshavebeendeleted!
”;
}
文件或者文件数组被删除.
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- joomlaclass4