|
From: Jon O. <jon...@us...> - 2005-09-09 08:57:25
|
Update of /cvsroot/mxbb/core/install In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20164/install Modified Files: mx_install.php Log Message: fixing up installation Index: mx_install.php =================================================================== RCS file: /cvsroot/mxbb/core/install/mx_install.php,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** mx_install.php 7 Sep 2005 19:38:10 -0000 1.47 --- mx_install.php 9 Sep 2005 08:57:17 -0000 1.48 *************** *** 1504,1507 **** --- 1504,1508 ---- // $commands_ary = @file_get_contents($schema); + $commands_ary = encode_serialized_data($commands_ary); $commands_ary = preg_replace('/mx_table_/', $mx_table_prefix, $commands_ary); $commands_ary = $remove_remarks($commands_ary); *************** *** 1509,1512 **** --- 1510,1514 ---- $commands_cnt = count($commands_ary); + // // Let's process the statements *************** *** 1522,1529 **** --- 1524,1534 ---- // Commands supported: SQL statements and SET (see format below). // + $command = decode_serialized_data($command); $parse_command = ( preg_match('#^set[\s]+[a-z][a-z0-9_\.]+#i', $command) ? 'parse_cmd_set' : 'parse_cmd_sql' ); // // Let's execute this command (before we'll convert any variable stored by any previous SET command) // + + //echo($command . '<br>'); $parse_command(convert_setvars($command, true)); } *************** *** 1532,1535 **** --- 1537,1561 ---- // + // Encode/decode serialized data + // + function encode_serialized_data($command) + { + $command = str_replace(';i:', '::i::', $command); + $command = str_replace(';s:', '::s::', $command); + $command = str_replace(';}', '::end::', $command); + + return $command; + } + + function decode_serialized_data($command) + { + $command = str_replace('::i::', ';i:', $command); + $command = str_replace('::s::', ';s:', $command); + $command = str_replace('::end::',';}', $command); + + return $command; + } + + // // Command: SET name = SELECT ...; // |