-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
65 lines (50 loc) · 1.23 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
/**
* 调用数据
*
* PHP version 7.2
*
* @category INDEX
* @package SARURI
* @author saruri <[email protected]>
* @copyright 2006-2019 saruri
* @license MIT LICENSE
* @link http://saruri.cn
* @date 2019/12/28 19:04:42
*/
namespace saruri;
include_once "base.php";
include_once "mysql2markdown.php";
include_once "parser.php";
$_config = [
'DB_HOST' => 'localhost',
'DB_NAME'=> 'systemx_com',
'DB_USER' => 'systemx_com',
'DB_PWD' => 'mG3R6f7nk4J2dP2Z',
];
$_config=[
'DB_HOST' => 'localhost',
'DB_NAME'=> 'thinkssns_com',
'DB_USER' => 'thinkssns_com',
'DB_PWD' => 'NHGMJBW7FfdF2etF',
];
$m2m = new Mysql2Markdown($_config);
//示例 可选 更改css
//$m2m ->changeCss('https://github.githubassets.com/assets/github-102d2679bcc893600ce928d5c6d34297.css');
if($_GET['action']=='json'){
$m2m->toJson(); //示例输出成json
}
if($_GET['action']=='source'){
$html=$m2m->toMarkdown();
}
if(!$_GET['action']){
if($_GET['width']){
//示例 可选 更改宽度 默认960
$width=intval($_GET['width']);
$width == 0 || $width==960;
$m2m ->changeWidth($width);
}
//默认markdown
$html=$m2m->toMarkdownParser();
}
exit($html);