Skip to content

Commit

Permalink
Add RPC Call - executeSQL
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanheimes committed May 2, 2012
1 parent 9e3d46e commit c42021a
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 13 deletions.
18 changes: 18 additions & 0 deletions system/modules/syncCto/SyncCtoCommunicationClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,24 @@ public function runDatabaseDump($arrTables, $booTempFolder)

return $this->runServer("SYNCCTO_RUN_DUMP", $arrData);
}

/**
* Exceute SQL commands on client side
*
* @param array $arrSQL array([ID] => <br/>array("prepare" => [String(SQL)], "execute" => array([mix]) ) <br/>)
* @return array array([ID] => response)
*/
public function executeSQL($arrSQL)
{
$arrData = array(
array(
"name" => "sql",
"value" => $arrSQL,
)
);

return $this->runServer("SYNCCTO_EXECUTE_SQL", $arrData);
}

/**
* Returns a list without the hidden tables
Expand Down
38 changes: 25 additions & 13 deletions system/modules/syncCto/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
/**
* Current syncCto version
*/
$GLOBALS['SYC_VERSION'] = '2.0.0';
$GLOBALS['SYC_VERSION'] = '2.1.0';

/**
* Back end modules
Expand All @@ -58,12 +58,17 @@
'syncCto_check' => array(
'icon' => 'system/modules/syncCto/html/iconCheck.png',
'callback' => 'SyncCtoModuleCheck',
'stylesheet' => 'system/modules/syncCto/html/css/systemcheck_src.css',
'stylesheet' => 'system/modules/syncCto/html/css/systemcheck.css',
)
)
), array_slice($GLOBALS['BE_MOD'], $i)
);

/**
* Form fields
*/
$GLOBALS['BE_FFL']['syncctocheckbox'] = 'SyncCtoCheckBox';

/**
* Hooks
*/
Expand Down Expand Up @@ -97,14 +102,14 @@
*/
if (($objInput->get("table") == 'tl_syncCto_clients_syncTo' || $objInput->get("table") == 'tl_syncCto_clients_syncFrom') && TL_MODE == 'BE')
{
$GLOBALS['TL_CSS'][] = 'system/modules/syncCto/html/css/filelist_src.css';
$GLOBALS['TL_CSS'][] = 'system/modules/syncCto/html/css/filelist.css';
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/syncCto/html/js/htmltable.js';
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/syncCto/html/js/filelist.js';
}

if($GLOBALS['TL_CONFIG']['syncCto_attentionFlag'] == true)
{
$GLOBALS['TL_CSS'][] = 'system/modules/syncCto/html/css/attention_src.css';
$GLOBALS['TL_CSS'][] = 'system/modules/syncCto/html/css/attention.css';
}

if (($objInput->get("do") == 'synccto_clients' && $objInput->get("act") == '') && $objInput->get("table") == '' && TL_MODE == 'BE')
Expand All @@ -123,6 +128,7 @@
// Tables
$GLOBALS['SYC_CONFIG']['table_hidden'] = array(
'tl_log',
'tl_lock',
'tl_session',
'tl_undo',
'tl_version',
Expand All @@ -133,16 +139,16 @@

// Folders
$GLOBALS['SYC_CONFIG']['folder_blacklist'] = array(
'system/html*',
'system/logs*',
'system/scripts*',
'system/tmp*',
'*/syncCto_backups*',
'system/html',
'system/logs',
'system/scripts',
'system/tmp',
'*/syncCto_backups/*',
);

// Files only Sync.
// Files only sync.
$GLOBALS['SYC_CONFIG']['file_blacklist'] = array(
'*.htaccess',
'.htaccess',
'*/localconfig.php',
);

Expand All @@ -161,12 +167,10 @@
'dbCharset',
'dbPort',
'displayErrors',
// CtoCom
'ctoCom_APIKey',
'ctoCom_disableRefererCheck',
'ctoCom_responseLength',
'ctoCom_handshake',
// SyncCto
'syncCto_debug_mode',
'syncCto_attentionFlag'
);
Expand Down Expand Up @@ -370,6 +374,14 @@
"parameter" => array("tables", "tempfolder"),
);

// Execute SQL
$GLOBALS["CTOCOM_FUNCTIONS"]["SYNCCTO_EXECUTE_SQL"] = array(
"class" => "SyncCtoRPCFunctions",
"function" => "executeSQL",
"typ" => "POST",
"parameter" => array("sql"),
);

// Get folder path list
$GLOBALS["CTOCOM_FUNCTIONS"]["SYNCCTO_GET_PATHLIST"] = array(
"class" => "SyncCtoRPCFunctions",
Expand Down

0 comments on commit c42021a

Please sign in to comment.