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

Bug: Files being copied into root of dep_directory #126

Open
BrianHenryIE opened this issue Feb 18, 2021 · 1 comment
Open

Bug: Files being copied into root of dep_directory #126

BrianHenryIE opened this issue Feb 18, 2021 · 1 comment

Comments

@BrianHenryIE
Copy link
Contributor

Using easypost/easypost-php which has autoloader:

"autoload": {
  "psr-0": {
    "EasyPost": "lib/"
  }
}

It copies files into Mozart's dep_directory that should be moved to expected dep_directory/EasyPost.

EasyPost's lib folder contains two files and a directory called EasyPost.

Output should be dep_directory/EasyPost/files.ext and dep_directory/EasyPost/EasyPost/morefiles.ext.

Output is dep_directory/files.ext and dep_directory/EasyPost/morefiles.ext.

{
  "minimum-stability": "dev",
  "prefer-stable": true,
  "require": {
    "easypost/easypost-php": "^3.4"
  },
  "require-dev": {
    "coenjacobs/mozart": "dev-master#3b1243ca8505fa6436569800dc34269178930f39"
  },
  "extra": {
    "mozart": {
      "dep_namespace": "Mozart",
      "dep_directory": "/src/Mozart/dep_directory/",
      "classmap_prefix": "Mozart_",
      "classmap_directory": "/src/Mozart/Classes/"
    }
  }
}
@BrianHenryIE
Copy link
Contributor Author

I've managed to work around this by using override_autoload with:

"easypost/easypost-php": {
    "psr-4": {
        "EasyPost\\": "lib/"
    }
}

which moved the files as expected but the namespace of the library is just EasyPost (which doesn't look like it's conforming to PSR-0 standard anyway, but this doesn't seem to be an issue for other packages, e.g. Pimple) so won't be autoloaded by a PSR-4 autoloader, but shouldn't be a problem if I use a classmap.

Implementing the suggestion in #54 would help with this, i.e. rename the namespace to EasyPost\EasyPost to match the directory structure.

I'd still consider it a bug because there's no time copying files into the root of dep_directory makes sense. And they don't get removed if running mozart compose again, causing an issue then.

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

1 participant