CoderKungfu / php-queue

A unified front-end for different queuing backends. Includes a REST server, CLI interface and daemon runners.
https://packagist.org/packages/coderkungfu/php-queue
663 stars 67 forks source link

Tighten up configuration #42

Open adamwight opened 9 years ago

adamwight commented 9 years ago

Interfaces\Config is unused. Tests and demo applications should be locally configured with a single file config.yaml.example, rather than in code.

I don't know what the config data should look like. It would be nice to include backend dependency injection, as well as defaults for each backend, but this seems like an overly complicated configuration file, it would look something like:

stomp:
    uri: tcp://host.localhost.net:61613
    read_timeout: 10

queues:
    test_stomp:
        backend: Stomp
miccheng commented 9 years ago

Hmm... Does PHP have a sane and build in YAML parser yet?

adamwight commented 9 years ago

I think package symfony/yaml is a good one, it's standalone and pure PHP.

On another note, sometimes we might want to provide configuration from calling code. Config::fromFile() and Config::fromArray() ?