$license
EOT;
show_footer();
}
}
function transfer_ucinfo(&$post) {
global $uchidden;
if(isset($post['ucapi']) && isset($post['ucfounderpw'])) {
$arr = array(
'ucapi' => $post['ucapi'],
'ucfounderpw' => $post['ucfounderpw']
);
$uchidden = urlencode(serialize($arr));
} else {
$uchidden = '';
}
}
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, $dbver) {
$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', 'MEMORY')) ? $type : 'MYISAM';
return preg_replace("/^\s*(CREATE TABLE\s+.+\s+\(.+?\)).*$/isU", "\\1", $sql).
($dbver > '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));
if($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 = DISCUZ_VERSION;
$release = DISCUZ_RELEASE;
$install_lang = lang(INSTALL_LANG);
$title = lang('title_install');
$charset = CHARSET;
echo <<
$title