phpbrowscap icon indicating copy to clipboard operation
phpbrowscap copied to clipboard

Provide a setter for public property "localfile"

Open sweiguny opened this issue 7 years ago • 1 comments

I am using symfony and phpbrowscap as service defined in services.yml.

currently, my definition in services.yml look like this:

browscap:
        class: phpbrowscap\Browscap
        arguments:
            - %browscap_cache_dir%

I'd like to set the property "localfile" initially, but thats not possible in services.yml, because it only allows to inject variables in the constructor and/or additionally calling a certain setter.

having this setter would help here. i personally don't see a reason for not having a setter.

sweiguny avatar Jul 24 '17 11:07 sweiguny

Fixed that by adding this:

        properties:
            localfile: %browscap_ini%

but anyway, a setter would be great.

as i am facing the issue, that browscap loads the file from the server, even when i set localfile, i think the setter should also prevent the class to load the file from the server.

sweiguny avatar Jul 24 '17 12:07 sweiguny