fixed some bugs

This commit is contained in:
printempw 2016-02-03 15:53:44 +08:00
parent 30dd926632
commit 913052dd3a
3 changed files with 8 additions and 8 deletions

View File

@ -3,7 +3,7 @@
* @Author: printempw
* @Date: 2016-01-16 23:01:33
* @Last Modified by: prpr
* @Last Modified time: 2016-02-03 15:45:46
* @Last Modified time: 2016-02-03 15:51:27
*
* Create tables automatically
*/
@ -35,12 +35,12 @@ if (!file_exists("./install.lock")) {
`preference` varchar(10) NOT NULL,
`skin_hash` varchar(64) NOT NULL,
`cape_hash` varchar(64) NOT NULL,
`last_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
`last_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`uid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=15;";
if(!$conn->query($sql)) {
utils::raise(1, "Creating tables failed. ".$conn->error);
die("Creating tables failed. <br /><br />".$conn->error);
}
/**
@ -62,8 +62,8 @@ if (!file_exists("./install.lock")) {
";
if (!is_dir("../textures/")) {
echo mkdir("../textures/") ? "Creating textures directory..." :
"Creating textures directory failed."
echo mkdir("../textures/") ? "Creating textures directory...<br /><br />" :
"Creating textures directory failed. Check permissons.<br /><br />";
}
echo "Successfully installed. <a href='../index.php'>Index</a>";

View File

@ -3,7 +3,7 @@
* @Author: printempw
* @Date: 2016-01-16 23:01:33
* @Last Modified by: prpr
* @Last Modified time: 2016-02-03 14:00:51
* @Last Modified time: 2016-02-03 15:52:29
*/
class user
@ -77,7 +77,6 @@ class user
$data = fread(fopen($filename, 'r'), filesize($filename));
return $data;
} else {
header('Content-type: application/json');
utils::raise(-1, 'Texture no longer exists.');
}
}

View File

@ -3,7 +3,7 @@
* @Author: printempw
* @Date: 2016-01-16 23:01:33
* @Last Modified by: prpr
* @Last Modified time: 2016-02-03 10:41:31
* @Last Modified time: 2016-02-03 15:52:39
*/
class utils
@ -18,6 +18,7 @@ class utils
public static function raise($errno = -1, $msg = "Error occured.") {
$exception['errno'] = $errno;
$exception['msg'] = $msg;
header('Content-type: application/json');
die(json_encode($exception));
}