mirror of
http://124.126.16.154:8888/singularity/hyperf-admin.git
synced 2026-01-15 07:15:06 +08:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4484fb1eea |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,4 +1,5 @@
|
||||
.idea/
|
||||
vendor/
|
||||
runtime/
|
||||
.phpunit.result.cache
|
||||
.php-cs-fixer.cache
|
||||
32
bin/hyperf.php
Normal file
32
bin/hyperf.php
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Hyperf\Di\ClassLoader;
|
||||
use Hyperf\Di\Container;
|
||||
use Hyperf\Di\Definition\DefinitionSource;
|
||||
use Hyperf\Utils\ApplicationContext;
|
||||
use Psr\Container\ContainerInterface;
|
||||
use Swoole\Runtime;
|
||||
|
||||
ini_set('display_errors', 'on');
|
||||
ini_set('display_startup_errors', 'on');
|
||||
|
||||
error_reporting(E_ALL);
|
||||
date_default_timezone_set('Asia/Shanghai');
|
||||
|
||||
|
||||
!defined('BASE_PATH') && define('BASE_PATH', dirname(__DIR__, 1));
|
||||
!defined('SWOOLE_HOOK_FLAGS') && define('SWOOLE_HOOK_FLAGS', SWOOLE_HOOK_ALL);
|
||||
|
||||
Runtime::enableCoroutine();
|
||||
|
||||
require BASE_PATH . '/vendor/autoload.php';
|
||||
ClassLoader::init();
|
||||
|
||||
$container = new Container(new DefinitionSource([]));
|
||||
if (!$container instanceof ContainerInterface) {
|
||||
throw new RuntimeException('The dependency injection container is invalid.');
|
||||
}
|
||||
$container = ApplicationContext::setContainer($container);
|
||||
@@ -18,29 +18,30 @@
|
||||
"ext-swoole": ">=4.4",
|
||||
"aliyuncs/oss-sdk-php": "^2.3",
|
||||
"box/spout": "^3.1",
|
||||
"hyperf/amqp": "~2.2.0",
|
||||
"hyperf/async-queue": "~2.2.0",
|
||||
"hyperf/cache": "~2.2.0",
|
||||
"hyperf/command": "~2.2.0",
|
||||
"hyperf/config": "~2.2.0",
|
||||
"hyperf/constants": "~2.2.0",
|
||||
"hyperf/crontab": "~2.2.0",
|
||||
"hyperf/database": "~2.2.0",
|
||||
"hyperf/db-connection": "~2.2.0",
|
||||
"hyperf/filesystem": "^2.0",
|
||||
"hyperf/framework": "~2.2.0",
|
||||
"hyperf/guzzle": "~2.2.0",
|
||||
"hyperf/http-server": "~2.2.0",
|
||||
"hyperf/logger": "~2.2.0",
|
||||
"hyperf/memory": "~2.2.0",
|
||||
"hyperf/metric": "~2.2.0",
|
||||
"hyperf/nsq": "~2.2.0",
|
||||
"hyperf/process": "~2.2.0",
|
||||
"hyperf/redis": "~2.2.0",
|
||||
"hyperf/snowflake": "~2.2.0",
|
||||
"hyperf/validation": "~2.2.0",
|
||||
"hyperf/amqp": "3.0.*",
|
||||
"hyperf/async-queue": "3.0.*",
|
||||
"hyperf/cache": "3.0.*",
|
||||
"hyperf/code-generator": "^0.3.3",
|
||||
"hyperf/command": "3.0.*",
|
||||
"hyperf/config": "3.0.*",
|
||||
"hyperf/constants": "3.0.*",
|
||||
"hyperf/crontab": "3.0.*",
|
||||
"hyperf/database": "3.0.*",
|
||||
"hyperf/db-connection": "3.0.*",
|
||||
"hyperf/filesystem": "3.0.*",
|
||||
"hyperf/framework": "3.0.*",
|
||||
"hyperf/guzzle": "3.0.*",
|
||||
"hyperf/http-server": "3.0.*",
|
||||
"hyperf/logger": "3.0.*",
|
||||
"hyperf/memory": "3.0.*",
|
||||
"hyperf/metric": "3.0.*",
|
||||
"hyperf/nsq": "3.0.*",
|
||||
"hyperf/process": "3.0.*",
|
||||
"hyperf/redis": "3.0.*",
|
||||
"hyperf/snowflake": "3.0.*",
|
||||
"hyperf/validation": "3.0.*",
|
||||
"nette/php-generator": "^3.4",
|
||||
"singularity/hdk-core": "^0.1.6",
|
||||
"singularity/hdk-core": "^1.0.0",
|
||||
"xxtime/flysystem-aliyun-oss": "~1.5.0",
|
||||
"yadakhov/insert-on-duplicate-key": "^1.2",
|
||||
"zoujingli/ip2region": "^1.0"
|
||||
@@ -101,7 +102,6 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true,
|
||||
"config": {
|
||||
"sort-packages": true,
|
||||
|
||||
2360
composer.lock
generated
2360
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -2,6 +2,7 @@
|
||||
namespace HyperfAdmin\BaseUtils;
|
||||
|
||||
use Monolog\Formatter\LineFormatter;
|
||||
use Monolog\LogRecord;
|
||||
|
||||
class ColorLineFormatter extends LineFormatter
|
||||
{
|
||||
@@ -11,7 +12,7 @@ class ColorLineFormatter extends LineFormatter
|
||||
'WARNING' => "\e[0;33m{log_str}\e[0m",
|
||||
];
|
||||
|
||||
public function format(array $record): string
|
||||
public function format(LogRecord $record): string
|
||||
{
|
||||
$log = parent::format($record);
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ class BootAppConfListener implements ListenerInterface
|
||||
];
|
||||
}
|
||||
|
||||
public function process(object $event)
|
||||
public function process(object $event): void
|
||||
{
|
||||
Builder::macro('getAsArray', function () {
|
||||
/** @var \Hyperf\Database\Query\Builder $this */
|
||||
|
||||
@@ -15,7 +15,7 @@ class DbQueryExecutedListener implements ListenerInterface
|
||||
];
|
||||
}
|
||||
|
||||
public function process(object $event)
|
||||
public function process(object $event): void
|
||||
{
|
||||
if($event instanceof QueryExecuted) {
|
||||
if(is_production()) {
|
||||
|
||||
@@ -15,7 +15,7 @@ class FetchModeListener implements ListenerInterface
|
||||
];
|
||||
}
|
||||
|
||||
public function process(object $event)
|
||||
public function process(object $event): void
|
||||
{
|
||||
if($event instanceof StatementPrepared) {
|
||||
$event->statement->setFetchMode(PDO::FETCH_ASSOC);
|
||||
|
||||
@@ -16,12 +16,12 @@ class RedisArray implements \ArrayAccess
|
||||
$this->redis = container(RedisFactory::class)->get($cluster);
|
||||
}
|
||||
|
||||
public function offsetExists($offset)
|
||||
public function offsetExists($offset): bool
|
||||
{
|
||||
return $this->redis->hExists($this->name, (string)$offset);
|
||||
}
|
||||
|
||||
public function offsetGet($offset)
|
||||
public function offsetGet($offset): mixed
|
||||
{
|
||||
$val = $this->redis->hGet($this->name, (string)$offset);
|
||||
if(is_json_str($val)) {
|
||||
@@ -31,14 +31,14 @@ class RedisArray implements \ArrayAccess
|
||||
return $val;
|
||||
}
|
||||
|
||||
public function offsetSet($offset, $value)
|
||||
public function offsetSet($offset, $value): void
|
||||
{
|
||||
return $this->redis->hSet($this->name, (string)$offset, is_array($value) ? json_encode($value) : $value);
|
||||
$this->redis->hSet($this->name, (string)$offset, is_array($value) ? json_encode($value) : $value);
|
||||
}
|
||||
|
||||
public function offsetUnset($offset)
|
||||
public function offsetUnset($offset): void
|
||||
{
|
||||
return $this->redis->hDel($this->name, (string)$offset);
|
||||
$this->redis->hDel($this->name, (string)$offset);
|
||||
}
|
||||
|
||||
public function __destruct()
|
||||
|
||||
Reference in New Issue
Block a user