-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Customization db group #736
Customization db group #736
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 true Then run the following command: git config --global user.signingkey 5FE32B838BA49CD5 The 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-fix git 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 update Add 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.