Skip to content

Document super globals #499

@kakserpom

Description

@kakserpom

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

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions