$license
EOT;
show_footer();
}
}
if(!function_exists('file_put_contents')) {
function file_put_contents($filename, $s) {
$fp = @fopen($filename, 'w');
@fwrite($fp, $s);
@fclose($fp);
return TRUE;
}
}
function createtable($sql) {
$type = strtoupper(preg_replace("/^\s*CREATE TABLE\s+.+\s+\(.+?\).*(ENGINE|TYPE)\s*=\s*([a-z]+?).*$/isU", "\\2", $sql));
$type = in_array($type, array('MYISAM', 'HEAP')) ? $type : 'MYISAM';
return preg_replace("/^\s*(CREATE TABLE\s+.+\s+\(.+?\)).*$/isU", "\\1", $sql).
(mysql_get_server_info() > '4.1' ? " ENGINE=$type DEFAULT CHARSET=".DBCHARSET : " TYPE=$type");
}
function dir_writeable($dir) {
$writeable = 0;
if(!is_dir($dir)) {
@mkdir($dir, 0777);
}
if(is_dir($dir)) {
if($fp = @fopen("$dir/test.txt", 'w')) {
@fclose($fp);
@unlink("$dir/test.txt");
$writeable = 1;
} else {
$writeable = 0;
}
}
return $writeable;
}
function dir_clear($dir) {
global $lang;
showjsmessage($lang['clear_dir'].' '.str_replace(ROOT_PATH, '', $dir));
$directory = dir($dir);
while($entry = $directory->read()) {
$filename = $dir.'/'.$entry;
if(is_file($filename)) {
@unlink($filename);
}
}
$directory->close();
@touch($dir.'/index.htm');
}
function show_header() {
define('SHOW_HEADER', TRUE);
global $step;
$version = SOFT_VERSION;
$release = SOFT_RELEASE;
$install_lang = lang(INSTALL_LANG);
$title = lang('title_install');
$charset = CHARSET;
echo <<
$title