diff options
Diffstat (limited to 'phpBB/develop')
| -rw-r--r-- | phpBB/develop/create_schema_files.php | 41 | 
1 files changed, 24 insertions, 17 deletions
| diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index efe8837b26..7f37b94453 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -12,11 +12,7 @@  * If you overwrite the original schema files please make sure you save the file with UNIX linefeeds.  */ -die("Please read the first lines of this script for instructions on how to enable it"); - -@set_time_limit(0); - -$schema_path = './../install/schemas/'; +$schema_path = dirname(__FILE__) . '/../install/schemas/';  if (!is_writable($schema_path))  { @@ -242,7 +238,7 @@ $supported_dbms = array('firebird', 'mssql', 'mysql_40', 'mysql_41', 'oracle', '  foreach ($supported_dbms as $dbms)  { -	$fp = fopen($schema_path . '_' . $dbms . '_schema.sql', 'wt'); +	$fp = fopen($schema_path . $dbms . '_schema.sql', 'wt');  	$line = ''; @@ -251,32 +247,43 @@ foreach ($supported_dbms as $dbms)  	{  		case 'mysql_40':  		case 'mysql_41': -			$line = "#\n# \$I" . "d: $\n#\n\n"; +		case 'firebird': +		case 'sqlite': +			fwrite($fp, "# DO NOT EDIT THIS FILE, IT IS GENERATED\n"); +			fwrite($fp, "#\n"); +			fwrite($fp, "# To change the contents of this file, edit\n"); +			fwrite($fp, "# phpBB/develop/create_schema_files.php and\n"); +			fwrite($fp, "# run it.\n");  		break; +		case 'mssql': +		case 'oracle': +		case 'postgres': +			fwrite($fp, "/*\n"); +			fwrite($fp, " * DO NOT EDIT THIS FILE, IT IS GENERATED\n"); +			fwrite($fp, " *\n"); +			fwrite($fp, " * To change the contents of this file, edit\n"); +			fwrite($fp, " * phpBB/develop/create_schema_files.php and\n"); +			fwrite($fp, " * run it.\n"); +			fwrite($fp, " */\n\n"); +		break; +	} + +	switch ($dbms) +	{  		case 'firebird': -			$line = "#\n# \$I" . "d: $\n#\n\n";  			$line .= custom_data('firebird') . "\n";  		break;  		case 'sqlite': -			$line = "#\n# \$I" . "d: $\n#\n\n";  			$line .= "BEGIN TRANSACTION;\n\n";  		break; -		case 'mssql': -			$line = "/*\n\n \$I" . "d: $\n\n*/\n\n"; -			// no need to do this, no transaction support for schema changes -			//$line .= "BEGIN TRANSACTION\nGO\n\n"; -		break; -  		case 'oracle': -			$line = "/*\n\n \$I" . "d: $\n\n*/\n\n";  			$line .= custom_data('oracle') . "\n";  		break;  		case 'postgres': -			$line = "/*\n\n \$I" . "d: $\n\n*/\n\n";  			$line .= "BEGIN;\n\n";  			$line .= custom_data('postgres') . "\n";  		break; | 
