简体   繁体   English

在 wordpress 中使用 Composer

[英]Using composer with wordpress

I am building my own Wordpress Skeleton "Application".我正在构建自己的 Wordpress 骨架“应用程序”。 Within this application i have the following files:在这个应用程序中,我有以下文件:

  • composer.phar作曲家.phar
  • composer.json作曲家.json
  • index.php索引.php
  • wp-config.php wp-config.php
  • wp-content wp-内容
  • wordpress (composed by composer) wordpress(由作曲家组成)

This is the composer.json of this repo: https://raw.github.com/Gizburdt/Wordpress-Conductor/master/composer.json这是这个 repo 的 composer.json: https : //raw.github.com/Gizburdt/Wordpress-Conductor/master/composer.json

The thing is: Gizburdt/scaffold is installed within the vendor folder and not within the wp-content/themes/ folder.问题是:Gizburdt/scaffold 安装在 vendor 文件夹中,而不是安装在 wp-content/themes/ 文件夹中。 Here is the composer.json from Gizburdt/scaffold: https://raw.github.com/Gizburdt/Wordpress-Scaffold/master/composer.json这是 Gizburdt/scaffold 中的 composer.json: https ://raw.github.com/Gizburdt/Wordpress-Scaffold/master/composer.json

Please help!请帮忙!

You're overriding the "magic" done by composer/installer for packages of type wordpress-plugin or wordpress-theme by including them in your json as a package.你通过将它们作为一个包包含在你的 json 中来覆盖由作曲家/安装程序为 wordpress-plugin 或 wordpress-theme 类型的包完成的“魔法”。

Instead of this:取而代之的是:

{
    "type": "package",
    "package": {
    "name": "gizburdt/scaffold",
    "version": "dev-master",
    "source": {
        "url": "https://github.com/Gizburdt/Wordpress-Scaffold.git",
        "type": "git",
        "reference": "origin/master"
    }
    }
},

Install it as type VCS repo - then it will read the type correctly from the composer.json in the Wordpress-Scaffold project:将其安装为 VCS 存储库类型 - 然后它将从 Wordpress-Scaffold 项目中的 composer.json 正确读取类型:

{
    "type": "vcs",
    "url": "https://github.com/Gizburdt/Wordpress-Scaffold.git"
},

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM