Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Namespacing the MaxMind GeoIP2 library causes the creation of duplicate files #145

Open
daigo75 opened this issue Feb 16, 2024 · 1 comment

Comments

@daigo75
Copy link

daigo75 commented Feb 16, 2024

I'm using a simple test configuration for mozart, as follows:

"mozart": {
	"dep_namespace": "\Dependencies\\",
	"dep_directory": "/dependencies/packages/",
	"classmap_directory": "/dependencies/classes/",
	"classmap_prefix": "Deps_",
	"packages": [
		"geoip2/geoip2"
	],
	"delete_vendor_directories": true
}

Composer downloads the GeoIP2 files, which also have dependencies on packages maxmind-db/reader and maxmind/web-service-common. So far, so good. When mozart does its job, the dependencies directory contains a duplicate of the MaxMind WebService package. This raises a series of warnings, like the following:
Warning: Ambiguous class resolution, "MaxMind\Exception\AuthenticationException" was found in both "/src/dependencies/packages/MaxMind/WebService/AuthenticationException.php" and "/src/dependencies/packages/MaxMind/WebService/vendor/maxmind/web-service-common/src/Exception/AuthenticationException.php", the first will be used.

The issue is the presence of folder /src/dependencies/packages/MaxMind/WebService/vendor/. For some reason, it seems that the namespacing process is causing the WebService library to "include itself", introducing duplicates of its files.

I haven't been able to find the root cause of the issue yet, so I thought of sharing this finding in case someone comes across it and has an ide of how to address it.

@daigo75 daigo75 changed the title Can't seem to find a way to namespace the MaxMind GeoIP2 library Namespacing the MaxMind GeoIP2 library causes the creation of duplicate files Feb 16, 2024
@daigo75
Copy link
Author

daigo75 commented Jun 17, 2024

Hi there,
Just checking if there is any update about this. Thanks.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant