Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Error File already exists at path #135

Open
kupoback opened this issue Aug 19, 2021 · 3 comments
Open

Error File already exists at path #135

kupoback opened this issue Aug 19, 2021 · 3 comments

Comments

@kupoback
Copy link

I'm trying to use this package over php-scoper, as php-scoper is rather complicated and confusing to implement, however, when I try to run vendor/bin/mozart compose I keep running into this error:

In Filesystem.php line 406:
  File already exists at path: vendor_prefix/packages/Doctrine/Inflector/Inflector.php  

I've tried to do what was suggested here, but that didn't resolve anything for me.

This is my package.json

{
	"name": "cs/ms-scraper",
	"require": {
		"php": ">=7.4",
		"illuminate/support": "^5.6",
		"guzzlehttp/guzzle": "^7.3",
		"mailjet/mailjet-apiv3-php": "^1.5",
		"monolog/monolog": "^2.3",
		"10quality/wp-query-builder": "^1.0",
		"nesbot/carbon": "^2.31"
	},
	"require-dev": {
		"squizlabs/php_codesniffer": "^3.5",
		"roave/security-advisories": "dev-master",
		"coenjacobs/mozart": "dev-master",
		"cweagans/composer-patches": "*"
	},
	"config": {
		"optimize-autoloader": true,
		"preferred-install": "dist"
	},
	"minimum-stability": "dev",
	"prefer-stable": true,
	"scripts": {
		"post-root-package-install": [
			"\"vendor/bin/mozart\" compose",
			"composer dump-autoload"
		],
		"post-root-package-update": [
			"\"vendor/bin/mozart\" compose",
			"composer dump-autoload"
		],
		"test": [
			"phpcs"
		]
	},
	"extra": {
		"mozart": {
			"dep_namespace": "MS\\Vendor\\",
			"dep_directory": "/vendor_prefix/packages/",
			"classmap_directory": "/vendor_prefix/classes/",
			"classmap_prefix": "MS_",
			"delete_vendor_directories": true
		}
	}
}

Any suggestions?

@kupoback
Copy link
Author

When I try to add the patches to the composer.json file, I get this:

- Applying patches for coenjacobs/mozart
    https://github.com/coenjacobs/mozart/pull/91.patch (Move each file only once (classmap))
   Could not apply patch! Skipping. The error was: Cannot apply patch https://github.com/coenjacobs/mozart/pull/91.patch

I added it under my extra field like so, based on the #89 issue.

"patches": {
    "coenjacobs/mozart": {
        "Move each file only once (classmap)": "https://github.com/coenjacobs/mozart/pull/91.patch"
    }
},

@Dartui
Copy link

Dartui commented Mar 2, 2022

@kupoback check #136, you can also use it as patch in composer.json

@kupoback
Copy link
Author

So, understandably due to availability, this took a bit long to get back to me on and I had to move off of using this. However, coming back to it on another project, I am now encountering a new error, where I am getting the following message in terminal.

In my classmap_directory if I remove the trailing slash, it works until another error appears, but I'm not exactly sure what is going on, or what I am missing.

In Finder.php line 592:
                                                                                                                                           
  The "/home/user/Sites/functionplayground/web/app/plugins/rap-site-reset/vendor_prefix/classes//wp-cli/wp-cli" directory does not exist.  
                                                                                                                                           

compose

This is my composer.json file, if I messed anything up, but I don't think I am missing anything?

{
	"name": "kupoback/rap-site-reset",
	"description": "",
	"type": "wordpress-muplugin",
	"require": {
		"composer/installers": "^2.0",
		"ext-json": "*",
		"illuminate/support": "^7.0",
		"php": ">=7.4",
		"phpseclib/phpseclib": "dev-master",
		"wp-cli/db-command": "^2.0",
		"wp-cli/extension-command": "^2.0",
		"wp-cli/maintenance-mode-command": "2.x-dev"
	},
	"require-dev": {
		"squizlabs/php_codesniffer": "4.0.x-dev",
		"roave/security-advisories": "dev-master",
		"coenjacobs/mozart": "dev-master",
		"cweagans/composer-patches": "*"
	},
	"config": {
		"optimize-autoloader": true,
		"preferred-install": "dist",
		"allow-plugins": {
			"composer/installers": true,
			"cweagans/composer-patches": true
		}
	},
	"license": "MIT",
	"scripts": {
		"post-root-package-install": [
			"\"vendor/bin/mozart\" compose",
			"composer dump-autoload"
		],
		"post-root-package-update": [
			"\"vendor/bin/mozart\" compose",
			"composer dump-autoload"
		],
		"test": [
			"phpcs"
		]
	},
	"authors": [
		{
			"name": "kupoback"
		}
	],
	"minimum-stability": "dev",
	"extra": {
		"mozart": {
			"classmap_directory": "/vendor_prefix/classes/",
			"classmap_prefix": "RapReset_",
			"delete_vendor_directories": false,
			"dep_directory": "/vendor_prefix/packages/",
			"dep_namespace": "RapReset\\Vendor\\"
		},
		"patches": {
			"coenjacobs/mozart": {
				"Move each file only once (classmap)": "https://github.com/coenjacobs/mozart/pull/91.patch",
				"Skip duplicate files": "https://github.com/coenjacobs/mozart/pull/136.patch"
			}
		}
	}
}

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

No branches or pull requests

2 participants