Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
phpdts
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nemo Ma
phpdts
Commits
74f2700d
Commit
74f2700d
authored
Mar 31, 2023
by
nahakyuu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add database support & add dev doc
parent
460a7337
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
366 additions
and
14 deletions
+366
-14
README.md
README.md
+4
-1
composer.json
composer.json
+4
-1
composer.lock
composer.lock
+314
-9
config/common/di/yii-connection.php
config/common/di/yii-connection.php
+21
-0
config/common/params.php
config/common/params.php
+21
-0
config/web/di/yii-application.php
config/web/di/yii-application.php
+2
-3
No files found.
README.md
View file @
74f2700d
...
@@ -38,4 +38,7 @@ bash ./bot/bot_enable.sh
...
@@ -38,4 +38,7 @@ bash ./bot/bot_enable.sh
passthru('"' . PHP_BINARY . '"' . " -S $address -t \"$documentRoot\" $router");
passthru('"' . PHP_BINARY . '"' . " -S $address -t \"$documentRoot\" $router");
```
```
3.
修改
`config/configuration.php`
之后一定要运行
`composer du`
来重新生成
`.merge-plan.php`
3.
修改
`config/configuration.php`
之后一定要运行
`composer du`
来重新生成
`.merge-plan.php`
4.
目前只加入了
`src`
和
`config`
文件夹,demo文件见
`C:\git\phpdts\src\Controller\HomeController.php`
4.
目前只加入了
`src`
和
`config`
文件夹,demo文件见
`C:\git\phpdts\src\Controller\HomeController.php`
\ No newline at end of file
5.
可以使用
[
Yii Dev Panel
](
https://yiisoft.github.io/yii-dev-panel
)
来调试
6.
数据库配置请修改
`config\common\params.php`
,默认使用
`Yiisoft\Db\Mysql\ConnectionPDO`
7.
目前只用了
`yii serve`
使用php原生自带的Routing file功能做路由,nginx和
`.htaccess`
在做了在做了
\ No newline at end of file
composer.json
View file @
74f2700d
...
@@ -24,10 +24,13 @@
...
@@ -24,10 +24,13 @@
"
psr/log
"
:
"
^3.0
"
,
"
psr/log
"
:
"
^3.0
"
,
"
psr/simple-cache
"
:
"
^3.0
"
,
"
psr/simple-cache
"
:
"
^3.0
"
,
"
vlucas/phpdotenv
"
:
"
^5.5
"
,
"
vlucas/phpdotenv
"
:
"
^5.5
"
,
"
yiisoft/active-record
"
:
"
dev-master
"
,
"
yiisoft/aliases
"
:
"
^3.0
"
,
"
yiisoft/aliases
"
:
"
^3.0
"
,
"
yiisoft/config
"
:
"
^1.1
"
,
"
yiisoft/config
"
:
"
^1.1
"
,
"
yiisoft/csrf
"
:
"
^2.0
"
,
"
yiisoft/csrf
"
:
"
^2.0
"
,
"
yiisoft/data-response
"
:
"
^2.0
"
,
"
yiisoft/data-response
"
:
"
^2.0
"
,
"
yiisoft/db
"
:
"
dev-master
"
,
"
yiisoft/db-mysql
"
:
"
dev-master
"
,
"
yiisoft/definitions
"
:
"
^3.2
"
,
"
yiisoft/definitions
"
:
"
^3.2
"
,
"
yiisoft/log
"
:
"
^2.0
"
,
"
yiisoft/log
"
:
"
^2.0
"
,
"
yiisoft/middleware-dispatcher
"
:
"
^5.0
"
,
"
yiisoft/middleware-dispatcher
"
:
"
^5.0
"
,
...
@@ -40,7 +43,7 @@
...
@@ -40,7 +43,7 @@
"require-dev"
:
{
"require-dev"
:
{
"
rector/rector
"
:
"
^0.15.23
"
,
"
rector/rector
"
:
"
^0.15.23
"
,
"
yiisoft/request-model
"
:
"
dev-master
"
,
"
yiisoft/request-model
"
:
"
dev-master
"
,
"
yiisoft/yii-debug
"
:
"
dev-master
#20b397a336d7f31a227ac4f5f75d8c8d81ae0b89
"
,
"
yiisoft/yii-debug
"
:
"
dev-master
"
,
"
yiisoft/yii-debug-api
"
:
"
dev-master
"
,
"
yiisoft/yii-debug-api
"
:
"
dev-master
"
,
"
yiisoft/yii-gii
"
:
"
dev-master
"
,
"
yiisoft/yii-gii
"
:
"
dev-master
"
,
"
yiisoft/yii-middleware
"
:
"
dev-master
"
,
"
yiisoft/yii-middleware
"
:
"
dev-master
"
,
...
...
composer.lock
View file @
74f2700d
This diff is collapsed.
Click to expand it.
config/common/di/yii-connection.php
0 → 100644
View file @
74f2700d
<?php
declare
(
strict_types
=
1
);
use
Yiisoft\Db\Connection\ConnectionInterface
;
use
Yiisoft\Db\Mysql\ConnectionPDO
;
use
Yiisoft\Db\Driver\PDO\PDODriverInterface
;
use
Yiisoft\Db\Mysql\PDODriver
;
return
[
ConnectionInterface
::
class
=>
ConnectionPDO
::
class
,
PDODriverInterface
::
class
=>
PDODriver
::
class
,
PDODriver
::
class
=>
[
'__construct()'
=>
[
'dsn'
=>
$params
[
'db'
][
'dsn'
],
'username'
=>
$params
[
'db'
][
'username'
],
'password'
=>
$params
[
'db'
][
'password'
],
]
]
];
config/common/params.php
View file @
74f2700d
...
@@ -2,6 +2,18 @@
...
@@ -2,6 +2,18 @@
declare
(
strict_types
=
1
);
declare
(
strict_types
=
1
);
use
Yiisoft\Db\Mysql\Dsn
;
$db
=
[
'driver'
=>
'mysql'
,
'host'
=>
'localhost'
,
'databaseName'
=>
'acdts3'
,
'port'
=>
'3306'
,
'options'
=>
[
'charset'
=>
'utf8mb4'
],
'username'
=>
'root'
,
'password'
=>
'mylittlepony'
,
];
return
[
return
[
'app'
=>
[
'app'
=>
[
'charset'
=>
'UTF-8'
,
'charset'
=>
'UTF-8'
,
...
@@ -20,4 +32,13 @@ return [
...
@@ -20,4 +32,13 @@ return [
'@vendor'
=>
'@root/vendor'
,
'@vendor'
=>
'@root/vendor'
,
],
],
],
],
'db'
=>
array_merge
(
$db
,
[
'dsn'
=>
(
new
Dsn
(
$db
[
'driver'
],
$db
[
'host'
],
$db
[
'databaseName'
],
$db
[
'port'
],
$db
[
'options'
]
))
->
asString
(),
]),
];
];
config/web/di/yii-application.php
View file @
74f2700d
<?php
<?php
declare
(
strict_types
=
1
);
use
Yiisoft\Definitions\DynamicReference
;
use
Yiisoft\Definitions\DynamicReference
;
use
Yiisoft\Definitions\Reference
;
use
Yiisoft\Definitions\Reference
;
use
Yiisoft\Definitions\ReferencesArray
;
use
Yiisoft\Middleware\Dispatcher\MiddlewareDispatcher
;
use
Yiisoft\Middleware\Dispatcher\MiddlewareDispatcher
;
use
Yiisoft\Yii\Http\Handler\NotFoundHandler
;
use
Yiisoft\Yii\Http\Handler\NotFoundHandler
;
use
Yiisoft\Session\SessionMiddleware
;
use
Yiisoft\Session\SessionMiddleware
;
use
Yiisoft\Csrf\CsrfMiddleware
;
use
Yiisoft\Csrf\CsrfMiddleware
;
use
Yiisoft\Router\Middleware\Router
;
use
Yiisoft\Router\Middleware\Router
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment