geoip-detect icon indicating copy to clipboard operation
geoip-detect copied to clipboard

Prefix Composer packages

Open benjaminpick opened this issue 3 years ago • 3 comments

https://developer.yoast.com/blog/safely-using-php-dependencies-in-the-wordpress-ecosystem/

benjaminpick avatar Jan 21 '22 11:01 benjaminpick

https://deliciousbrains.com/php-scoper-namespace-composer-depencies/#config

benjaminpick avatar Jan 21 '22 12:01 benjaminpick

https://dev.to/phpprefixer/new-tutorial-using-php-composer-in-the-wordpress-ecosystem-4bmp

benjaminpick avatar Jan 21 '22 12:01 benjaminpick

(Note from Diego, author of Aelia plugins)

For what concerns the namespacing of the dependency, I would suggest to use Mozart instead of PHP Scoper. It requires a simple configuration, which could be as simple as the following:

"mozart": { "dep_namespace": "YellowTree\Dependencies\", "dep_directory": "/dependencies/packages/", "classmap_directory": "/dependencies/classes/", "classmap_prefix": "YellowTree_", "packages": [ "geoip2/geoip2", "maxmind-db/reader", "maxmind/web-service-common" ], "delete_vendor_directories": true }

benjaminpick avatar Mar 15 '24 11:03 benjaminpick