Skip to content
This repository was archived by the owner on Jun 17, 2022. It is now read-only.

Commit c126ab9

Browse files
committed
Restructure the project structure
1 parent d12c7da commit c126ab9

File tree

11 files changed

+52
-19
lines changed

11 files changed

+52
-19
lines changed

src/class/github/autoload.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
/**
3+
* @describe Load Class in namespace GitHub
4+
*/
5+
6+
// Main Class
7+
require_once __DIR__ . "/github.class.php";
8+
9+
// Push Event
10+
require_once __DIR__ . "/push.class.php";
11+
12+
// Pull Request Event
13+
require_once __DIR__ . "/pullrequest.class.php";
14+
15+
// Issue Event
16+
require_once __DIR__ . "/issues.class.php";
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/class/wework/autoload.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
/**
3+
* @describe Load Class in namespace WeWork
4+
*/
5+
6+
// Main Class
7+
require_once __DIR__ . "/groupbot.class.php";
8+
9+
// Markdown Message Class
10+
require_once __DIR__ . "/markdown.class.php";
File renamed without changes.
File renamed without changes.

src/function/time.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
/**
4+
* @describe 将UTC时间转换为常用时间表达
5+
* @param string $utcTime UTC格式时间 例如2021-09-17T20:43:46+08:00
6+
* @return string xxxx年xx月xx日 xx:xx:xx (UTF +xx:xx)
7+
*/
8+
function UTC_to_time(string $utcTime): string
9+
{
10+
// 2021-09-17T20:43:46+08:00
11+
$utcTime = trim($utcTime);
12+
preg_match("/^(\d{4})-(\d{1,2})-(\d{1,2})T(\d{1,2}):(\d{1,2}):(\d{1,2})([+-]\d{1,2}):(\d{1,2})$/i", $utcTime, $time);
13+
$_time = [
14+
"y" => (int)$time[1],
15+
"m" => (int)$time[2],
16+
"d" => (int)$time[3],
17+
"h" => (int)$time[4],
18+
"min" => (int)$time[5],
19+
"s" => (int)$time[6],
20+
"timezone" => $time[8] !== "00" ? $time[7] . ":" . $time[8] : $time[7]
21+
];
22+
return "{$_time["y"]}{$_time["m"]}{$_time["d"]}{$_time["h"]}:{$_time["min"]}:{$_time["s"]} (UTF {$_time["timezone"]})";
23+
}

src/github/autoload.php

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)