简体   繁体   English

如何确定库中Composer的vendor / bin目录?

[英]How to determine the vendor/bin directory of Composer in a library?

Is there a reliable way to determine the local vendor/bin directory of an application from within a library? 有没有可靠的方法可以从库中确定应用程序的本地vendor/bin目录? What I really want is the following: 我真正想要的是以下内容:

I am writing a library that depends on a third library. 我正在写一个依赖于第三个库的库。 This third library ships with a binary, that is installed in the local vendor/bin of the main application. 第三个库附带一个二进制文件,该二进制文件安装在主应用程序的本地vendor/bin中。 My library needs to have the possibility to execute this binary. 我的库需要有可能执行该二进制文件。 I could probably hack something using __DIR__/../...../bin but that feels not very good an is probably not reliable. 我可能使用__DIR__/../...../bin破解了一些东西,但感觉不太好,可能可靠。

bin can be changed, two ways: changing bin dir bin是可以改变的,有两种方式: 改变bin目录

Here is your solution: Can Composer treat binary dependencies in PATH? 这是您的解决方案: Composer可以在PATH中处理二进制依赖性吗?

Now you have the path . 现在您有了path You will need to figure out how(where) to store that data. 您将需要弄清楚该数据的存储方式。

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

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