GaretJax / phpbrowscap

Standalone replacement for php's native get_browser() function
MIT License
429 stars 69 forks source link

[Proposal] change default indexes to lowercase #44

Open remluben opened 10 years ago

remluben commented 10 years ago

Hello, I am currently using the Browscap class within one of my projects and when installing it the first time, I was wondering why the default indexes where camelcase instead of lowercase.

Somehow I expected the indexes to be lowercase as the php get_browser() function returns them as lowercase too.

Is there a special reason why the default was chosen not to be lowercase?

If this propasal seems weird or senseless to you, please do not hesitate to trash it.

andyfeller commented 10 years ago

This is supported by setting the lowercase properties to true whenever you instantiate the object

    /**
     * Flag to enable only lowercase indexes in the result.
     * The cache has to be rebuilt in order to apply this option.
     *
     * @var bool
     */
    public $lowercase = false;

It would be nice to mention this in the documentation for drop-in get_browser() support.

mimmi20 commented 10 years ago

Information is added to the wiki

andyfeller commented 10 years ago

Awesome! Thanks ^^