BUG-12676 Workspace Restore action from ./processmaker is not working with strange characters. SOLVED

Descripcion: The action "./processmaker workspace-restore -o workspace" is not working because the data has strange characters, and not permits to restore in other servers.

Solucion: Para evitar el uso de la manipulacion del contenido del archivo sql, se tiene como primera opcion de restauracion el uso del intérprete de comandos ejecutando el comando "mysql" junto a los parametros necesarios.
En que caso que el modo seguro del servidor este activado se optara por la opcion de obtener las lineas de cada sentencia sql dentro del archivo realizando un explode teniendo como parametro ";\n" y el contenido del archivo.
Resuelto para la version PM 2.5.2
This commit is contained in:
Omar Suca
2013-08-15 16:05:27 -04:00
parent 5c9bf1fcc6
commit 232d3abe0d

View File

@@ -1060,8 +1060,14 @@ class workspaceTools
private function executeSQLScript($database, $filename, $parameters)
{
mysql_query("CREATE DATABASE IF NOT EXISTS " . mysql_real_escape_string($database));
// Check for safe mode
// Check for safe mode and if mysql exist on server
$flagFunction = '';
if ( !ini_get('safe_mode') ) {
$flagFunction = shell_exec('mysql --version');
}
if ( !ini_get('safe_mode') && !is_null($flagFunction) ) {
$command = 'mysql'
. ' --host=' . $parameters['dbHost']
. ' --user=' . $parameters['dbUser']