Merge pull request #10 from xpressengine/develop

Develop
This commit is contained in:
MinSoo Kim 2015-05-24 13:31:55 +09:00
commit ecce7e5efd
32 changed files with 317 additions and 2454 deletions

View file

@ -1,23 +1,30 @@
language: php
php:
- 5.3
- 5.4
- 5.5
- 5.6
- 7
- hhvm
- 5.3
- 5.4
- 5.5
- 5.6
- 7
- hhvm
matrix:
allow_failures:
- php: 7
- php: hhvm
- php: 7
- php: hhvm
before_script:
- travis_retry composer self-update
- npm install -g grunt-cli
- npm install
- if [ $(phpenv version-name) != "5.3" ]; then composer install; fi
- if [ $(phpenv version-name) != "5.3" ]; then mysql -e 'create database xe_test;'; fi
- if [ $(phpenv version-name) != "5.3" ]; then echo "USE mysql;\nUPDATE user SET password=PASSWORD('travis') WHERE user='travis';\nFLUSH PRIVILEGES;\n" | mysql -u root; fi
- if [ $(phpenv version-name) != "5.3" ]; then php -S localhost:8000 & fi
- travis_retry composer self-update
- npm install -g grunt-cli
- npm install
- if [ $(phpenv version-name) != "5.3" ]; then composer install; fi
- if [ $(phpenv version-name) != "5.3" ]; then mysql -e 'create database xe_test;';
fi
- if [ $(phpenv version-name) != "5.3" ]; then echo "USE mysql;\nUPDATE user SET password=PASSWORD('travis')
WHERE user='travis';\nFLUSH PRIVILEGES;\n" | mysql -u root; fi
- if [ $(phpenv version-name) != "5.3" ]; then php -S localhost:8000 & fi
script:
- grunt lint
- if [ $(phpenv version-name) != "5.3" ]; then ./vendor/bin/codecept run --env travis; fi
- grunt lint
- grunt minify
- if [ $(phpenv version-name) != "5.3" ]; then ./vendor/bin/codecept run --env travis;
fi
notifications:
slack:
secure: V4p13KlqML94RK0KTlHNJwrdwOK1K6n7sfxs6oILCJTqBfGuqN2fCglnxX78QEUwnl8LWrwSdA4AnUVfZqv6N5g7zlDDr2ZU2+a4XVApmEss3/C0g9zsYNlFfkJqChvtMsV29UiBjSfqn/coAVLtY1wbCYJYk3Wc2nmB/3Qti9Y=

View file

@ -78,6 +78,10 @@ class CacheFile extends CacheBase
$content[] = 'if(!defined(\'__XE__\')) { exit(); }';
$content[] = 'return \'' . addslashes(serialize($obj)) . '\';';
FileHandler::writeFile($cache_file, implode(PHP_EOL, $content));
if(function_exists('opcache_invalidate'))
{
@opcache_invalidate($cache_file, true);
}
}
/**
@ -139,6 +143,10 @@ class CacheFile extends CacheBase
function _delete($_key)
{
$cache_file = $this->getCacheFileName($_key);
if(function_exists('opcache_invalidate'))
{
@opcache_invalidate($cache_file, true);
}
FileHandler::removeFile($cache_file);
}

View file

@ -200,6 +200,10 @@ class Context
*/
function init()
{
if(!isset($GLOBALS['HTTP_RAW_POST_DATA']) && version_compare(PHP_VERSION, '5.6.0', '>=') === true) {
if(simplexml_load_string(file_get_contents("php://input")) !== false) $GLOBALS['HTTP_RAW_POST_DATA'] = file_get_contents("php://input");
}
// set context variables in $GLOBALS (to use in display handler)
$this->context = &$GLOBALS['__Context__'];
$this->context->lang = &$GLOBALS['lang'];
@ -1144,7 +1148,7 @@ class Context
$self->js_callback_func = $self->getJSCallbackFunc();
($type && $self->request_method = $type) or
(strpos($_SERVER['CONTENT_TYPE'], 'json') && $self->request_method = 'JSON') or
((strpos($_SERVER['CONTENT_TYPE'], 'json') || strpos($_SERVER['HTTP_CONTENT_TYPE'], 'json')) && $self->request_method = 'JSON') or
($GLOBALS['HTTP_RAW_POST_DATA'] && $self->request_method = 'XMLRPC') or
($self->js_callback_func && $self->request_method = 'JS_CALLBACK') or
($self->request_method = $_SERVER['REQUEST_METHOD']);
@ -1413,7 +1417,7 @@ class Context
*/
function _setUploadedArgument()
{
if($_SERVER['REQUEST_METHOD'] != 'POST' || !$_FILES || stripos($_SERVER['CONTENT_TYPE'], 'multipart/form-data') === FALSE)
if($_SERVER['REQUEST_METHOD'] != 'POST' || !$_FILES || (stripos($_SERVER['CONTENT_TYPE'], 'multipart/form-data') === FALSE && stripos($_SERVER['HTTP_CONTENT_TYPE'], 'multipart/form-data') === FALSE))
{
return;
}

View file

@ -265,7 +265,7 @@ class DBMysql extends DB
$query = sprintf("select password('%s') as password, old_password('%s') as old_password", $this->addQuotes($password), $this->addQuotes($password));
$result = $this->_query($query);
$tmp = $this->_fetch($result);
if($tmp->password == $saved_password || $tmp->old_password == $saved_password)
if($tmp->password === $saved_password || $tmp->old_password === $saved_password)
{
return true;
}

View file

@ -347,7 +347,7 @@ class FrontEndFileHandler extends Handler
}
elseif(!strncmp($path, '//', 2))
{
return $path;
return preg_replace('#^//+#', '//', $path);
}
$path = preg_replace('@/\./|(?<!:)\/\/@', '/', $path);

View file

@ -4,7 +4,7 @@
var default_settings = {
autoUpload: true,
dataType: 'json',
replaceFileInput: false,
sequentialUploads: true,
dropZone: '.xefu-dropzone',
fileList: '.xefu-list',
@ -48,6 +48,9 @@
editor_sequence: null,
init : function() {
},
deactivate: function() {
console.log(this);
},
createInstance: function(containerEl, opt) {
var self = this;
var $container = this.$container = containerEl;
@ -247,8 +250,11 @@
loadFilelist: function() {
var self = this;
var data = this.$container.data();
var obj = {};
obj.mid = window.current_mid;
obj.editor_sequence = self.$container.data('editor-sequence');
$.exec_json('file.getFileList', {'editor_sequence': self.$container.data('editor-sequence')}, function(res){
$.exec_json('file.getFileList', obj, function(res){
data.uploadTargetSrl = res.upload_target_srl;
editorRelKeys[self.$container.data('editor-sequence')].primary.value = res.upload_target_srl;
data.uploadTargetSrl = res.uploadTargetSrl;
@ -312,6 +318,9 @@
return u;
};
xe.unregisterApp();
// Shortcut function in XE
// xe.createXeUploader = function(browseButton, opts) {
// var u = new XeUploader(browseButton, opts);

File diff suppressed because one or more lines are too long

View file

@ -29,7 +29,7 @@ define('__ZBXE__', __XE__);
/**
* Display XE's full version.
*/
define('__XE_VERSION__', '1.8.1');
define('__XE_VERSION__', '1.8.2');
define('__XE_VERSION_ALPHA__', (stripos(__XE_VERSION__, 'alpha') !== false));
define('__XE_VERSION_BETA__', (stripos(__XE_VERSION__, 'beta') !== false));
define('__XE_VERSION_RC__', (stripos(__XE_VERSION__, 'rc') !== false));

View file

@ -450,7 +450,7 @@
</div>
<div class="control-group">
<label class="chk_label" for="keepid_opt">
<input type="checkbox" name="keep_signed" id="keepid_opt" />
<input type="checkbox" name="keep_signed" id="keepid_opt" value="Y" />
<span class="checkbox"></span> {$lang->keep_signed}
</label>
<div id="warning">

View file

@ -1,4 +1,5 @@
var selected_node = null;
var files = [];
function getSlideShow() {
var node, $node, selected_images = '', width, style, align, border_color, bg_color, thickness;
@ -33,27 +34,23 @@ function getSlideShow() {
// 부모창의 업로드된 파일중 이미지 목록을 모두 가져와서 세팅
var fo = get_by_id("fo");
var editor_sequence = fo.editor_sequence.value;
var list_obj = get_by_id("image_list");
var parent_list_obj = opener.get_by_id("uploaded_file_list_"+editor_sequence);
if(parent_list_obj) {
jQuery.exec_json('file.getFileList', {'editor_sequence': editor_sequence}, function(res) {
jQuery.each(res.files, function (index, file) {
var file_srl = file.file_srl;
var list_obj = get_by_id("image_list");
for(var i=0;i<parent_list_obj.length;i++) {
var opt = parent_list_obj.options[i];
var file_srl = opt.value;
if(!file_srl) return;
var file_obj = opener.uploadedFiles[file_srl];
var filename = file_obj.download_url.replace(request_uri,'');
if((/(jpg|jpeg|gif|png)$/i).test(filename)) {
var filename = file.source_filename;
if(/\.(jpe?g|png|gif)$/i.test(filename)) {
var selected = false;
if(selected_images.indexOf(filename)!=-1) selected = true;
var opt = new Option(opt.text, opt.value, false, selected);
var opt = new Option(file.source_filename, file_srl, false, selected);
list_obj.options.add(opt);
files[file.file_srl] = file;
}
}
}
});
});
}
function insertSlideShow() {
@ -65,7 +62,7 @@ function insertSlideShow() {
var opt = list_obj.options[i];
if(opt.selected) {
var file_srl = opt.value;
var file_obj = opener.uploadedFiles[file_srl];
var file_obj = files[file_srl];
var filename = file_obj.download_url.replace(request_uri,'');
list[list.length] = filename;
}

View file

@ -1 +1 @@
function getSlideShow(){var a,b,c,d,e,f,g,h,i="";if("undefined"!=typeof opener){a=opener.editorPrevNode,b=jQuery(a),b.is("img")&&(selected_node=a,c=b.width(),d=b.attr("gallery_style"),e=b.attr("gallery_align")||"center",f=b.attr("border_color"),g=b.attr("bg_color"),h=b.attr("border_thickness")||1,get_by_id("width").value=c,get_by_id("gallery_style").selectedIndex="list"==d?1:0,get_by_id("gallery_align").selectedIndex="left"==e?1:"right"==e?2:0,get_by_id("border_thickness").value=h,get_by_id("border_color_input").value=f,get_by_id("bg_color_input").value=g,i=b.attr("images_list"));var j=get_by_id("fo"),k=j.editor_sequence.value,l=opener.get_by_id("uploaded_file_list_"+k);if(l)for(var m=get_by_id("image_list"),n=0;n<l.length;n++){var o=l.options[n],p=o.value;if(!p)return;var q=opener.uploadedFiles[p],r=q.download_url.replace(request_uri,"");if(/(jpg|jpeg|gif|png)$/i.test(r)){var s=!1;-1!=i.indexOf(r)&&(s=!0);var o=new Option(o.text,o.value,!1,s);m.options.add(o)}}}}function insertSlideShow(){if("undefined"!=typeof opener){for(var a=new Array,b=get_by_id("image_list"),c=0;c<b.length;c++){var d=b.options[c];if(d.selected){var e=d.value,f=opener.uploadedFiles[e],g=f.download_url.replace(request_uri,"");a[a.length]=g}}if(!a.length)return void window.close();for(var h=get_by_id("width").value,i=get_by_id("gallery_style").options[get_by_id("gallery_style").selectedIndex].value,j=get_by_id("gallery_align").options[get_by_id("gallery_align").selectedIndex].value,k=get_by_id("border_thickness").value,l=get_by_id("border_color_input").value,m=get_by_id("bg_color_input").value,n="",c=0;c<a.length;c++)n+=a[c].trim()+" ";if(selected_node)selected_node.setAttribute("width",h),selected_node.setAttribute("gallery_style",i),selected_node.setAttribute("align",j),selected_node.setAttribute("gallery_align",j),selected_node.setAttribute("border_thickness",k),selected_node.setAttribute("border_color",l),selected_node.setAttribute("bg_color",m),selected_node.setAttribute("images_list",n),selected_node.style.width=h+"px";else{var o='<img src="../../../../common/img/blank.gif" editor_component="image_gallery" width="'+h+'" gallery_style="'+i+'" align="'+j+'" gallery_align="'+j+'" border_thickness="'+k+'" border_color="'+l+'" bg_color="'+m+'" style="width:'+h+'px;border:2px dotted #4371B9;background:url(./modules/editor/components/image_gallery/tpl/image_gallery_component.gif) no-repeat center;" images_list="'+n+'" />';opener.editorFocus(opener.editorPrevSrl);var p=opener.editorGetIFrame(opener.editorPrevSrl);opener.editorReplaceHTML(p,o)}opener.editorFocus(opener.editorPrevSrl),window.close()}}function select_color(a,b){get_by_id(a+"_preview_color").style.backgroundColor="#"+b,get_by_id(a+"_color_input").value=b}var selected_node=null;jQuery(function(){getSlideShow()});
function getSlideShow(){var a,b,c,d,e,f,g,h,i="";if("undefined"!=typeof opener){a=opener.editorPrevNode,b=jQuery(a),b.is("img")&&(selected_node=a,c=b.width(),d=b.attr("gallery_style"),e=b.attr("gallery_align")||"center",f=b.attr("border_color"),g=b.attr("bg_color"),h=b.attr("border_thickness")||1,get_by_id("width").value=c,get_by_id("gallery_style").selectedIndex="list"==d?1:0,get_by_id("gallery_align").selectedIndex="left"==e?1:"right"==e?2:0,get_by_id("border_thickness").value=h,get_by_id("border_color_input").value=f,get_by_id("bg_color_input").value=g,i=b.attr("images_list"));var j=get_by_id("fo"),k=j.editor_sequence.value,l=get_by_id("image_list");jQuery.exec_json("file.getFileList",{editor_sequence:k},function(a){jQuery.each(a.files,function(a,b){var c=b.file_srl;if(c){var d=b.source_filename;if(/\.(jpe?g|png|gif)$/i.test(d)){var e=!1;-1!=i.indexOf(d)&&(e=!0);var f=new Option(b.source_filename,c,!1,e);l.options.add(f),files[b.file_srl]=b}}})})}}function insertSlideShow(){if("undefined"!=typeof opener){for(var a=new Array,b=get_by_id("image_list"),c=0;c<b.length;c++){var d=b.options[c];if(d.selected){var e=d.value,f=files[e],g=f.download_url.replace(request_uri,"");a[a.length]=g}}if(!a.length)return void window.close();for(var h=get_by_id("width").value,i=get_by_id("gallery_style").options[get_by_id("gallery_style").selectedIndex].value,j=get_by_id("gallery_align").options[get_by_id("gallery_align").selectedIndex].value,k=get_by_id("border_thickness").value,l=get_by_id("border_color_input").value,m=get_by_id("bg_color_input").value,n="",c=0;c<a.length;c++)n+=a[c].trim()+" ";if(selected_node)selected_node.setAttribute("width",h),selected_node.setAttribute("gallery_style",i),selected_node.setAttribute("align",j),selected_node.setAttribute("gallery_align",j),selected_node.setAttribute("border_thickness",k),selected_node.setAttribute("border_color",l),selected_node.setAttribute("bg_color",m),selected_node.setAttribute("images_list",n),selected_node.style.width=h+"px";else{var o='<img src="../../../../common/img/blank.gif" editor_component="image_gallery" width="'+h+'" gallery_style="'+i+'" align="'+j+'" gallery_align="'+j+'" border_thickness="'+k+'" border_color="'+l+'" bg_color="'+m+'" style="width:'+h+'px;border:2px dotted #4371B9;background:url(./modules/editor/components/image_gallery/tpl/image_gallery_component.gif) no-repeat center;" images_list="'+n+'" />';opener.editorFocus(opener.editorPrevSrl);var p=opener.editorGetIFrame(opener.editorPrevSrl);opener.editorReplaceHTML(p,o)}opener.editorFocus(opener.editorPrevSrl),window.close()}}function select_color(a,b){get_by_id(a+"_preview_color").style.backgroundColor="#"+b,get_by_id(a+"_color_input").value=b}var selected_node=null,files=[];jQuery(function(){getSlideShow()});

View file

@ -57,7 +57,7 @@
var self = this;
var $containerEl = containerEl;
var $form = $containerEl.closest('form');
var $contentField = opts.content_field;
var $contentField = $form.find(opts.content_field);
var data = $containerEl.data();
var editor_sequence = $containerEl.data().editorSequence;
@ -65,7 +65,7 @@
this.editor_sequence = data.editorSequence;
$form.attr('editor_sequence', data.editorSequence);
if(CKEDITOR.env.mobile) CKEDITOR.env.isCompatible = true;
var instance = CKEDITOR.appendTo($containerEl[0], {}, $contentField.val());

View file

@ -1 +1 @@
!function(a){"use strict";function b(b){return a.grep(b,function(c,d){return c.length&&a.inArray(c,b)===d})}var c={bodyClass:"xe_content editable",toolbarCanCollapse:!0,toolbarGroups:[{name:"clipboard",groups:["undo","clipboard"]},{name:"editing",groups:["find","selection"]},{name:"links"},{name:"insert"},{name:"tools"},{name:"document",groups:["mode"]},"/",{name:"basicstyles",groups:["basicstyles","cleanup"]},{name:"paragraph",groups:["list","indent","blocks","align","bidi"]},"/",{name:"styles"},{name:"colors"},{name:"xecomponent"},{name:"others"}],allowedContent:!0,removePlugins:"stylescombo,language,bidi,flash,pagebreak",removeButtons:"Save,Preview,Print,Cut,Copy,Paste",uiColor:"#EFF0F0"},d=xe.createApp("XeCkEditor",{ckeconfig:{},editor_sequence:null,init:function(){var a=this;CKEDITOR.on("instanceCreated",function(){a.cast("CKEDITOR_CREATED")}),CKEDITOR.on("ready",function(){a.cast("CKEDITOR_READY")}),CKEDITOR.on("instanceReady",function(){a.cast("CKEDITOR_INSTANCE_READY")}),CKEDITOR.on("instanceLoaded",function(){a.cast("CKEDITOR_LOADED")})},editorInit:function(d,e){{var f=this,g=d,h=g.closest("form"),i=e.content_field,j=g.data();g.data().editorSequence}this.ckeconfig=a.extend({},c,e.ckeconfig||{}),this.editor_sequence=j.editorSequence,h.attr("editor_sequence",j.editorSequence),CKEDITOR.env.mobile&&(CKEDITOR.env.isCompatible=!0);var k=CKEDITOR.appendTo(g[0],{},i.val());k.on("customConfigLoaded",function(d){if(k.config=a.extend({},d.editor.config,f.ckeconfig),a.isFunction(CKEDITOR.editorConfig)){var g={};CKEDITOR.editorConfig(g),a.each(g,function(a,b){k.config[a]=b})}var h=d.editor.config.bodyClass.split(" ");if(h.push(c.bodyClass),h=b(h),k.config.bodyClass=h.join(" "),e.loadXeComponent){var i=d.editor.config.extraPlugins.split(",");i.push("xe_component"),i=b(i),k.config.extraPlugins=i.join(",")}e.enableToolbar||(k.config.toolbar=[])}),g.data("cke_instance",k),window.editorRelKeys[j.editorSequence]={},window.editorRelKeys[j.editorSequence].primary=h.find("[name="+j.editorPrimaryKeyName+"]")[0],window.editorRelKeys[j.editorSequence].content=h.find("[name="+j.editorContentKeyName+"]")[0],window.editorRelKeys[j.editorSequence].func=function(a){return f.getContent.call(f,a)},window.editorRelKeys[j.editorSequence].pasteHTML=function(a){k.insertHtml(a,"html")}},getContent:function(a){var b=this,c=_getCkeInstance(a).getData();return b.cast("GET_CONTENT",[c]),c},getInstance:function(a){return CKEDITOR.instances[a]},API_EDITOR_CREATED:function(){}});a.fn.XeCkEditor=function(a){var b=new d(this.eq(0),a);return b&&(xe.registerApp(b),b.editorInit(this.eq(0),a)),b},window.xe.XeCkEditor=function(){var a=new d;return a}}(jQuery);
!function(a){"use strict";function b(b){return a.grep(b,function(c,d){return c.length&&a.inArray(c,b)===d})}var c={bodyClass:"xe_content editable",toolbarCanCollapse:!0,toolbarGroups:[{name:"clipboard",groups:["undo","clipboard"]},{name:"editing",groups:["find","selection"]},{name:"links"},{name:"insert"},{name:"tools"},{name:"document",groups:["mode"]},"/",{name:"basicstyles",groups:["basicstyles","cleanup"]},{name:"paragraph",groups:["list","indent","blocks","align","bidi"]},"/",{name:"styles"},{name:"colors"},{name:"xecomponent"},{name:"others"}],allowedContent:!0,removePlugins:"stylescombo,language,bidi,flash,pagebreak",removeButtons:"Save,Preview,Print,Cut,Copy,Paste",uiColor:"#EFF0F0"},d=xe.createApp("XeCkEditor",{ckeconfig:{},editor_sequence:null,init:function(){var a=this;CKEDITOR.on("instanceCreated",function(){a.cast("CKEDITOR_CREATED")}),CKEDITOR.on("ready",function(){a.cast("CKEDITOR_READY")}),CKEDITOR.on("instanceReady",function(){a.cast("CKEDITOR_INSTANCE_READY")}),CKEDITOR.on("instanceLoaded",function(){a.cast("CKEDITOR_LOADED")})},editorInit:function(d,e){{var f=this,g=d,h=g.closest("form"),i=h.find(e.content_field),j=g.data();g.data().editorSequence}this.ckeconfig=a.extend({},c,e.ckeconfig||{}),this.editor_sequence=j.editorSequence,h.attr("editor_sequence",j.editorSequence),CKEDITOR.env.mobile&&(CKEDITOR.env.isCompatible=!0);var k=CKEDITOR.appendTo(g[0],{},i.val());k.on("customConfigLoaded",function(d){if(k.config=a.extend({},d.editor.config,f.ckeconfig),a.isFunction(CKEDITOR.editorConfig)){var g={};CKEDITOR.editorConfig(g),a.each(g,function(a,b){k.config[a]=b})}var h=d.editor.config.bodyClass.split(" ");if(h.push(c.bodyClass),h=b(h),k.config.bodyClass=h.join(" "),e.loadXeComponent){var i=d.editor.config.extraPlugins.split(",");i.push("xe_component"),i=b(i),k.config.extraPlugins=i.join(",")}e.enableToolbar||(k.config.toolbar=[])}),g.data("cke_instance",k),window.editorRelKeys[j.editorSequence]={},window.editorRelKeys[j.editorSequence].primary=h.find("[name="+j.editorPrimaryKeyName+"]")[0],window.editorRelKeys[j.editorSequence].content=h.find("[name="+j.editorContentKeyName+"]")[0],window.editorRelKeys[j.editorSequence].func=function(a){return f.getContent.call(f,a)},window.editorRelKeys[j.editorSequence].pasteHTML=function(a){k.insertHtml(a,"html")}},getContent:function(a){var b=this,c=_getCkeInstance(a).getData();return b.cast("GET_CONTENT",[c]),c},getInstance:function(a){return CKEDITOR.instances[a]},API_EDITOR_CREATED:function(){}});a.fn.XeCkEditor=function(a){var b=new d(this.eq(0),a);return b&&(xe.registerApp(b),b.editorInit(this.eq(0),a)),b},window.xe.XeCkEditor=function(){var a=new d;return a}}(jQuery);

View file

@ -26,8 +26,7 @@ class fileController extends file
function procFileUpload()
{
Context::setRequestMethod('JSON');
$file_info = Context::get('Filedata');
$file_info = $_FILES['Filedata'];
// An error appears if not a normally uploaded file
if(!is_uploaded_file($file_info['tmp_name'])) exit();

View file

@ -1650,9 +1650,10 @@ class memberController extends member
$do_auto_login = false;
// Compare key values based on the information
$key = md5($user_id . $password . $_SERVER['HTTP_USER_AGENT']);
$check_key = strtolower($user_id).$password.$_SERVER['HTTP_USER_AGENT'];
$check_key = substr(hash_hmac('sha256', $check_key, substr($args->autologin_key, 0, 32)), 0, 32);
if($key == $args->autologin_key)
if($check_key === substr($args->autologin_key, 32))
{
// Check change_password_date
$oModuleModel = getModel('module');
@ -1837,8 +1838,12 @@ class memberController extends member
if($keep_signed)
{
// Key generate for auto login
$oPassword = new Password();
$random_key = $oPassword->createSecureSalt(32, 'hex');
$extra_key = strtolower($user_id).$this->memberInfo->password.$_SERVER['HTTP_USER_AGENT'];
$extra_key = substr(hash_hmac('sha256', $extra_key, $random_key), 0, 32);
$autologin_args = new stdClass;
$autologin_args->autologin_key = md5(strtolower($user_id).$this->memberInfo->password.$_SERVER['HTTP_USER_AGENT']);
$autologin_args->autologin_key = $random_key.$extra_key;
$autologin_args->member_srl = $this->memberInfo->member_srl;
executeQuery('member.deleteAutologin', $autologin_args);
$autologin_output = executeQuery('member.insertAutologin', $autologin_args);

View file

@ -0,0 +1,28 @@
class_name: InstallTester
modules:
enabled: [Db, PhpBrowser, DbDropTablesHelper, InstallHelper]
config:
PhpBrowser:
url: 'http://localhost:8000/'
DbDropTablesHelper:
dsn: 'mysql:host=127.0.0.1;dbname=xe_test'
user: 'root'
password: 'root'
Db:
dsn: 'mysql:host=127.0.0.1;dbname=xe_test'
user: 'root'
password: 'root'
cleanup: true
env:
travis:
modules:
config:
Db:
dsn: 'mysql:host=127.0.0.1;dbname=xe_test'
user: 'travis'
password: 'travis'
cleanup: true
DbDropTablesHelper:
dsn: 'mysql:host=127.0.0.1;dbname=xe_test'
user: 'travis'
password: 'travis'

View file

@ -3,13 +3,13 @@ use \Codeception\Configuration;
$I = new InstallTester($scenario);
$config = (!$this->env) ? Configuration::config() : Configuration::suiteEnvironments('install')[$this->env];
$config = (!$this->env) ? Configuration::suiteSettings('Install', Configuration::config()) : Configuration::suiteEnvironments('Install')[$this->env];
$db_config = $config['modules']['config']['Db'];
$dsn = $db_config['dsn'];
$dsn = split('[;:]', $dsn);
$db_type = array_shift($dsn);
$dbinfo = [
'type' => $db_type,
'user' => $db_config['user'],
@ -17,7 +17,6 @@ $dbinfo = [
'dbname' => 'xe_install',
'port' => ((isset($db_config['port']) && $db_config['port'])?: 3306),
];
foreach($dsn as $piece) {
list($key, $val) = explode('=', $piece);
$dbinfo[$key] = $val;

View file

@ -1,12 +1,14 @@
<?php //[STAMP] 91974ab12b2894dae8d1464cac50fa5d
<?php //[STAMP] 8e0df11a46642efe1cdbcd6ea0a22ad0
// This class was automatically generated by build task
// You should not change it manually as it will be overwritten on next build
// @codingStandardsIgnoreFile
use Codeception\Module\Db;
use Codeception\Module\PhpBrowser;
use Codeception\Module\installHelper;
use Codeception\Module\DbDropTablesHelper;
use Codeception\Module\InstallHelper;
/**
* Inherited Methods
@ -26,6 +28,174 @@ use Codeception\Module\installHelper;
class InstallTester extends \Codeception\Actor
{
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Inserts SQL record into database. This record will be erased after the test.
*
* ``` php
* <?php
* $I->haveInDatabase('users', array('name' => 'miles', 'email' => 'miles@davis.com'));
* ?>
* ```
*
* @param $table
* @param array $data
*
* @return integer $id
* @see \Codeception\Module\Db::haveInDatabase()
*/
public function haveInDatabase($table, $data) {
return $this->scenario->runStep(new \Codeception\Step\Action('haveInDatabase', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks if a row with given column values exists.
* Provide table name and column values.
*
* Example:
*
* ``` php
* <?php
* $I->seeInDatabase('users', array('name' => 'Davert', 'email' => 'davert@mail.com'));
*
* ```
* Will generate:
*
* ``` sql
* SELECT COUNT(*) FROM `users` WHERE `name` = 'Davert' AND `email` = 'davert@mail.com'
* ```
* Fails if no such user found.
*
* @param $table
* @param array $criteria
* Conditional Assertion: Test won't be stopped on fail
* @see \Codeception\Module\Db::seeInDatabase()
*/
public function canSeeInDatabase($table, $criteria = null) {
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeInDatabase', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks if a row with given column values exists.
* Provide table name and column values.
*
* Example:
*
* ``` php
* <?php
* $I->seeInDatabase('users', array('name' => 'Davert', 'email' => 'davert@mail.com'));
*
* ```
* Will generate:
*
* ``` sql
* SELECT COUNT(*) FROM `users` WHERE `name` = 'Davert' AND `email` = 'davert@mail.com'
* ```
* Fails if no such user found.
*
* @param $table
* @param array $criteria
* @see \Codeception\Module\Db::seeInDatabase()
*/
public function seeInDatabase($table, $criteria = null) {
return $this->scenario->runStep(new \Codeception\Step\Assertion('seeInDatabase', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Effect is opposite to ->seeInDatabase
*
* Checks if there is no record with such column values in database.
* Provide table name and column values.
*
* Example:
*
* ``` php
* <?php
* $I->dontSeeInDatabase('users', array('name' => 'Davert', 'email' => 'davert@mail.com'));
*
* ```
* Will generate:
*
* ``` sql
* SELECT COUNT(*) FROM `users` WHERE `name` = 'Davert' AND `email` = 'davert@mail.com'
* ```
* Fails if such user was found.
*
* @param $table
* @param array $criteria
* Conditional Assertion: Test won't be stopped on fail
* @see \Codeception\Module\Db::dontSeeInDatabase()
*/
public function cantSeeInDatabase($table, $criteria = null) {
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInDatabase', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Effect is opposite to ->seeInDatabase
*
* Checks if there is no record with such column values in database.
* Provide table name and column values.
*
* Example:
*
* ``` php
* <?php
* $I->dontSeeInDatabase('users', array('name' => 'Davert', 'email' => 'davert@mail.com'));
*
* ```
* Will generate:
*
* ``` sql
* SELECT COUNT(*) FROM `users` WHERE `name` = 'Davert' AND `email` = 'davert@mail.com'
* ```
* Fails if such user was found.
*
* @param $table
* @param array $criteria
* @see \Codeception\Module\Db::dontSeeInDatabase()
*/
public function dontSeeInDatabase($table, $criteria = null) {
return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeInDatabase', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Fetches a single column value from a database.
* Provide table name, desired column and criteria.
*
* Example:
*
* ``` php
* <?php
* $mail = $I->grabFromDatabase('users', 'email', array('name' => 'Davert'));
*
* ```
*
* @version 1.1
*
* @param $table
* @param $column
* @param array $criteria
*
* @return mixed
* @see \Codeception\Module\Db::grabFromDatabase()
*/
public function grabFromDatabase($table, $column, $criteria = null) {
return $this->scenario->runStep(new \Codeception\Step\Action('grabFromDatabase', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@ -1915,4 +2085,15 @@ class InstallTester extends \Codeception\Actor
public function dontSeeInTitle($title) {
return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeInTitle', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
*
* @see \Codeception\Module\DbDropTablesHelper::cleanup()
*/
public function cleanup() {
return $this->scenario->runStep(new \Codeception\Step\Action('cleanup', func_get_args()));
}
}

View file

@ -1,10 +0,0 @@
<?php
namespace Codeception\Module;
// here you can define custom actions
// all public methods declared in helper class will be available in $I
class AcceptanceHelper extends \Codeception\Module
{
}

View file

@ -0,0 +1,24 @@
<?php
namespace Codeception\Module;
class DbDropTablesHelper extends \Codeception\Module\Db
{
protected $requiredFields = [];
public function cleanup()
{
$dbh = $this->driver->getDbh();
if (!$dbh) {
throw new ModuleConfigException(
__CLASS__,
"No connection to database. Remove this module from config if you don't need database repopulation"
);
}
try {
$this->driver->cleanup();
} catch (\Exception $e) {
throw new ModuleException(__CLASS__, $e->getMessage());
}
}
}

View file

@ -1,10 +0,0 @@
<?php
namespace Codeception\Module;
// here you can define custom actions
// all public methods declared in helper class will be available in $I
class FunctionalHelper extends \Codeception\Module
{
}

View file

@ -1,7 +1,7 @@
<?php
namespace Codeception\Module;
class installHelper extends \Codeception\Module
class InstallHelper extends \Codeception\Module
{
public function _initialize()
{

View file

@ -1,8 +0,0 @@
class_name: AcceptanceTester
modules:
enabled:
- PhpBrowser
- AcceptanceHelper
config:
PhpBrowser:
url: 'http://localhost/'

File diff suppressed because it is too large Load diff

View file

@ -1,9 +0,0 @@
# Codeception Test Suite Configuration
# suite for functional (integration) tests.
# emulate web requests and make application process them.
# Include one of framework modules (Symfony2, Yii2, Laravel4) to use it.
class_name: FunctionalTester
modules:
enabled: [Filesystem, FunctionalHelper]

View file

@ -1,360 +0,0 @@
<?php //[STAMP] bdc43d9c472c8c86c136dc49b64a1a3a
// This class was automatically generated by build task
// You should not change it manually as it will be overwritten on next build
// @codingStandardsIgnoreFile
use Codeception\Module\Filesystem;
use Codeception\Module\FunctionalHelper;
/**
* Inherited Methods
* @method void wantToTest($text)
* @method void wantTo($text)
* @method void execute($callable)
* @method void expectTo($prediction)
* @method void expect($prediction)
* @method void amGoingTo($argumentation)
* @method void am($role)
* @method void lookForwardTo($achieveValue)
* @method void comment($description)
* @method void haveFriend($name, $actorClass = null)
*
* @SuppressWarnings(PHPMD)
*/
class FunctionalTester extends \Codeception\Actor
{
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Enters a directory In local filesystem.
* Project root directory is used by default
*
* @param $path
* @see \Codeception\Module\Filesystem::amInPath()
*/
public function amInPath($path) {
return $this->scenario->runStep(new \Codeception\Step\Condition('amInPath', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Opens a file and stores it's content.
*
* Usage:
*
* ``` php
* <?php
* $I->openFile('composer.json');
* $I->seeInThisFile('codeception/codeception');
* ?>
* ```
*
* @param $filename
* @see \Codeception\Module\Filesystem::openFile()
*/
public function openFile($filename) {
return $this->scenario->runStep(new \Codeception\Step\Action('openFile', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Deletes a file
*
* ``` php
* <?php
* $I->deleteFile('composer.lock');
* ?>
* ```
*
* @param $filename
* @see \Codeception\Module\Filesystem::deleteFile()
*/
public function deleteFile($filename) {
return $this->scenario->runStep(new \Codeception\Step\Action('deleteFile', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Deletes directory with all subdirectories
*
* ``` php
* <?php
* $I->deleteDir('vendor');
* ?>
* ```
*
* @param $dirname
* @see \Codeception\Module\Filesystem::deleteDir()
*/
public function deleteDir($dirname) {
return $this->scenario->runStep(new \Codeception\Step\Action('deleteDir', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Copies directory with all contents
*
* ``` php
* <?php
* $I->copyDir('vendor','old_vendor');
* ?>
* ```
*
* @param $src
* @param $dst
* @see \Codeception\Module\Filesystem::copyDir()
*/
public function copyDir($src, $dst) {
return $this->scenario->runStep(new \Codeception\Step\Action('copyDir', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks If opened file has `text` in it.
*
* Usage:
*
* ``` php
* <?php
* $I->openFile('composer.json');
* $I->seeInThisFile('codeception/codeception');
* ?>
* ```
*
* @param $text
* Conditional Assertion: Test won't be stopped on fail
* @see \Codeception\Module\Filesystem::seeInThisFile()
*/
public function canSeeInThisFile($text) {
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeInThisFile', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks If opened file has `text` in it.
*
* Usage:
*
* ``` php
* <?php
* $I->openFile('composer.json');
* $I->seeInThisFile('codeception/codeception');
* ?>
* ```
*
* @param $text
* @see \Codeception\Module\Filesystem::seeInThisFile()
*/
public function seeInThisFile($text) {
return $this->scenario->runStep(new \Codeception\Step\Assertion('seeInThisFile', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks the strict matching of file contents.
* Unlike `seeInThisFile` will fail if file has something more than expected lines.
* Better to use with HEREDOC strings.
* Matching is done after removing "\r" chars from file content.
*
* ``` php
* <?php
* $I->openFile('process.pid');
* $I->seeFileContentsEqual('3192');
* ?>
* ```
*
* @param $text
* Conditional Assertion: Test won't be stopped on fail
* @see \Codeception\Module\Filesystem::seeFileContentsEqual()
*/
public function canSeeFileContentsEqual($text) {
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeFileContentsEqual', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks the strict matching of file contents.
* Unlike `seeInThisFile` will fail if file has something more than expected lines.
* Better to use with HEREDOC strings.
* Matching is done after removing "\r" chars from file content.
*
* ``` php
* <?php
* $I->openFile('process.pid');
* $I->seeFileContentsEqual('3192');
* ?>
* ```
*
* @param $text
* @see \Codeception\Module\Filesystem::seeFileContentsEqual()
*/
public function seeFileContentsEqual($text) {
return $this->scenario->runStep(new \Codeception\Step\Assertion('seeFileContentsEqual', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks If opened file doesn't contain `text` in it
*
* ``` php
* <?php
* $I->openFile('composer.json');
* $I->dontSeeInThisFile('codeception/codeception');
* ?>
* ```
*
* @param $text
* Conditional Assertion: Test won't be stopped on fail
* @see \Codeception\Module\Filesystem::dontSeeInThisFile()
*/
public function cantSeeInThisFile($text) {
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeInThisFile', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks If opened file doesn't contain `text` in it
*
* ``` php
* <?php
* $I->openFile('composer.json');
* $I->dontSeeInThisFile('codeception/codeception');
* ?>
* ```
*
* @param $text
* @see \Codeception\Module\Filesystem::dontSeeInThisFile()
*/
public function dontSeeInThisFile($text) {
return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeInThisFile', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Deletes a file
* @see \Codeception\Module\Filesystem::deleteThisFile()
*/
public function deleteThisFile() {
return $this->scenario->runStep(new \Codeception\Step\Action('deleteThisFile', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks if file exists in path.
* Opens a file when it's exists
*
* ``` php
* <?php
* $I->seeFileFound('UserModel.php','app/models');
* ?>
* ```
*
* @param $filename
* @param string $path
* Conditional Assertion: Test won't be stopped on fail
* @see \Codeception\Module\Filesystem::seeFileFound()
*/
public function canSeeFileFound($filename, $path = null) {
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('seeFileFound', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks if file exists in path.
* Opens a file when it's exists
*
* ``` php
* <?php
* $I->seeFileFound('UserModel.php','app/models');
* ?>
* ```
*
* @param $filename
* @param string $path
* @see \Codeception\Module\Filesystem::seeFileFound()
*/
public function seeFileFound($filename, $path = null) {
return $this->scenario->runStep(new \Codeception\Step\Assertion('seeFileFound', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks if file does not exists in path
*
* @param $filename
* @param string $path
* Conditional Assertion: Test won't be stopped on fail
* @see \Codeception\Module\Filesystem::dontSeeFileFound()
*/
public function cantSeeFileFound($filename, $path = null) {
return $this->scenario->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeFileFound', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Checks if file does not exists in path
*
* @param $filename
* @param string $path
* @see \Codeception\Module\Filesystem::dontSeeFileFound()
*/
public function dontSeeFileFound($filename, $path = null) {
return $this->scenario->runStep(new \Codeception\Step\Assertion('dontSeeFileFound', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Erases directory contents
*
* ``` php
* <?php
* $I->cleanDir('logs');
* ?>
* ```
*
* @param $dirname
* @see \Codeception\Module\Filesystem::cleanDir()
*/
public function cleanDir($dirname) {
return $this->scenario->runStep(new \Codeception\Step\Action('cleanDir', func_get_args()));
}
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
* Saves contents to file
*
* @param $filename
* @param $contents
* @see \Codeception\Module\Filesystem::writeToFile()
*/
public function writeToFile($filename, $contents) {
return $this->scenario->runStep(new \Codeception\Step\Action('writeToFile', func_get_args()));
}
}

View file

@ -1,2 +0,0 @@
<?php
// Here you can initialize variables that will be available to your tests

View file

@ -1,17 +0,0 @@
class_name: InstallTester
modules:
enabled:
- PhpBrowser
- installHelper
config:
PhpBrowser:
url: 'http://localhost:8000/'
env:
travis:
modules:
config:
Db:
dsn: 'mysql:host=127.0.0.1;dbname=xe_test'
user: 'travis'
password: 'travis'
cleanup: true

View file

@ -1,5 +0,0 @@
<?php
// Here you can initialize variables that will be available to your tests
\Codeception\Util\Autoload::registerSuffix('Steps', __DIR__.DIRECTORY_SEPARATOR.'_steps');
\Codeception\Util\Autoload::registerSuffix('Page', __DIR__.DIRECTORY_SEPARATOR.'_pages');

View file

@ -1,41 +0,0 @@
<?php
class installPage
{
// include url of current page
public static $URL = '';
/**
* Declare UI map for this page here. CSS or XPath allowed.
* public static $usernameField = '#username';
* public static $formSubmitButton = "#mainForm input[type=submit]";
*/
/**
* Basic route example for your current URL
* You can append any additional parameter to URL
* and use it in tests like: EditPage::route('/123-post');
*/
public static function route($param)
{
return static::$URL.$param;
}
/**
* @var InstallTester;
*/
protected $installTester;
public function __construct(InstallTester $I)
{
$this->installTester = $I;
}
/**
* @return installPage
*/
public static function of(InstallTester $I)
{
return new static($I);
}
}

View file

@ -1,18 +0,0 @@
<?php
namespace InstallTester;
class AdminSteps extends \InstallTester
{
public function login()
{
$I = $this;
}
public function adminLogin()
{
$I = $this;
}
public function logout()
{
$I = $this;
}
}