zfcampus / zf-apigility-admin

Admin API and UI for Apigility
BSD 3-Clause "New" or "Revised" License
90 stars 64 forks source link

Fix detecting api versions (PSR-4 + ModuleManager) #357

Closed michalbundyra closed 8 years ago

michalbundyra commented 8 years ago

This path fixes detecting version for modules with autoloading:

The second one, in particular, was unable to detect available versions due to a difference in where the Module class is stored in the module tree.

weierophinney commented 8 years ago

Here's a slightly different version: https://gist.github.com/weierophinney/7b9628281b562ddb25a134fd9f71c62c

This version takes into account differing directory separators when doing the PCRE operation. It also moves the logic into a separate method so as to keep the getVersionsByModule() method cleaner.