Title: Modernization of the library to make it usable in modern PHP applications by coogle · Pull Request #4 · mapcode-foundation/mapcode-php · GitHub
Open Graph Title: Modernization of the library to make it usable in modern PHP applications by coogle · Pull Request #4 · mapcode-foundation/mapcode-php
X Title: Modernization of the library to make it usable in modern PHP applications by coogle · Pull Request #4 · mapcode-foundation/mapcode-php
Description: Currently this SDK isn't really usable in modern PHP applications due to it's vast usage of the global namespace which has long since been retired as a best practice. Additionally, it does not have the metadata needed to be included into modern PHP projects via the PHP package manager composer. This PR fixes both issues. Essentially what I've done is a simple wrapping of all the global namespaced functions into the Mapcode namespace. I then created an object to hold all the global variables / lookup tables MapcodeData and updated all the references to $GLOBALS to use the MapcodeData::$varname equivalent`. I also cleaned up the autoloading a tad and added a composer.json which can then be registered at https://packagist.org so others can easily use the library. Along with these changes I updated the sample, unit tests (all passing), and documentation to reflect how it can be used. I updated the version to 2.3.0, although I think arguably it would make sense to call this 3.0.0. All of these changes were necessary in order to use the library in any sort of professional PHP application context, and if necessary we'll maintain this as our own fork of the original SDK -- but I'd love to see this PR merged so we won't have to do that!
Open Graph Description: Currently this SDK isn't really usable in modern PHP applications due to it's vast usage of the global namespace which has long since been retired as a best practice. Additionally, it does ...
X Description: Currently this SDK isn't really usable in modern PHP applications due to it's vast usage of the global namespace which has long since been retired as a best practice. Additionally, ...
Opengraph URL: https://github.com/mapcode-foundation/mapcode-php/pull/4
X: @github
Domain: patch-diff.githubusercontent.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:27349ffb-d599-8103-79df-5fe776b0f31b |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | AD60:91A22:10916D3:1574C32:69752207 |
| html-safe-nonce | 246910551a3dfb9670473727f1369f1717f48d989c0583abf96e39f5ff750f77 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRDYwOjkxQTIyOjEwOTE2RDM6MTU3NEMzMjo2OTc1MjIwNyIsInZpc2l0b3JfaWQiOiI5MTI0NTcxNzEwNDU4NTAzNjg3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 79fac2355609d0b2666e53667731804658c88896f7460b1531f44a2ed55ad144 |
| hovercard-subject-tag | pull_request:1647119793 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/mapcode-foundation/mapcode-php/pull/4/files |
| twitter:image | https://avatars.githubusercontent.com/u/1863471?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1863471?s=400&v=4 |
| og:image:alt | Currently this SDK isn't really usable in modern PHP applications due to it's vast usage of the global namespace which has long since been retired as a best practice. Additionally, it does ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4a4bf5f4e28041a9d2e5c107d7d20b78b4294ba261cab243b28167c16a623a1f |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/mapcode-foundation/mapcode-php git https://github.com/mapcode-foundation/mapcode-php.git |
| octolytics-dimension-user_id | 8832474 |
| octolytics-dimension-user_login | mapcode-foundation |
| octolytics-dimension-repository_id | 40119124 |
| octolytics-dimension-repository_nwo | mapcode-foundation/mapcode-php |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 40119124 |
| octolytics-dimension-repository_network_root_nwo | mapcode-foundation/mapcode-php |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 488b30e96dfd057fbbe44c6665ccbc030b729dde |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width