From a0779c544f37a7f9643f5526ab498f6e0996e81b Mon Sep 17 00:00:00 2001 From: yuenblue <1192129692@qq.com> Date: Wed, 20 Mar 2024 23:24:43 +0800 Subject: [PATCH] config env --- demotp6/.env.example | 1 + demotp6/tests/DemoTp6.php | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 demotp6/.env.example create mode 100644 demotp6/tests/DemoTp6.php diff --git a/demotp6/.env.example b/demotp6/.env.example new file mode 100644 index 0000000..c27f74c --- /dev/null +++ b/demotp6/.env.example @@ -0,0 +1 @@ +APP_DEBUG = true [APP] DEFAULT_TIMEZONE = Asia/Shanghai [DATABASE] TYPE = mysql HOSTNAME = 127.0.0.1 DATABASE = test USERNAME = username PASSWORD = password HOSTPORT = 3306 CHARSET = utf8 DEBUG = true [LANG] default_lang = zh-cn \ No newline at end of file diff --git a/demotp6/tests/DemoTp6.php b/demotp6/tests/DemoTp6.php new file mode 100644 index 0000000..08fcee6 --- /dev/null +++ b/demotp6/tests/DemoTp6.php @@ -0,0 +1,25 @@ +setEnvName('example')->http; + $response = $http->run(); + } + function testAa() { + + // assertTrue(function_exists('env')); + $app = app(); + assertTrue(true); + $aa=Config::get("app.with_route"); + var_dump($aa); + $bb=env('database.type'); + $cc=env("database.HOSTPORT"); + var_dump($bb,$cc); + } +} \ No newline at end of file -- GitLab