Hello, I'm taking the 3.1 RC for a spin and planning an integration with an existing CMS. First let me say I appreciate the new events dispatcher a lot.
My question is about super globals. For reasons I would rather not rehash, I need them on. I see that the constructor for the \phpbb\request class has a second parameter which controls this. The class also has an enable_super_globals() function. What would be the most correct way to do this without editing any core files?
Thanks.
Integration question about globals
Forum rules
Please do not post support questions regarding installing, updating, or upgrading phpBB 3.3.x. If you need support for phpBB 3.3.x please visit the 3.3.x Support Forum on phpbb.com.
If you have questions regarding writing extensions please post in Extension Writers Discussion to receive proper guidance from our staff and community.
Please do not post support questions regarding installing, updating, or upgrading phpBB 3.3.x. If you need support for phpBB 3.3.x please visit the 3.3.x Support Forum on phpbb.com.
If you have questions regarding writing extensions please post in Extension Writers Discussion to receive proper guidance from our staff and community.
Re: Integration question about globals
It looks like you can just call $request->enable_super_globals();
https://github.com/phpbb/phpbb/blob/dev ... hp#L71-L74
https://github.com/phpbb/phpbb/blob/dev ... hp#L71-L74
Has an irascible disposition.
Re: Integration question about globals
it could work if in your extension you override the request service like this: (but i'm not sure^^)
EDIT: but it could be better to call enable_super_globals
Code: Select all
request:
class: phpbb\request\request
arguments:
- null
- false
Member of the phpBB Development-Team
No Support via PM
No Support via PM
Re: Integration question about globals
Nicofuma's approach worked, although I don't know if that has any other consequences (like passing null for the first parameter). Would it?
I got tripped up a bit since I didn't know about clearing the cache after changing that file.
I got tripped up a bit since I didn't know about clearing the cache after changing that file.
Re: Integration question about globals
indeed, when you change the configuration of the container (services.yml) you need to purge the cache or to disable/re-enable your extension.
About the null parameter it will not change anything the core use: (if i expand the default parameters)
About the null parameter it will not change anything the core use: (if i expand the default parameters)
Code: Select all
request:
class: phpbb\request\request
arguments:
- null
- true
Member of the phpBB Development-Team
No Support via PM
No Support via PM
- bantu
- 3.0 Release Manager
- Posts: 557
- Joined: Thu Sep 07, 2006 11:22 am
- Location: Karlsruhe, Germany
- Contact:
Re: Integration question about globals
Calling that method is the intended way to get back super globals.omniError wrote:The class also has an enable_super_globals() function. What would be the most correct way to do this without editing any core files?