简体   繁体   English

作曲家和WordPress

[英]Composer And Wordpress

I'm a little new to Composer so this is just a general question. 我对Composer有点陌生,所以这只是一个普遍的问题。 I've been developing a WP plugin, and I'm requiring a few libraries in via composer. 我一直在开发WP插件,并且需要在composer中添加一些库。 I've uploaded the plugin to a server and I'm having problems. 我已将该插件上传到服务器,但遇到了问题。 Am I required to run composer install on the server as well as on my localhost? 我是否需要在服务器以及本地主机上运行composer install?

If you prefer to manage your dependencies with composer during development, you can do so. 如果您希望在开发过程中使用composer管理依赖项,则可以这样做。

But none of the WP workflows (neither the base installation, nor plugins) use composer. 但是,所有WP工作流(基本安装和插件均未使用)Composer。 WordPress simply expects a folder with your code, it doesn't care about any of the internals, as long as you follow some simple rules . 只要您遵循一些简单的规则 ,WordPress只会在您的代码中放置一个文件夹,它并不关心任何内部结构。

If your plugin is public, you will have to submit it to the WordPress SVN, but there's no such thing as a build process. 如果您的插件是公开的,则必须将其提交到WordPress SVN,但是没有构建过程之类的东西。 Also, WP plugin users will usually neither be interested in, nor have the possibility to, execute composer. 而且,WP插件用户通常不会对执行作曲家感兴趣,也没有执行它的可能性。

It is up to you if you create your own build process before committing to the WP SVN, or if you create your plugin in a way that it can run from your development code. 由您决定是在提交到WP SVN之前创建自己的构建过程,还是以可以从开发代码运行的方式来创建插件。

However, if you “build” your code before committing it to WP SVN (eg creating cache files, removing development-only dependencies etc.), you could run into discussions with people who insist on getting the original sources, too. 但是,如果在将代码提交到WP SVN之前“构建”代码(例如,创建缓存文件,删除仅开发依赖项等),则可能会与坚持获取原始资源的人进行讨论。

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

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