aaemnnosttv / wp-sqlite-db

A single file drop-in for using a SQLite database with WordPress. Based on the original SQLite Integration plugin.
561 stars 94 forks source link

Is it necessary for this package to be a dropin and use installers? #30

Closed dingo-d closed 1 year ago

dingo-d commented 2 years ago

The composer installers is great for bedrock type development, but other than that it's kinda problematic to use as a direct dependency.

My use case is that I need to set up an in-memory DB for testing purposes only, and I'd like to use this package, but whenever my package gets pulled in the project repo, the composer installers will automatically create a wp-content folder with this package in it.

Adding

"extra": {
    "installer-disable": [
      "wordpress"
    ]
  }

only works when I run composer install in my package, not when somebody installs my package (they'd need to disable the installer in their project manually for that to work I guess).

Is there any way this can be circumvented?

aaemnnosttv commented 1 year ago

Good question! I'm not sure if there is a way to avoid this since all the overrides for composer/installers have to be set at the root composer.json level. We could consider removing that as a dependency in the future, but I believe the problem would still come up if installers was installed by another package or a root dependency, would it not?

dingo-d commented 1 year ago

but I believe the problem would still come up if installers was installed by another package or a root dependency, would it not?

But if it is in another package, then it would be that packages issue, not this, no?

I mean, I found a way to kinda go around this issue by prompting the users if they want to delete the downloaded wp-content directory when my package sets up the WordPress test suite (I'm using this package so to use in-memory DB for integration testing). I guess this is kind of a non-issue then.