2023-07-18 10:00:03 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
2023-09-19 18:22:47 +08:00
|
|
|
|
2025-08-18 14:08:30 +08:00
|
|
|
use Hyperf\Config\Config;
|
2023-09-19 18:22:47 +08:00
|
|
|
use Hyperf\Context\ApplicationContext;
|
2025-08-18 14:08:30 +08:00
|
|
|
use Hyperf\Contract\ConfigInterface;
|
|
|
|
|
use Hyperf\Di\ClassLoader;
|
2023-09-19 18:22:47 +08:00
|
|
|
use Hyperf\Di\Container;
|
|
|
|
|
use Hyperf\Di\Definition\DefinitionSource;
|
2025-08-18 14:08:30 +08:00
|
|
|
use Swoole\Runtime;
|
|
|
|
|
|
|
|
|
|
use function Hyperf\Support\env;
|
|
|
|
|
use function Hyperf\Support\make;
|
2023-09-19 18:22:47 +08:00
|
|
|
|
2023-07-18 10:00:03 +08:00
|
|
|
ini_set('display_errors', 'on');
|
|
|
|
|
ini_set('display_startup_errors', 'on');
|
|
|
|
|
|
|
|
|
|
error_reporting(E_ALL);
|
|
|
|
|
date_default_timezone_set('Asia/Shanghai');
|
2023-09-19 18:22:47 +08:00
|
|
|
|
2025-08-18 14:08:30 +08:00
|
|
|
|
2023-09-19 18:22:47 +08:00
|
|
|
!defined('BASE_PATH') && define('BASE_PATH', dirname(__DIR__, 1));
|
|
|
|
|
!defined('SWOOLE_HOOK_FLAGS') && define('SWOOLE_HOOK_FLAGS', SWOOLE_HOOK_ALL);
|
|
|
|
|
|
2025-08-18 14:08:30 +08:00
|
|
|
Runtime::enableCoroutine(SWOOLE_HOOK_FLAGS);
|
2023-09-19 18:22:47 +08:00
|
|
|
|
|
|
|
|
require BASE_PATH . '/vendor/autoload.php';
|
2025-08-18 14:08:30 +08:00
|
|
|
ClassLoader::init();
|
2023-09-19 18:22:47 +08:00
|
|
|
|
|
|
|
|
$container = new Container(new DefinitionSource([]));
|
2025-08-18 14:08:30 +08:00
|
|
|
$container = ApplicationContext::setContainer($container);
|
|
|
|
|
|
|
|
|
|
/** @var Config $config */
|
|
|
|
|
$config = make(Config::class, [
|
|
|
|
|
[
|
2025-08-18 19:12:07 +08:00
|
|
|
'app_name' => 'LuxDesign',
|
2025-08-18 14:08:30 +08:00
|
|
|
'dependencies' => [],
|
|
|
|
|
'payment' => [
|
|
|
|
|
'base_uri' => env('LUX_PAY_BASE_URI', 'http://test-pay.luxcreo.com'),
|
|
|
|
|
],
|
|
|
|
|
],
|
|
|
|
|
]);
|
|
|
|
|
ApplicationContext::getContainer()->set(ConfigInterface::class, $config);
|