kebabtent / pogoprotos-php

Compiled PHP protobufs for pokemon go
MIT License
22 stars 8 forks source link

Classmap instead of psr-4 #1

Closed barryvdh closed 8 years ago

barryvdh commented 8 years ago

I don't think you can currently use PSR-4, because of the *.proto.php names.

Better would probably be to just use psr-4 naming, but not sure if that's possible. Also, if you move the git submodules outside the /src directory (you don't actually need them to use this, right?), you could also just classmap entire src dir and drop the files autoload.

jaspervdm commented 8 years ago

You are right, PSR-4 is not possible with these files. Thanks for noticing, I hadn't gotten around to actually trying to use this myself yet.

To use this, you indeed don't need the submodules (except protocolbuffers.inc.php). However I wanted a way to show which commit was used to generate the classes. If you know of a better way to do this, I am open to suggestions, I'm not too experienced with this :) Either way composer/packagist doesn't support submodules, so these directories will be empty once you get this package with composer. This is why I copied protocolbuffers.inc.php to the src/ directory

I will move the submodules and merge your pull request

barryvdh commented 8 years ago

To be honest, I would just keep add the used version to the commit like you already do. Once the protos create a tagged version, you can follow those.