-
Notifications
You must be signed in to change notification settings - Fork 19
/
index.php
executable file
·32 lines (22 loc) · 804 Bytes
/
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
<?php
/**
* Created by PhpStorm.
* User: Kilingzhang
* Date: 2020/4/18
* Time: 14:25
*/
// 关闭所有报错
error_reporting(0);
require_once "vendor/autoload.php";
ini_set('date.timezone', 'Asia/Chongqing');
!defined('PATH_INFO') && define('PATH_INFO', trim(parse_url($_SERVER['REQUEST_URI'])['path'], '/'));
$namespaces = explode('/', PATH_INFO);
$namespaces = array_map(function ($namespace) {
return ucfirst($namespace);
}, $namespaces);
$namespaces = implode("\\", $namespaces);
$version = "V1";
$namespaces = rtrim(sprintf("\\NeteaseCloudMusicApi\\%s\\%s", $version, $namespaces), '\\');
$namespaces = !class_exists($namespaces) ? sprintf("%s\\Index", $namespaces) : $namespaces;
!defined('NAMESPACES') && define('NAMESPACES', $namespaces);
new \NeteaseCloudMusicApi\Bootstrap;