' . $info['file']; self::run($info['shell']); self::out('操作成功,输出路径:' . $info['file']); } public static function mysql_in() { $info = self::mysql(); $info['new'] = self::input('请输入要恢复的全新数据库:为空则使用上边填的数据库', $info['database']); $create_table = 'mysqladmin ' . $info['shell'] . ' create ' . $info['new']; $info['shell'] = 'mysql ' . $info['shell'] . ' ' . $info['new']; $info['file'] .= '.sql'; $info['shell'] .= ' < ' . $info['file']; self::run($create_table); self::run($info['shell']); self::out('操作成功,您已成功恢复' . $info['file'] . '里的数据'); } } $text = array ( '请输入命令以执行相应操作:' , 'mysql_out:备份mysql' , 'mysql_in:恢复mysql' , '请在输入命令之后按回车键' ); $shell = Tool::input($text); switch($shell) { case 'mysql_out': Tool::mysql_out(); break; case 'mysql_in': Tool::mysql_in(); break; default: echo "未定义的方法"; break; }