Customization db group#736
Customization db group#736arashsaffari wants to merge 3 commits intocodeigniter4:developfrom arashsaffari:customization_db_group
Conversation
|
You signed only one commit, but we need you to sign all your commits. Don't use |
|
Read this: https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/pull_request.md And if you don't know git well, it may be better to create new another PR. |
|
@arashsaffari , first of all I want to make sure which of the following: git config --global commit.gpgsign trueThen run the following command: git config --global user.signingkey 5FE32B838BA49CD5The above causes all commits to be signed automatically from now on. git fetch upstream
git switch develop
git merge upstream/develop
git switch customization_db_group
git branch -m customization_db_group customization_db_group.bk1
git switch -c customization_db_group develop
code .After that, change src/Config/Auth.php and src/Models/BaseModel.php and run: composer cs-fixgit add .
git commit -m "feat: add `DBGroup` for customization db group"
git push -f origin customization_db_group |
|
@arashsaffari I tried to implement this feature in the branch below. If you find the time to test it, please let us know. https://github.com/datamweb/shield/tree/add_customization_db_group Edit your composer.json: --- a/composer.json
+++ b/composer.json
@@ -7,7 +7,8 @@
"require": {
"php": "^7.4 || ^8.0",
"codeigniter4/framework": "^4.0",
- "codeigniter4/shield": "^1.0@beta"
+ "codeigniter4/shield": "dev-add_customization_db_group"
},
+ "minimum-stability": "dev",
+ "prefer-stable": true,
+ "repositories": [
+ {
+ "type": "vcs",
+ "url": "https://github.com/datamweb/shield.git"
+ }
+ ],
}Run: composer updateAdd custom database connection in app/Config/Database.php: /**
* The my custom database connection.
*/
public array $myDbGroup= [
'DSN' => '',
'hostname' => 'localhost',
'username' => 'rootxxx',
'password' => 'xxx',
'database' => 'xxx',
'DBDriver' => 'MySQLi',
'DBPrefix' => '',
'pConnect' => false,
'DBDebug' => true,
'charset' => 'utf8',
'DBCollat' => 'utf8_general_ci',
'swapPre' => '',
'encrypt' => false,
'compress' => false,
'strictOn' => false,
'failover' => [],
'port' => 3306,
];Edit your Auth.php: -public $dbGroupName;
+public $dbGroupName = 'myDbGroup'; |
|
The first commit is not signed. And please update your branch to pass GitHub Action Psalm check. |

This modification is made to add the capability of changing the name of the database connection. #727
Please note that the variable "DBGroup" cannot be changed in the "initialize()" function. It needs to be changed in the "__construct()" function.