最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How can I have case-sensitive theme directory names when installed with Composer?

programmeradmin1浏览0评论

I'm using SatisPress () to expose some premium plugins and themes as composer packages, because I would like to use the roots/bedrock boilerplate.

Now I have the following issue: The Divi theme (/) uses a capital letter for the themes directory ("Divi" not "divi"). Now when I use

composer require satispress/divi

it downloads the package and installs it to the correct directory and the theme is showing and is usable.

However the themes directory is now all lower case ("divi" not "Divi") which breaks child themes based on Divi.

What I found:

  • Behaviour occurs on bedrock as well as in an empty directory
  • The packages zip files created by SatisPress have the correct case in the zips name and in the contained files as well

While it should be possible to just change the child themes template entry to lower case, this could be problematic when (for whatever reason) the main theme would be installed the "normal" way, now containing upper case again and break the site.

So: Is there a way to change the behaviour of either SatisPress or composer to allow for upper case letters in directory names?

I'm using SatisPress (https://github/cedaro/satispress) to expose some premium plugins and themes as composer packages, because I would like to use the roots/bedrock boilerplate.

Now I have the following issue: The Divi theme (https://www.elegantthemes/gallery/divi/) uses a capital letter for the themes directory ("Divi" not "divi"). Now when I use

composer require satispress/divi

it downloads the package and installs it to the correct directory and the theme is showing and is usable.

However the themes directory is now all lower case ("divi" not "Divi") which breaks child themes based on Divi.

What I found:

  • Behaviour occurs on bedrock as well as in an empty directory
  • The packages zip files created by SatisPress have the correct case in the zips name and in the contained files as well

While it should be possible to just change the child themes template entry to lower case, this could be problematic when (for whatever reason) the main theme would be installed the "normal" way, now containing upper case again and break the site.

So: Is there a way to change the behaviour of either SatisPress or composer to allow for upper case letters in directory names?

Share Improve this question edited Mar 28, 2020 at 11:13 norman.lol 3,2313 gold badges30 silver badges35 bronze badges asked Mar 28, 2020 at 9:35 Daniel BachmannDaniel Bachmann 334 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

That would be a task for oomphinc/composer-installers-extender. With that you can specify the directory where a package should be installed to. And it's case-sensitive. Composer otherwise is case-insensitive.

{
    "extra": {
        "installer-paths": {
            "my/themes/Divi/": ["satispress/divi"],
        }
    }
}
发布评论

评论列表(0)

  1. 暂无评论