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

clear class permissions var on boot #1378

Merged
merged 3 commits into from Feb 18, 2020
Merged

clear class permissions var on boot #1378

merged 3 commits into from Feb 18, 2020

Conversation

haught
Copy link
Contributor

@haught haught commented Feb 18, 2020

For long running processes like swoole, PermissionRegistrar $permissions needs to be cleared when the service provider is booted.

Fixes #1365

@drbyte
Copy link
Collaborator

drbyte commented Feb 18, 2020

Thanks @haught

While this approach is very clear and explicit, and easy to follow, and is probably best in this case, I have a tech question (call it a learning moment about Swoole ;) ) ...

Q: would merely initializing it to null via protected $permissions = null; instead of just protected $permissions; be sufficient, instead of calling a method to do it?

src/PermissionRegistrar.php Outdated Show resolved Hide resolved
@drbyte drbyte merged commit cff803f into spatie:master Feb 18, 2020
ThanhSonITNIC pushed a commit to ThanhSonITNIC/laravel-permission that referenced this pull request Apr 13, 2020
For long running processes like swoole, PermissionRegistrar $permissions needs to be cleared when the service provider is booted.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Swoole and permissions
2 participants