ua-parser / uap-php

PHP implementation of ua-parser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

regexp.php file should be shipped with composer package

JustBlackBird opened this issue · comments

At the moment there is no regexp.php file in the composer package thus it does not work right out of the box. If someone uses a package that depends on ua-parser/ua-parser he must know too much about package's internals.

I suggest to add regexp.php to the composer's package.

👍 We have a custom bin location, and had to fork and modify the repo to make the download script to work.

@lucky7id I had a problem with CLI script too but it fixed now (see #7).

The option I would see is to add a sync job to the command line tool that syncs both test resources and regex.json and also creates the php file and commit all three of them. The benefit is that the package works out of the box, a fact I very much like. What I dislike is the fact that we have to actively release a new version once uap-core is updated. Opinions?

I see several options:

  • use git submodules
  • move regexp file to a separated package and add it to composer dependencies.

The composer scheme seems workable. Right now it's a very noticeable pain point among our team, having to update that every time.

The composer package variant would be even more hassle I suppose. I am thinking about having a cronjob that updates the regex.php nightly, runs the unit tests and automatically commits if the tests passed successfully. If not, manual intervention is needed.

@lstrojny don't you think that changes of PHP implementation and regexp should be separated?

@JustBlackBird it would be nicer indeed but we would still need to find a way to auto-update that package whenever uap-core changes + run the tests of uap-php. Given that I’m not sure it’s worth the trouble.

@lstrojny may be you are right. I'm only afraid of rapid increasing of the package's patch version.

@JustBlackBird let’s see how it goes. Closing the issue for now.