communityii / yii2-user

Configurable Yii 2 user management module with social authentication and various controls
https://groups.google.com/d/forum/communityii
Other
50 stars 9 forks source link

Optimization: remove array_replace_recursive calls in setConfig in module #49

Open derekisbusy opened 9 years ago

derekisbusy commented 9 years ago

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 commented 9 years ago

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 commented 9 years ago

The social auth is broke right now.

derekisbusy commented 9 years ago

Okay never mind I see you changed it.

kartik-v commented 9 years ago

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: