Skip to content

Commit c815715

Browse files
committed
优化核心
1 parent 1cebaf2 commit c815715

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+9937
-1
lines changed

.editorconfig

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false
13+
14+
[*.php]
15+
indent_style = space
16+
indent_size = 4
17+
end_of_line = lf
18+
charset = utf-8
19+
trim_trailing_whitespace = true
20+
insert_final_newline = true

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.idea/
2+
.vscode/
3+
application/storage/*
4+
application/config/production/*
5+
application/config/development/*
6+
backup/Backup_ArtisanExport*
7+
public/admin/
8+
zls.ini
9+
!.gitkeep
10+
!.gitignore
11+

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1-
新版整理中
1+
# ZlsPHP
2+
3+
### 注意
4+
5+
请给 application/storage 目录可写入权限
6+
7+
2018-04-22 00:50:15

application/bootstrap.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
$config = Zls::getConfig();
3+
z::header('Content-Type: text/html; charset=UTF-8');
4+
z::header('X-Powered-By: Zls');
5+
z::header("Access-Control-Allow-Origin: " . z::server('HTTP_ORIGIN'));
6+
z::header("Access-Control-Allow-Credentials: true");
7+
z::header("Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS");
8+
z::header('Access-Control-Allow-Headers:Authorization,x-requested-with,content-type');
9+
if((isset($_SERVER['REQUEST_METHOD']) && strtoupper($_SERVER['REQUEST_METHOD']) === 'OPTIONS')){
10+
z::finish();
11+
}
12+
//白名单ip
13+
$isWhiteList = Z::isWhiteIp(Z::clientIp([]));

application/classes/Artisan/.gitkeep

Whitespace-only changes.

application/classes/Business/.gitkeep

Whitespace-only changes.

application/classes/Controller/.gitkeep

Whitespace-only changes.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
namespace Controller;
3+
use Z;
4+
/**
5+
* Zls
6+
* @author 影浅
7+
* @email seekwe@gmail.com
8+
* @copyright Copyright (c) 2015 - 2017, 影浅, Inc.
9+
* @link ---
10+
* @since v0.0.1
11+
* @updatetime 2017-05-30 21:32
12+
*/
13+
class Zls extends \Zls_Controller
14+
{
15+
public function before($method, $controllerShort, $args, $controller)
16+
{
17+
}
18+
public function after($contents, $methodName, $controllerShort, $args, $controller)
19+
{
20+
echo $contents;
21+
}
22+
public function z_index()
23+
{
24+
z::debug('index');
25+
//\sleep(1);
26+
return z::json(200, 'ok', [
27+
'运行成功',
28+
z::clientIp(),
29+
z::host(true, true, true),
30+
z::debug('index', true, true),
31+
z::debug(),
32+
]);
33+
}
34+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
namespace Controller;
3+
use Z;
4+
/**
5+
* ZlsApi 接口示例
6+
* @desc 示例用的
7+
* @key zls
8+
* @author 影浅
9+
* @email seekwe@gmail.com
10+
* @copyright Copyright (c) 2015 - 2017, 影浅, Inc.
11+
* @link ---
12+
* @since v0.0.1
13+
* @updatetime 2017-05-30 21:32
14+
*/
15+
class ZlsApi extends \Zls_Controller
16+
{
17+
/**
18+
* 入口
19+
* @time 2017-05-30 21:32
20+
* @param string say 示例字段 G 运行成功Api
21+
* @return int code 状态码
22+
* @return string data.clientIp 客户端IP
23+
* @return object {"code":200,"msg":"ok","data":{"0":"运行成功Api","clientIp":"127.0.0.1","1":"http://127.0.0.1:1221/ZlsApi/index.aspx","2":"index[runtime:0s,memory:2kb]","3":{"runtime":"0.001s","memory":"0.016929626464844kb"}}}
24+
*/
25+
public function z_index()
26+
{
27+
z::debug('index');
28+
return z::json(200, 'ok', [
29+
z::getPost('say', '运行成功Api'),
30+
'clientIp'=> z::clientIp(),
31+
z::host(true, true, true),
32+
z::debug('index', true, true),
33+
z::debug(),
34+
]);
35+
}
36+
}

application/classes/Exception/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)