Skip to content

Can't pull server names out of enviroment variable #142

Description

@curtisgibby

When you're building your list of server names, the current parsing of environment variables looks like this:

if (null !== getenv('BEANSTALK_SERVERS')) {
    foreach (explode(',', getenv('BEANSTALK_SERVERS')) as $key => $server) {
        $this->serversEnv[$key] = $server;
    }
}

I don't believe there's any way to correctly get $key from this without doing another explode (like exploding on = if your variable string were ServerA=servera.com:11300,ServerB=serverb.com:11300) or doing some other such string-wrangling a la parse_str. Do you have an example of this environment-variable format to extract both keys (human-friendly server names) and values (hostnames)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions