mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-03 08:41:39 +09:00
Merge branch 'rhymix:master' into master
This commit is contained in:
commit
0598ae4b95
23 changed files with 132 additions and 63 deletions
|
|
@ -624,7 +624,8 @@ class FrontEndFileHandler extends Handler
|
|||
{
|
||||
$url .= '?t=' . filemtime($file->fileFullPath);
|
||||
}
|
||||
$result[] = array('file' => $url);
|
||||
$attrs = empty($file->jstype) ? '' : (' type="' . $file->jstype . '"');
|
||||
$result[] = array('file' => $url, 'attrs' => $attrs);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -642,7 +643,7 @@ class FrontEndFileHandler extends Handler
|
|||
Rhymix\Framework\Storage::write(\RX_BASEDIR . $concat_filename, $concat_content);
|
||||
}
|
||||
$concat_filename .= '?t=' . filemtime(\RX_BASEDIR . $concat_filename);
|
||||
$result[] = array('file' => \RX_BASEURL . $concat_filename);
|
||||
$result[] = array('file' => \RX_BASEURL . $concat_filename, 'attrs' => '');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -235,7 +235,7 @@ class ModuleObject extends BaseObject
|
|||
catch (Rhymix\Framework\Exception $e)
|
||||
{
|
||||
$this->stop($e->getMessage(), -2);
|
||||
$this->add('rx_error_location', $e->getFile() . ':' . $e->getLine());
|
||||
$this->add('rx_error_location', $e->getUserFileAndLine());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -857,8 +857,7 @@ class ModuleObject extends BaseObject
|
|||
catch (Rhymix\Framework\Exception $e)
|
||||
{
|
||||
$output = new BaseObject(-2, $e->getMessage());
|
||||
$location = $e->getFile() . ':' . $e->getLine();
|
||||
$output->add('rx_error_location', $location);
|
||||
$output->add('rx_error_location', $e->getUserFileAndLine());
|
||||
}
|
||||
|
||||
// Trigger after specific action
|
||||
|
|
|
|||
|
|
@ -389,8 +389,8 @@ class Validator
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the last error infomation including a field name and an error message.
|
||||
* @return array The last error infomation
|
||||
* Returns the last error information including a field name and an error message.
|
||||
* @return array The last error information
|
||||
*/
|
||||
function getLastError()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
/**
|
||||
* RX_VERSION is the version number of the Rhymix CMS.
|
||||
*/
|
||||
define('RX_VERSION', '2.1.25');
|
||||
define('RX_VERSION', '2.1.26');
|
||||
|
||||
/**
|
||||
* RX_MICROTIME is the startup time of the current script, in microseconds since the Unix epoch.
|
||||
|
|
|
|||
|
|
@ -1113,29 +1113,43 @@ class DB
|
|||
*/
|
||||
public function addPrefixes(string $query_string): string
|
||||
{
|
||||
// Return early if no prefix is set.
|
||||
if (!$this->_prefix)
|
||||
{
|
||||
return $query_string;
|
||||
}
|
||||
|
||||
// Generate a list of common table expressions (CTEs) to exclude from prefixing.
|
||||
if (preg_match_all('/\bWITH(?:\s+RECURSIVE)?\s+`?(\w+)`?\s+AS\b/', $query_string, $matches))
|
||||
{
|
||||
$exceptions = $matches[1];
|
||||
}
|
||||
else
|
||||
{
|
||||
return preg_replace_callback('/((?:DELETE\s+)?FROM|JOIN|INTO|UPDATE)(?i)\s+((?:`?\w+\`?)(?:\s+AS\s+`?\w+`?)?(?:\s*,\s*(?:`?\w+\`?)(?:\s+AS\s+`?\w+`?)?)*)/', function($m) {
|
||||
$type = strtoupper($m[1]);
|
||||
$tables = array_map(function($str) use($type) {
|
||||
return preg_replace_callback('/`?(\w+)`?(?:\s+AS\s+`?(\w+)`?)?/i', function($m) use($type) {
|
||||
if ($type === 'FROM' || $type === 'JOIN')
|
||||
{
|
||||
return isset($m[2]) ? sprintf('`%s%s` AS `%s`', $this->_prefix, $m[1], $m[2]) : sprintf('`%s%s` AS `%s`', $this->_prefix, $m[1], $m[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
return isset($m[2]) ? sprintf('`%s%s` AS `%s`', $this->_prefix, $m[1], $m[2]) : sprintf('`%s%s`', $this->_prefix, $m[1]);
|
||||
}
|
||||
}, trim($str));
|
||||
}, explode(',', $m[2]));
|
||||
return $m[1] . ' ' . implode(', ', $tables);
|
||||
}, $query_string);
|
||||
$exceptions = [];
|
||||
}
|
||||
|
||||
// Add prefixes to all other table names in the query string.
|
||||
return preg_replace_callback('/\b((?:DELETE\s+)?FROM|JOIN|INTO|(?<!KEY\s)UPDATE)(?i)\s+((?:`?\w+`?)(?:\s+AS\s+`?\w+`?)?(?:\s*,\s*(?:`?\w+\`?)(?:\s+AS\s+`?\w+`?)?)*)/', function($m) use($exceptions) {
|
||||
$type = strtoupper($m[1]);
|
||||
$tables = array_map(function($str) use($type, $exceptions) {
|
||||
return preg_replace_callback('/`?(\w+)`?(?:\s+AS\s+`?(\w+)`?)?/i', function($m) use($type, $exceptions) {
|
||||
if (count($exceptions) && in_array($m[1], $exceptions))
|
||||
{
|
||||
return isset($m[2]) ? sprintf('`%s` AS `%s`', $m[1], $m[2]) : sprintf('`%s`', $m[1]);
|
||||
}
|
||||
elseif ($type === 'FROM' || $type === 'JOIN')
|
||||
{
|
||||
return isset($m[2]) ? sprintf('`%s%s` AS `%s`', $this->_prefix, $m[1], $m[2]) : sprintf('`%s%s` AS `%s`', $this->_prefix, $m[1], $m[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
return isset($m[2]) ? sprintf('`%s%s` AS `%s`', $this->_prefix, $m[1], $m[2]) : sprintf('`%s%s`', $this->_prefix, $m[1]);
|
||||
}
|
||||
}, trim($str));
|
||||
}, explode(',', $m[2]));
|
||||
return $m[1] . ' ' . implode(', ', $tables);
|
||||
}, $query_string);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1254,7 +1268,7 @@ class DB
|
|||
if (isset($backtrace[$no]))
|
||||
{
|
||||
$result['called_method'] = ($backtrace[$no]['class'] ?? '') . ($backtrace[$no]['type'] ?? '') . ($backtrace[$no]['function'] ?? '');
|
||||
$result['backtrace'] = $this->_debug_full_stack ? array_slice($backtrace, $no) : [];
|
||||
$result['backtrace'] = $this->_debug_full_stack ? array_slice($backtrace, $no - 1) : [];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,5 +7,27 @@ namespace Rhymix\Framework;
|
|||
*/
|
||||
class Exception extends \Exception
|
||||
{
|
||||
/**
|
||||
* Get the file and line, skipping Rhymix framework files.
|
||||
*
|
||||
* This can be more helpful than just using getFile() and getLine()
|
||||
* when the exception is thrown from a Rhymix framework file
|
||||
* but the actual error is caused by a module or theme.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUserFileAndLine(): string
|
||||
{
|
||||
$regexp = '!^' . preg_quote(\RX_BASEDIR, '!') . '(?:classes|common)/!';
|
||||
$trace = $this->getTrace();
|
||||
foreach ($trace as $frame)
|
||||
{
|
||||
if (!preg_match($regexp, $frame['file']))
|
||||
{
|
||||
return $frame['file'] . ':' . $frame['line'];
|
||||
}
|
||||
}
|
||||
|
||||
return $this->getFile() . ':' . $this->getLine();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ $(function() {
|
|||
if (data.queries[i].backtrace && data.queries[i].backtrace.length) {
|
||||
backtrace = $('<ul></ul>').appendTo(description.find('li:first-child'));
|
||||
for (j in data.queries[i].backtrace) {
|
||||
if (data.queries[i].backtrace[j].file) {
|
||||
if (j > 0 && data.queries[i].backtrace[j].file) {
|
||||
backtrace.append($('<li></li>').text(data.queries[i].backtrace[j].file + ":" + data.queries[i].backtrace[j].line));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ Database Queries
|
|||
echo sprintf(' - Call Stack: %s', $query_caller) . ($query->count > 1 ? (' (×' . $query->count . ')') : '') . "\n";
|
||||
foreach ($query->backtrace ?? [] as $key => $backtrace)
|
||||
{
|
||||
if (isset($backtrace['file']) && isset($backtrace['line']))
|
||||
if ($key > 0 && isset($backtrace['file']) && isset($backtrace['line']))
|
||||
{
|
||||
echo sprintf(' %s line %d', $backtrace['file'], $backtrace['line']) . "\n";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -310,8 +310,6 @@
|
|||
.x input.x_full-width,
|
||||
.x textarea.x_full-width,
|
||||
.x .x_uneditable-input.x_full-width{width:calc(100% - 14px);resize:vertical}
|
||||
.x textarea.x_full-width.lang_code{width:calc(100% - 42px);resize:vertical}
|
||||
.x textarea.x_full-width + textarea.lang_code{width:calc(100% - 42px);resize:vertical}
|
||||
.x textarea{height:auto;min-height:80px;}
|
||||
.x textarea,
|
||||
.x input[type="text"],
|
||||
|
|
|
|||
|
|
@ -1476,6 +1476,20 @@ margin-bottom: 10px;
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
.x .g11n.x_input-append {
|
||||
display: inline-flex;
|
||||
align-items: flex-start;
|
||||
}
|
||||
.x .g11n.x_full-width {
|
||||
width: 100%;
|
||||
}
|
||||
.x .g11n > input.lang_code,
|
||||
.x .g11n > textarea.lang_code {
|
||||
flex: 1;
|
||||
width: unset;
|
||||
min-width: 0;
|
||||
}
|
||||
.x .g11n>.x_add-on {
|
||||
font-size: 0;
|
||||
position: relative;
|
||||
|
|
@ -1492,8 +1506,9 @@ margin-bottom: 10px;
|
|||
}
|
||||
.x .g11n>.x_add-on.remover {
|
||||
display: none;
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
height: 16px;
|
||||
padding: 4px;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
.x .g11n.active>[disabled] {
|
||||
padding-left: 25px;
|
||||
|
|
@ -1501,7 +1516,7 @@ margin-bottom: 10px;
|
|||
background-repeat: no-repeat;
|
||||
}
|
||||
.x .g11n.active>.x_add-on.remover {
|
||||
display: inline-block;
|
||||
display: block;
|
||||
}
|
||||
.x .g11n>.x_add-on:hover>i {
|
||||
opacity: 1;
|
||||
|
|
|
|||
|
|
@ -367,7 +367,17 @@ jQuery(function($){
|
|||
$.fn.tableSpan = function(){
|
||||
this.each(function(){
|
||||
var $this = $(this);
|
||||
var thNum = $this.find('>thead>tr:eq(0)>th').length;
|
||||
var thList = $this.find('>thead>tr:eq(0)>th');
|
||||
var thNum = 0;
|
||||
thList.each(function(){
|
||||
var $th = $(this);
|
||||
if($th.attr('colspan')){ // th의 colspan 반영
|
||||
thNum += parseInt($th.attr('colspan'), 10);
|
||||
} else {
|
||||
thNum++;
|
||||
}
|
||||
});
|
||||
|
||||
var $tdTarget = $this.find('>tbody>tr:eq(0)>td:only-child');
|
||||
if(thNum != $tdTarget.attr('colspan')){
|
||||
$tdTarget.attr('colspan', thNum).css('text-align','center');
|
||||
|
|
@ -1906,6 +1916,7 @@ jQuery(function($){
|
|||
|
||||
// make UI
|
||||
var $this = $(this);
|
||||
var width = $this.width();
|
||||
var t = this;
|
||||
|
||||
if($this.parent().hasClass('g11n')){
|
||||
|
|
@ -1923,13 +1934,12 @@ jQuery(function($){
|
|||
|
||||
function makeUI(){
|
||||
var $multilingualWindow = $('#g11n');
|
||||
var width = $this.width();
|
||||
var $displayInput;
|
||||
|
||||
if(t.tagName == 'TEXTAREA' || $this.data('type') == 'textarea'){
|
||||
$displayInput = $('<textarea id="lang_' + id + '" class="lang_code" style="width:' + width + 'px" data-width="' + width + '">').data('lang-id', id);
|
||||
$displayInput = $('<textarea id="lang_' + id + '" class="lang_code">').data('lang-id', id);
|
||||
}else{
|
||||
$displayInput = $('<input type="text" id="lang_' + id + '" class="lang_code" style="width:' + (width-28) + 'px" data-width="' + (width-28) + '">').data('lang-id', id);
|
||||
$displayInput = $('<input type="text" id="lang_' + id + '" class="lang_code">').data('lang-id', id);
|
||||
}
|
||||
$displayInput.attr('placeholder', $this.attr('placeholder'));
|
||||
|
||||
|
|
@ -1937,20 +1947,18 @@ jQuery(function($){
|
|||
var $setter = $('<a href="#g11n" class="x_add-on modalAnchor" title="' + xe.lang.cmd_set_multilingual_text + '"><i class="x_icon-globe"></i>' + xe.lang.cmd_set_multilingual_text + '</a>').data('lang-target', id);
|
||||
|
||||
$this.parent().addClass('g11n').addClass('x_input-append');
|
||||
if ($this.hasClass('x_full-width')) {
|
||||
$this.parent().addClass('x_full-width');
|
||||
} else if (width) {
|
||||
$this.parent().width(Math.max(220, width + 14));
|
||||
}
|
||||
$this.after($displayInput, $remover, $setter);
|
||||
$this.hide();
|
||||
$setter.attr('href', '#g11n').xeModalWindow();
|
||||
|
||||
// bind selected
|
||||
$displayInput.bind('selected.g11n', function(e, code, value){
|
||||
var width = $displayInput.width();
|
||||
|
||||
if(!$displayInput.data('active')){
|
||||
width -= 44;
|
||||
}
|
||||
|
||||
$displayInput
|
||||
.width(width)
|
||||
.attr('disabled', 'disabled')
|
||||
.val(value)
|
||||
.data('active', true)
|
||||
|
|
@ -1985,11 +1993,9 @@ jQuery(function($){
|
|||
|
||||
if(!$g11n_set_input.data('active')) return;
|
||||
|
||||
var width = $g11n_set_input.width();
|
||||
$g11n_set_input
|
||||
.val('')
|
||||
.removeAttr('disabled')
|
||||
.width(width + 44)
|
||||
.data('active', false)
|
||||
.parent('.g11n').removeClass('active');
|
||||
$this.siblings('.lang_code').val('');
|
||||
|
|
@ -2009,7 +2015,6 @@ jQuery(function($){
|
|||
function reset(){
|
||||
$displayInput
|
||||
.val($hiddenInput.val())
|
||||
.width($displayInput.data('width'))
|
||||
.removeAttr('disabled')
|
||||
.data('active', false);
|
||||
$displayInput.parent('.g11n').removeClass('active');
|
||||
|
|
@ -2023,10 +2028,8 @@ jQuery(function($){
|
|||
function on_complete2(data){
|
||||
if(!data || !data.langs) return;
|
||||
|
||||
var width = $displayInput.width();
|
||||
|
||||
$displayInput.closest('.g11n').addClass('active');
|
||||
$displayInput.val(data.langs[xe.current_lang]).attr('disabled', 'disabled').width(width - 44).data('active', true);
|
||||
$displayInput.val(data.langs[xe.current_lang]).attr('disabled', 'disabled').data('active', true);
|
||||
}
|
||||
|
||||
if(pattern.test($displayInput.val())){
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ class autoinstallModel extends autoinstall
|
|||
* @param int $depth Depth of category
|
||||
* @param array $list Category list
|
||||
* @param array $resultList Final result list
|
||||
* @return string $siblingList Comma seperated list
|
||||
* @return string $siblingList Comma separated list
|
||||
*/
|
||||
function setDepth(&$item, $depth, &$list, &$resultList)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ class BoardAdminView extends Board {
|
|||
// generate module model object
|
||||
$oModuleModel = getModel('module');
|
||||
|
||||
// get the module infomation based on the module_srl
|
||||
// get the module information based on the module_srl
|
||||
if($module_srl) {
|
||||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
|
||||
if(!$module_info) {
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ $lang->msg_send_mail_admin_only = 'The email option can only be used by the admi
|
|||
$lang->message_notice = 'Send a message to the author about this. If you don\'t write a message, it is not sent.';
|
||||
$lang->friends_page_does_not_support = 'Friends in a mobile environment is not supported. Please go to the PC page.';
|
||||
$lang->communication_send_message_grant = 'Send Message Grant';
|
||||
$lang->cmd_manage_base = 'Basic infomation';
|
||||
$lang->cmd_manage_base = 'Basic information';
|
||||
$lang->alert_new_message_arrived = 'You have %d new message(s). Do you want to check it now?';
|
||||
$lang->enable_communication_friend = 'Friend Enable';
|
||||
$lang->enable_communication_message = 'Message Enable';
|
||||
|
|
|
|||
|
|
@ -1018,7 +1018,7 @@ class importerAdminController extends importer
|
|||
}
|
||||
else
|
||||
{
|
||||
// Get parent comment infomation
|
||||
// Get parent comment information
|
||||
$parent_args = new stdClass();
|
||||
$parent_args->comment_srl = $obj->parent_srl;
|
||||
$parent_output = executeQuery('comment.getCommentListItem', $parent_args);
|
||||
|
|
@ -1090,10 +1090,11 @@ class importerAdminController extends importer
|
|||
}
|
||||
|
||||
if($started) $buff .= $str;
|
||||
|
||||
// If it ends with </attach>, handle attachements
|
||||
if(trim($str) == '</attach>')
|
||||
{
|
||||
$xmlDoc = Rhymix\Framework\Parsers\XEXMLParser::loadXMLString($buff.$str);
|
||||
$xmlDoc = Rhymix\Framework\Parsers\XEXMLParser::loadXMLString($buff);
|
||||
|
||||
$file_obj->source_filename = base64_decode($xmlDoc->attach->filename->body);
|
||||
$file_obj->download_count = base64_decode($xmlDoc->attach->download_count->body);
|
||||
|
|
|
|||
|
|
@ -4013,7 +4013,7 @@ class MemberController extends Member
|
|||
$logged_info = Context::get('logged_info');
|
||||
$spam_description = trim( Context::get('spam_description') );
|
||||
|
||||
// get member current infomation
|
||||
// get member current information
|
||||
$member_info = MemberModel::getMemberInfoByMemberSrl($member_srl);
|
||||
$cnt_comment = CommentModel::getCommentCountByMemberSrl($member_srl);
|
||||
$cnt_document = DocumentModel::getDocumentCountByMemberSrl($member_srl);
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ class MenuAdminModel extends Menu
|
|||
|
||||
/**
|
||||
* Return item information of the menu_srl
|
||||
* group_srls uses a seperator with comma(,) and converts to an array by explode
|
||||
* group_srls uses a separator with comma(,) and converts to an array by explode
|
||||
* @param int $menu_item_srl
|
||||
* @return object
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ $lang->about_search_virtual_site = 'Enter domain of virtual sites. To search mod
|
|||
$lang->about_extra_vars_eid_value = 'This is the unique ID for this field.<br>You can use a combination of Latin alphabets, numbers and underscore(_), as long as it starts with an alphabet.';
|
||||
$lang->about_extra_vars_column_name = 'This is the name that is actually shown to users.';
|
||||
$lang->about_extra_vars_description = 'The description entered here will be shown next to the input field.';
|
||||
$lang->about_langcode = 'If you want to configure seperately, use \'find language code\'';
|
||||
$lang->about_langcode = 'If you want to configure separately, use \'find language code\'';
|
||||
$lang->about_file_extension = 'Only %s extension(s) is available.';
|
||||
$lang->fail_module_regist = 'Fail Regist Module';
|
||||
$lang->multilingual_desc = 'Rhymix supports 12 languages currently. If you want to use another language, translate one set of languages in /common/lang/ folder into that language and send it to us (devops@rhymix.org).';
|
||||
|
|
|
|||
|
|
@ -316,7 +316,7 @@ class PointAdminController extends Point
|
|||
// A variable to store member's points
|
||||
$member = array();
|
||||
|
||||
// Get member infomation
|
||||
// Get member information
|
||||
$output = executeQueryArray('point.getMemberCount');
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ class PointAdminView extends Point
|
|||
*/
|
||||
function init()
|
||||
{
|
||||
// Get teh configuration information
|
||||
// Get the configuration information
|
||||
$oModuleModel = getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('point');
|
||||
// Set the configuration variable
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ class PollModel extends Poll
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief returns poll infomation
|
||||
* @brief returns poll information
|
||||
*/
|
||||
public function _getPollinfo($poll_srl)
|
||||
{
|
||||
|
|
@ -78,7 +78,7 @@ class PollModel extends Poll
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief returns poll infomation
|
||||
* @brief returns poll information
|
||||
*/
|
||||
public function getPollinfo()
|
||||
{
|
||||
|
|
@ -89,7 +89,7 @@ class PollModel extends Poll
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief returns poll item infomation
|
||||
* @brief returns poll item information
|
||||
*/
|
||||
public function getPollitemInfo()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<title xml:lang="ko">설문조사 기본 스킨</title>
|
||||
<title xml:lang="zh-CN">投票系统默认皮肤</title>
|
||||
<title xml:lang="jp">アンケート調査デフォルトスキン</title>
|
||||
<title xml:lang="en">Default Skin of teh Poll</title>
|
||||
<title xml:lang="en">Default Skin of the Poll</title>
|
||||
<title xml:lang="vi">Skin mặc định của thăm dò</title>
|
||||
<title xml:lang="zh-TW">投票系統預設面板</title>
|
||||
<title xml:lang="tr">Oylamanın Varsayılan Dış Görünümü</title>
|
||||
|
|
|
|||
|
|
@ -159,6 +159,22 @@ class DBTest extends \Codeception\Test\Unit
|
|||
$target = 'DELETE FROM `' . $prefix . 'documents` WHERE d = ?';
|
||||
$this->assertEquals($target, $oDB->addPrefixes($source));
|
||||
|
||||
$source = 'WITH cte AS (SELECT * FROM documents) SELECT * FROM cte WHERE document_srl = ?';
|
||||
$target = 'WITH cte AS (SELECT * FROM `' . $prefix . 'documents` AS `documents`) SELECT * FROM `cte` WHERE document_srl = ?';
|
||||
$this->assertEquals($target, $oDB->addPrefixes($source));
|
||||
|
||||
$source = 'WITH RECURSIVE cte AS (SELECT * FROM documents INNER JOIN `cte`) SELECT * FROM cte JOIN member on cte.member_srl = member.member_srl';
|
||||
$target = 'WITH RECURSIVE cte AS (SELECT * FROM `' . $prefix . 'documents` AS `documents` INNER JOIN `cte`) SELECT * FROM `cte` JOIN `rx_member` AS `member` on cte.member_srl = member.member_srl';
|
||||
$this->assertEquals($target, $oDB->addPrefixes($source));
|
||||
|
||||
$source = 'WITH RECURSIVE `cte` AS (SELECT * FROM tbl INNER JOIN cte AS h) SELECT * FROM cte WHERE a = ?';
|
||||
$target = 'WITH RECURSIVE `cte` AS (SELECT * FROM `' . $prefix . 'tbl` AS `tbl` INNER JOIN `cte` AS `h`) SELECT * FROM `cte` WHERE a = ?';
|
||||
$this->assertEquals($target, $oDB->addPrefixes($source));
|
||||
|
||||
$source = 'INSERT INTO documents (a, b, c) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE b = ?, c = ?';
|
||||
$target = 'INSERT INTO `' . $prefix . 'documents` (a, b, c) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE b = ?, c = ?';
|
||||
$this->assertEquals($target, $oDB->addPrefixes($source));
|
||||
|
||||
$source = 'update documents set a = ?, b = ? where c = ?';
|
||||
$this->assertEquals($source, $oDB->addPrefixes($source));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue