-
Notifications
You must be signed in to change notification settings - Fork 133
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
feat: add 'DBGroup' for customization db group #744
feat: add 'DBGroup' for customization db group #744
Conversation
In three cases, how does method shield/src/Controllers/RegisterController.php Line 103 in 35b0548
Git Note: git switch customization_db_group
code . Make the necessary changes for each file. (e.g. src/Controllers/RegisterController.php) and save. composer cs-fix
git add src/Controllers/RegisterController.php
git commit -m "add `DBGroup` for `validateData()` in RegisterController"
git push origin customization_db_group |
Set the fourth parameter: protected function validateData(array $data, $rules, array $messages = [], ?string $dbGroup = null): bool |
The php unit test failed, this is due to wrong setting of parameters. More info: Try to fix it: $this->validateData($this->request->getPost(), $rules, [], config('Auth')->DBGroup); Please also apply this change in the two files below : https://github.com/codeigniter4/shield/blob/develop/docs/addons/jwt.md |
I have completed that. I'm sorry for producing so much effort for you. This type of collaboration is new to me. |
It's okay, we've all been in your situation at some point. Well, we recently made some changes to file src/Database/Migrations/2020-12-28-223112_create_auth_tables.php, so you'll need to update your branch (customization_db_group) before continuing. This is very important. According to the sensitivity, take a backup of branch (customization_db_group) with the following command: git switch develop
git branch -m customization_db_group customization_db_group.backup1
git switch -c customization_db_group customization_db_group.backup1 Then, update branch is explained here: git fetch upstream
git switch develop
git merge upstream/develop
git push origin develop
git switch customization_db_group
git rebase upstream/develop
code . More info here After that, you should add this feature to the src/Database/Migrations/2020-12-28-223112_create_auth_tables.php file: public function __construct(?Forge $forge = null)
{
-parent::__construct($forge);
-/** @var Auth $authConfig */
-$authConfig = config('Auth');
-$this->tables = $authConfig->tables;
-$this->attributes = ($this->db->getPlatform() === 'MySQLi') ? ['ENGINE' => 'InnoDB'] : [];
}
+/** @var Auth $authConfig */
+$authConfig = config('Auth');
+$this->tables = $authConfig->tables;
+$this->attributes = ($this->db->getPlatform() === 'MySQLi') ? ['ENGINE' => 'InnoDB'] : [];
+$this->DBGroup = $authConfig->DBGroup;
+parent::__construct($forge);
git add src/Database/Migrations/2020-12-28-223112_create_auth_tables.php
git commit -m "Add `DBGroup` to migration file" And finally, run the following command
|
The migration file does not work.
https://github.com/codeigniter4/shield/actions/runs/5008438682/jobs/8977862162?pr=744 |
src/Database/Migrations/2020-12-28-223112_create_auth_tables.php
Outdated
Show resolved
Hide resolved
Co-authored-by: Pooya Parsa Dadashi <pooya_parsa_dadashi@yahoo.com>
Co-authored-by: Pooya Parsa Dadashi <pooya_parsa_dadashi@yahoo.com>
Co-authored-by: Pooya Parsa Dadashi <pooya_parsa_dadashi@yahoo.com>
For fix PHPCSFixer error: This makes certain that all submitted code is of the same format as the existing code and ensures that the codebase will be as readable as possible. You can fix most of the coding style violations by running this command in your terminal: composer cs-fix more info see: https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/pull_request.md#php-style |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
src/Database/Migrations/2020-12-28-223112_create_auth_tables.php
Outdated
Show resolved
Hide resolved
@arashsaffari No, you moved it to the wrong place. Tests failed again.
https://github.com/codeigniter4/shield/actions/runs/5029268480/jobs/9020753874?pr=744 |
@arashsaffari for merge all PRs must include phpunit test. Due to the specific circumstances of this PR, the team decided to merge without unittest. Thanks for the PR. |
Supersedes #736
Ref: #727