-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Conflicts: # config/autoload/dependencies.php # config/autoload/listeners.php # config/autoload/logger.php
- Loading branch information
Showing
15 changed files
with
112 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
#!/usr/bin/env php | ||
<?php | ||
|
||
declare(strict_types=1); | ||
/** | ||
* This file is part of Hyperf. | ||
* | ||
|
@@ -8,6 +10,11 @@ | |
* @contact [email protected] | ||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE | ||
*/ | ||
use Hyperf\Contract\ApplicationInterface; | ||
use Hyperf\Di\ClassLoader; | ||
use Psr\Container\ContainerInterface; | ||
use Symfony\Component\Console\Application; | ||
|
||
ini_set('display_errors', 'on'); | ||
ini_set('display_startup_errors', 'on'); | ||
|
||
|
@@ -21,10 +28,10 @@ | |
|
||
// Self-called anonymous function that creates its own scope and keep the global namespace clean. | ||
(function () { | ||
Hyperf\Di\ClassLoader::init(); | ||
/** @var Psr\Container\ContainerInterface $container */ | ||
ClassLoader::init(); | ||
/** @var ContainerInterface $container */ | ||
$container = require BASE_PATH . '/config/container.php'; | ||
/** @var Symfony\Component\Console\Application $application */ | ||
$application = $container->get(Hyperf\Contract\ApplicationInterface::class); | ||
/** @var Application $application */ | ||
$application = $container->get(ApplicationInterface::class); | ||
$application->run(); | ||
})(); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,9 @@ | |
* @contact [email protected] | ||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE | ||
*/ | ||
use Hyperf\Coroutine\Coroutine; | ||
use Hyperf\Di\Resolver\ResolverDispatcher; | ||
|
||
return [ | ||
'scan' => [ | ||
'paths' => [ | ||
|
@@ -18,8 +21,8 @@ | |
'mixin', | ||
], | ||
'class_map' => [ | ||
Hyperf\Coroutine\Coroutine::class => BASE_PATH . '/app/Kernel/ClassMap/Coroutine.php', | ||
Hyperf\Di\Resolver\ResolverDispatcher::class => BASE_PATH . '/app/Kernel/ClassMap/ResolverDispatcher.php', | ||
Coroutine::class => BASE_PATH . '/app/Kernel/ClassMap/Coroutine.php', | ||
ResolverDispatcher::class => BASE_PATH . '/app/Kernel/ClassMap/ResolverDispatcher.php', | ||
], | ||
], | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,9 +9,11 @@ | |
* @contact [email protected] | ||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE | ||
*/ | ||
use Hyperf\AsyncQueue\Driver\RedisDriver; | ||
|
||
return [ | ||
'default' => [ | ||
'driver' => Hyperf\AsyncQueue\Driver\RedisDriver::class, | ||
'driver' => RedisDriver::class, | ||
'channel' => '{queue}', | ||
'timeout' => 2, | ||
'retry_seconds' => 5, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,10 +9,13 @@ | |
* @contact [email protected] | ||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE | ||
*/ | ||
use Hyperf\Cache\Driver\RedisDriver; | ||
use Hyperf\Codec\Packer\PhpSerializerPacker; | ||
|
||
return [ | ||
'default' => [ | ||
'driver' => Hyperf\Cache\Driver\RedisDriver::class, | ||
'packer' => Hyperf\Codec\Packer\PhpSerializerPacker::class, | ||
'driver' => RedisDriver::class, | ||
'packer' => PhpSerializerPacker::class, | ||
'prefix' => 'c:', | ||
], | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,8 @@ | |
* @contact [email protected] | ||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE | ||
*/ | ||
use Hyperf\ModelCache\Handler\RedisHandler; | ||
|
||
use function Hyperf\Support\env; | ||
|
||
return [ | ||
|
@@ -31,7 +33,7 @@ | |
'max_idle_time' => (float) env('DB_MAX_IDLE_TIME', 60), | ||
], | ||
'cache' => [ | ||
'handler' => Hyperf\ModelCache\Handler\RedisHandler::class, | ||
'handler' => RedisHandler::class, | ||
'cache_key' => '{mc:%s:m:%s}:%s:%s', | ||
'prefix' => 'default', | ||
'ttl' => 3600 * 24, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,9 +9,18 @@ | |
* @contact [email protected] | ||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE | ||
*/ | ||
use App\Kernel\Event\EventDispatcherFactory; | ||
use App\Kernel\Http\WorkerStartListener; | ||
use App\Kernel\Log\LoggerFactory; | ||
use App\Service\Factory\WeChatFactory; | ||
use EasyWeChat\MiniApp\Contracts\Application; | ||
use Hyperf\Contract\StdoutLoggerInterface; | ||
use Hyperf\Server\Listener\AfterWorkerStartListener; | ||
use Psr\EventDispatcher\EventDispatcherInterface; | ||
|
||
return [ | ||
Hyperf\Contract\StdoutLoggerInterface::class => App\Kernel\Log\LoggerFactory::class, | ||
Hyperf\Server\Listener\AfterWorkerStartListener::class => App\Kernel\Http\WorkerStartListener::class, | ||
Psr\EventDispatcher\EventDispatcherInterface::class => App\Kernel\Event\EventDispatcherFactory::class, | ||
EasyWeChat\MiniApp\Contracts\Application::class => App\Service\Factory\WeChatFactory::class, | ||
StdoutLoggerInterface::class => LoggerFactory::class, | ||
AfterWorkerStartListener::class => WorkerStartListener::class, | ||
EventDispatcherInterface::class => EventDispatcherFactory::class, | ||
Application::class => WeChatFactory::class, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,10 +9,12 @@ | |
* @contact [email protected] | ||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE | ||
*/ | ||
use App\Exception\Handler\BusinessExceptionHandler; | ||
|
||
return [ | ||
'handler' => [ | ||
'http' => [ | ||
App\Exception\Handler\BusinessExceptionHandler::class, | ||
BusinessExceptionHandler::class, | ||
], | ||
], | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,8 +9,12 @@ | |
* @contact [email protected] | ||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE | ||
*/ | ||
use Hyperf\Command\Listener\FailToHandleListener; | ||
use Hyperf\ExceptionHandler\Listener\ErrorExceptionHandler; | ||
use Hyperf\RPCLogListener\RPCEventListener; | ||
|
||
return [ | ||
Hyperf\ExceptionHandler\Listener\ErrorExceptionHandler::class, | ||
Hyperf\Command\Listener\FailToHandleListener::class, | ||
Hyperf\RPCLogListener\RPCEventListener::class, | ||
ErrorExceptionHandler::class, | ||
FailToHandleListener::class, | ||
RPCEventListener::class, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,20 +9,23 @@ | |
* @contact [email protected] | ||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE | ||
*/ | ||
use App\Kernel\Log; | ||
use App\Kernel\Log\AppendRequestIdProcessor; | ||
use Monolog\Formatter\LineFormatter; | ||
use Monolog\Handler\StreamHandler; | ||
use Monolog\Level; | ||
|
||
return [ | ||
'default' => [ | ||
'handler' => [ | ||
'class' => Monolog\Handler\StreamHandler::class, | ||
'class' => StreamHandler::class, | ||
'constructor' => [ | ||
// 'stream' => BASE_PATH . '/runtime/logs/hyperf.log', | ||
'stream' => 'php://output', | ||
'level' => Monolog\Level::Info, | ||
'stream' => BASE_PATH . '/runtime/logs/hyperf.log', | ||
// 'stream' => 'php://output', | ||
'level' => Level::Info, | ||
], | ||
], | ||
'formatter' => [ | ||
'class' => Monolog\Formatter\LineFormatter::class, | ||
'class' => LineFormatter::class, | ||
'constructor' => [ | ||
'format' => null, | ||
'dateFormat' => 'Y-m-d H:i:s', | ||
|
@@ -31,7 +34,7 @@ | |
], | ||
'processors' => [ | ||
[ | ||
'class' => Log\AppendRequestIdProcessor::class, | ||
'class' => AppendRequestIdProcessor::class, | ||
], | ||
], | ||
], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,10 +9,14 @@ | |
* @contact [email protected] | ||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE | ||
*/ | ||
use App\Middleware\AuthMiddleware; | ||
use Han\Utils\Middleware\RequestHandledDebugMiddleware; | ||
use Hyperf\Validation\Middleware\ValidationMiddleware; | ||
|
||
return [ | ||
'http' => [ | ||
Han\Utils\Middleware\RequestHandledDebugMiddleware::class, | ||
Hyperf\Validation\Middleware\ValidationMiddleware::class, | ||
App\Middleware\AuthMiddleware::class, | ||
RequestHandledDebugMiddleware::class, | ||
ValidationMiddleware::class, | ||
AuthMiddleware::class, | ||
], | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,8 @@ | |
* @contact [email protected] | ||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE | ||
*/ | ||
use Hyperf\AsyncQueue\Process\ConsumerProcess; | ||
|
||
return [ | ||
Hyperf\AsyncQueue\Process\ConsumerProcess::class, | ||
ConsumerProcess::class, | ||
]; |
Oops, something went wrong.