-
Notifications
You must be signed in to change notification settings - Fork 76
Open
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationenhancementNew feature or requestNew feature or request
Description
Description
Is there an idiomatic way to access superglobals?
I needed to access $_COOKIE and I've resorted to
let cookie = Function::try_from_function("filter_input")
.ok_or_else(|| anyhow!("filter_input is not available"))?
.try_call(vec![&INPUT_COOKIE, &self.cookie_name, &FILTER_DEFAULT])
.map_err(|err| anyhow!("Could not call filter_input: {}", err))?
.string();
It would be nice to access PHP constants, too. For now I am just defining them in Rust.
Additional Context
- I can try implementing this feature myself (please assign me to this issue)
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationenhancementNew feature or requestNew feature or request