Skip to content
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

Optimization: remove array_replace_recursive calls in setConfig in module #49

Open
derekisbusy opened this issue Nov 15, 2015 · 4 comments

Comments

@derekisbusy
Copy link
Contributor

Instead of using array_replace_recursive to set all the defaults every time the module loads should switch the code to use the Module::getSetting() and related functions ie. getRegistrationSetting()

So in the controller you would use

$this->module->getSocialSetting('enabled');

This way the defaults are only loaded when needed.

Or we could remove the getSocialSettings and variable from the module and make components out of all the settings and attach them to the user component.

Yii::$app->user->social->enabled;

This way components and defaults are only set when needed.

@kartik-v
Copy link
Member

Sure go ahead. I have pushed updates for social auth in #40.

Thinking ahead... this now needs some test cases (codeception or similar) for ensuring changes do not break.

@derekisbusy
Copy link
Contributor Author

The social auth is broke right now.

@derekisbusy
Copy link
Contributor Author

Okay never mind I see you changed it.

@kartik-v
Copy link
Member

Yes social auth has been redone by me. It should work - need to add all the Auth clients (have done for Google, Facebook and Twitter).

Following needs to be noted and done:

  • Removing array_replace_recursive would adversely impact many code areas including defaults that are used in views, widgets as well. Need to be really careful in doing this.
  • Testing is important from here. Would suggest if you can help build test cases in a new folder tests to test each of these. I can help add and augment the same as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants