diff options
| author | Paul S. Owen <psotfx@users.sourceforge.net> | 2001-09-29 17:59:18 +0000 |
|---|---|---|
| committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2001-09-29 17:59:18 +0000 |
| commit | f10ac6430527cc89b4a57518cefb55a06330f75a (patch) | |
| tree | 1ea4f6f8e05a7c9f18ac8947560c4a5318e02966 /phpBB/develop | |
| parent | b4f6e738c1500e7ddb4464c414d062f72bd932f3 (diff) | |
| download | forums-f10ac6430527cc89b4a57518cefb55a06330f75a.tar forums-f10ac6430527cc89b4a57518cefb55a06330f75a.tar.gz forums-f10ac6430527cc89b4a57518cefb55a06330f75a.tar.bz2 forums-f10ac6430527cc89b4a57518cefb55a06330f75a.tar.xz forums-f10ac6430527cc89b4a57518cefb55a06330f75a.zip | |
Apparently not wanted so there's no point in a) me having spent the morning doing it and b) keeping them in CVS ... removed
git-svn-id: file:///svn/phpbb/trunk@1105 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/develop')
| -rw-r--r-- | phpBB/develop/generate_schema_arrays.php | 125 |
1 files changed, 0 insertions, 125 deletions
diff --git a/phpBB/develop/generate_schema_arrays.php b/phpBB/develop/generate_schema_arrays.php deleted file mode 100644 index 5d9ff9047d..0000000000 --- a/phpBB/develop/generate_schema_arrays.php +++ /dev/null @@ -1,125 +0,0 @@ -<?php - -function remove_comments_schemas($sql) -{ - $lines = explode("\n", $sql); - - // try to keep mem. use down - $sql = ""; - $linecount = count($lines); - $output = ""; - $in_comment = false; - for($i = 0; $i < $linecount; $i++) - { - $lines[$i] = trim($lines[$i]); - - if( ereg("^\/\*", $lines[$i]) ) - { - $in_comment = true; - } - - if( ereg("\*\/$", $lines[$i]) ) - { - $i++; - $in_comment = false; - } - - if( !$in_comment && !ereg("^#", $lines[$i]) && !ereg("^\/$", $lines[$i]) && !ereg("^--", $lines[$i]) ) - { - $output .= $lines[$i] . "\n"; - } - $lines[$i] = ''; - } - return $output; -} - -@set_time_limit(1200); - -$phpbb_root_path = "../"; - -include($phpbb_root_path . 'extension.inc'); -include($phpbb_root_path . 'includes/constants.'.$phpEx); -include($phpbb_root_path . 'includes/sql_parse.'.$phpEx); - -$path_to_db = "../db"; - -$dir = opendir($path_to_db); - -$sql_output_file = fopen("sql_arrays.$phpEx", "w"); - -fwrite($sql_output_file, "<?php\n\n"); - -while( $file = readdir($dir) ) -{ - if( ereg("\.sql$", $file) ) - { - $sql_file = fopen($path_to_db . "/" . $file, "r"); - - $array_name = substr($file, 0, strpos($file, ".sql")); - - $file_contents = trim(fread($sql_file, 100000000)); - - $file_contents = remove_comments_schemas($file_contents); - if($array_name != "mssql_schema") - { - $sql_pieces = split_sql_file($file_contents, ";"); - } - else - { - $lines = explode("\n", $file_contents); - $finish_grab = false; - $line = ""; - for($i = 0; $i < count($lines); $i++) - { - $lines[$i] = trim($lines[$i]); - - if( ereg("^GO$", $lines[$i]) ) - { - $finish_grab = true; - } - else - { - $line .= $lines[$i] . " "; - } - - if( $finish_grab ) - { - $sql_pieces[] = $line . "\n"; - $sql_pieces[] = "GO" . "\n"; - - $line = ""; - $finish_grab = false; - } - $lines[$i] = ''; - } - } - - $sql_count = count($sql_pieces); - - fwrite($sql_output_file, "//\n// $file\n//\n"); - - for($i = 0; $i < $sql_count; $i++) - { - if( ereg("schema|triggers", $file) ) - { - $sql_pieces[$i] = str_replace("\n", " ", $sql_pieces[$i]); - } - - $sql_pieces[$i] = preg_replace("/phpbb_(.*?) /is", "{PREFIX}_\\1 ", $sql_pieces[$i]); - - fwrite($sql_output_file, "\$sql_array['$array_name'][$i] = \"" . trim(str_replace("\"", "\\\"", $sql_pieces[$i])) . "\";\n"); - } - fwrite($sql_output_file, "\n"); - - unset($file_contents); - unset($sql_pieces); - - } -} - -fwrite($sql_output_file, "?>"); - -closedir($dir); -fclose($sql_output_file); - -?> |
