在根目录中创建项目,而没有项目目录
假设您有此文件结构:
/myapp/
/myapp/composer.phar
如果您在/myApp/
的根中运行create-project
,例如/code>
这将创建这样的文件:
/myapp/
/myapp/bar/x.txt
/myapp/bar/y.txt
/myapp/composer.phar
是否可以省略bar
目录,以便看起来像这样?
/myapp/
/myapp/x.txt
/myapp/y.txt
/myapp/composer.phar
我知道我可以在运行命令之前简单地向上移动一个目录,但是我使用的是Vagrant/Docker,如果可能的话,它将更简单。
Say you have this file structure:
/myapp/
/myapp/composer.phar
If you run create-project
in the root of /myapp/
e.g., php composer.phar create-project foo/bar
This will create files like this:
/myapp/
/myapp/bar/x.txt
/myapp/bar/y.txt
/myapp/composer.phar
Is it possible to omit the bar
directory so that it will look like this?
/myapp/
/myapp/x.txt
/myapp/y.txt
/myapp/composer.phar
I understand that I could simply move up one directory before running the command, however I am using Vagrant/Docker and it will be simpler if the above is possible.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正如他们所说的“当其他一切失败时,rtfm” :),所以:
您在这里看到我们感兴趣的东西:
参数是可选的(您锻炼的),但没有任何明确提供的参数,作曲家将提供价值自己。这还包括
< directory>
,然后将从< package>
name中“派生”。要解决您的问题,您只需要告诉Composer您想要使用什么目录,如果应该是您当前的工作目录,只需通过。
(dot),在u*ix世界中,这意味着“当前目录”:您应该很好。
As they say "When everything else fail, RTFM" :), so:
and you see that we got something interested here:
Arguments are optional (which you exercise) but not useless therefore for all non explicitly provided arguments, Composer will provide the value on its own. This also includes
<directory>
which will be then "derived" from<package>
name. To solve your problem you just need to tell Composer what directory your want it to use, and if that's should be your current working directory, simply pass.
(dot), which in U*ix world means "current directory":and you should be good.