旧版服务端

This commit is contained in:
tianmo committed 2026-09-29 13:39:36 +08:00
1 parent 3429c8b402
commit 25bbb5f9c8
971 files changed
+87141 -40

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
composer.phar
/vendor/
# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
composer.lock
.vscode/
.idea
.DS_Store
cache/
*.cache
runtime/
+65
View File
@@ -0,0 +1,65 @@
<?php
/*
* This document has been generated with
* https://mlocati.github.io/php-cs-fixer-configurator/#version:2.15|configurator
* you can change this configuration by importing this file.
*/
return PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setIndent(' ')
->setRules([
'@PSR2' => true,
'@PhpCsFixer' => true,
'@Symfony:risky' => true,
'concat_space' => ['spacing' => 'one'],
'array_syntax' => ['syntax' => 'short'],
'array_indentation' => true,
'combine_consecutive_unsets' => true,
'method_separation' => true,
'single_quote' => true,
'declare_equal_normalize' => true,
'function_typehint_space' => true,
'hash_to_slash_comment' => true,
'include' => true,
'lowercase_cast' => true,
'no_multiline_whitespace_before_semicolons' => true,
'no_leading_import_slash' => true,
'no_multiline_whitespace_around_double_arrow' => true,
'no_spaces_around_offset' => true,
'no_unneeded_control_parentheses' => true,
'no_unused_imports' => true,
'no_whitespace_before_comma_in_array' => true,
'no_whitespace_in_blank_line' => true,
'object_operator_without_whitespace' => true,
'single_blank_line_before_namespace' => true,
'single_class_element_per_statement' => true,
'space_after_semicolon' => true,
'standardize_not_equals' => true,
'ternary_operator_spaces' => true,
'trailing_comma_in_multiline_array' => true,
'trim_array_spaces' => true,
'unary_operator_spaces' => true,
'whitespace_after_comma_in_array' => true,
'no_extra_consecutive_blank_lines' => [
'curly_brace_block',
'extra',
'parenthesis_brace_block',
'square_brace_block',
'throw',
'use',
],
'binary_operator_spaces' => [
'align_double_arrow' => true,
'align_equals' => true,
],
'braces' => [
'allow_single_line_closure' => true,
],
])
->setFinder(
PhpCsFixer\Finder::create()
->exclude('vendor')
->exclude('tests')
->in(__DIR__)
);
+13
View File
@@ -0,0 +1,13 @@
Copyright (c) 2009-present, Alibaba Cloud All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+31
View File
@@ -0,0 +1,31 @@
English | [简体中文](README-CN.md)
![](https://aliyunsdk-pages.alicdn.com/icons/AlibabaCloud.svg)
## Alibaba Cloud Tea Console Output Library for PHP
## Installation
### Composer
```bash
composer require alibabacloud/tea-console
```
## Issues
[Opening an Issue](https://github.com/aliyun/tea-console/issues/new), Issues not conforming to the guidelines may be closed immediately.
## Changelog
Detailed changes for each release are documented in the [release notes](./ChangeLog.txt).
## References
* [Latest Release](https://github.com/aliyun/tea-console)
## License
[Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0)
Copyright (c) 2009-present, Alibaba Cloud All rights reserved.
+31
View File
@@ -0,0 +1,31 @@
[English](README.md) | 简体中文
![](https://aliyunsdk-pages.alicdn.com/icons/AlibabaCloud.svg)
## Alibaba Cloud Tea Console Output Library for PHP
## 安装
### Composer
```bash
composer require alibabacloud/tea-console
```
## 问题
[提交 Issue](https://github.com/aliyun/tea-console/issues/new),不符合指南的问题可能会立即关闭。
## 发行说明
每个版本的详细更改记录在[发行说明](./ChangeLog.txt)中。
## 相关
* [最新源码](https://github.com/aliyun/tea-console)
## 许可证
[Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0)
Copyright (c) 2009-present, Alibaba Cloud All rights reserved.
+25
View File
@@ -0,0 +1,25 @@
{
"name": "alibabacloud/tea-console",
"description": "Alibaba Cloud Tea Console Output Library for PHP",
"type": "library",
"license": "Apache-2.0",
"authors": [],
"require": {
"php": ">5.5",
"monolog/monolog": "^1.0|^2.1"
},
"autoload": {
"psr-4": {
"AlibabaCloud\\Tea\\Console\\": "src"
}
},
"scripts": {
"fixer": "php-cs-fixer fix ./"
},
"config": {
"sort-packages": true,
"preferred-install": "dist",
"optimize-autoloader": true
},
"prefer-stable": true
}
+109
View File
@@ -0,0 +1,109 @@
<?php
namespace AlibabaCloud\Tea\Console;
use Monolog\Handler\AbstractProcessingHandler;
use Monolog\Handler\StreamHandler;
use Monolog\Logger;
/**
* This is a console module.
*/
class Console
{
/**
* @var Logger
*/
private static $loggerDriver;
/**
* Console val with log level into stdout.
*
* @param string $val the printing string
*
* @throws \Exception
*
* @example \[LOG\] tea console example
*/
public static function log($val)
{
self::logger()->log(200, $val);
}
/**
* Console val with info level into stdout.
*
* @param string $val the printing string
*
* @throws \Exception
*
* @example \[INFO\] tea console example
*/
public static function info($val)
{
self::logger()->info($val);
}
/**
* Console val with warning level into stdout.
*
* @param string $val the printing string
*
* @throws \Exception
*
* @example \[WARNING\] tea console example
*/
public static function warning($val)
{
self::logger()->warning($val);
}
/**
* Console val with debug level into stdout.
*
* @param string $val the printing string
*
* @throws \Exception
*
* @example \[DEBUG\] tea console example
*/
public static function debug($val)
{
self::logger()->debug($val);
}
/**
* Console val with error level into stderr.
*
* @param string $val the printing string
*
* @throws \Exception
*
* @example \[ERROR\] tea console example
*/
public static function error($val)
{
self::logger()->error($val);
}
/**
* @param AbstractProcessingHandler $handler
*/
public static function pushHandler($handler)
{
self::$loggerDriver->pushHandler($handler);
}
/**
* @return Logger
*/
public static function logger()
{
if (null === self::$loggerDriver) {
self::$loggerDriver = new Logger('tea-console-log');
self::$loggerDriver->pushHandler(new StreamHandler('php://stderr', 0));
}
return self::$loggerDriver;
}
}