本文整理汇总了PHP中JSession::getName方法的典型用法代码示例。如果您正苦于以下问题:PHP JSession::getName方法的具体用法?PHP JSession::getName怎么用?PHP JSession::getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JSession
的用法示例。
在下文中一共展示了JSession::getName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetName
/**
* Test getName
*
* @covers JSession::getName
*
* @return void
*/
public function testGetName()
{
$this->assertEquals(session_name(), $this->object->getName(), 'Session names should match.');
}
示例2: testGetName
/**
* Test getName
*
* @covers JSession::getName
*
* @return void
*/
public function testGetName()
{
// PHPUnit sets a session name of 'PHPSESSID' while our code uses an MD5 hash so we cannot test directly with session_name()
$this->assertEquals(md5('PHPSESSID'), $this->object->getName(), 'Session names should match.');
}
示例3: getInput
protected function getInput()
{
$moduleID = intval($this->form->getValue('id'));
$moduleURL = JURI::root() . 'modules/mod_bt_apb';
$class = $this->element['class'] ? (string) $this->element['class'] : '';
$html = '
<div id="bt-drop-area" class="dropbox ' . $class . '">
<div class="select-button">
<input name="images[]" type="file" id="bt-input-file" multiple="multiple"/>
<span>' . JText::_('SELECT_IMAGES') . '</span>
</div>
<p>' . JText::_('DRAG_AND_DROP_TO_UPLOAD') . '</p>
</div>
<script type="text/javascript">
jQuery(document).ready(function($){
$("#bt-drop-area").filedrop({
paramname: "bt_images",
maxfiles: 10,
maxfilesize: 2,
url: "' . JURI::root() . 'administrator/index.php",
data: {
"action" : "upload",
"option" : "com_modules",
"view" : "module",
"layout" : "edit",
"id" : ' . $moduleID . ',
"' . JSession::getName() . '": "' . JSession::getId() . '",
"' . JSession::getFormToken() . '" : 1
},
error: function(err, file) {
switch(err) {
case "BrowserNotSupported":
BTSlideshow.showMessage("#btss-message", "Your browser does not support HTML5 file uploads!");
break;
case "TooManyFiles":
BTSlideshow.showMessage("#btss-message", "Too many files! Please select 5 at most!");
break;
case "FileTooLarge":
BTSlideshow.showMessage("#btss-message", file.name+ " is too large! Please upload files up to 2MB.");
break;
default:
break;
}
inProgess = false;
BTSlideshow.removeLog();
},
drop: function() {
inProgess = true;
BTSlideshow.showMessage("#btss-message", "Loading images... <span class=\\"btss-upload-spinner\\"></span>");
},
// Called before each upload is started
beforeEach: function(file){
if(!file.type.match(/^image\\//)){
BTSlideshow.showMessage("#btss-message", file.name + " can\'t be uploaded. Only images are allowed!");
inProgess = false;
BTSlideshow.removeLog();
return false;
}
},
uploadStarted:function(i, file, len){
BTSlideshow.showMessage("#btss-message", "<div id=\\"btss-upload-file-" + i + "\\">Loading <b>" + file.name + "</b><span class=\\"btss-upload-spinner\\"></span></div>");
},
uploadFinished: function(i, file, response, time) {
if (!response.success) {
jQuery("#btss-upload-file-"+i).append("<span style=\\"color: red;\\"> " + response.message +"</span>");
}
else {
var file = response.files;
var item = {
file: file.filename,
title: file.title
};
BTSlideshow.add(item, true);
jQuery("#btss-upload-file-"+i).append("<span style=\\"color: green;\\"> Completed</span>");
}
},
afterAll: function(){
inProgess = false;
BTSlideshow.removeLog();
}
});
//select files
jQuery("#bt-input-file").change(function (e) {
var i = 0, len = this.files.length, reader, file, formdata;
inProgess = true;
jQuery("#bt-input-file").parent().addClass("disabled");
jQuery("#bt-input-file").next("span").html("Uploading...");
jQuery("#bt-input-file").attr("disabled", "disabled");
BTSlideshow.showMessage("#btss-message", "Loading images... <span class=\\"btss-upload-spinner\\"></span>");
//.........这里部分代码省略.........