1

我在我的 Windows 8 笔记本电脑上安装了 Composer for PHP 应用程序,我正在尝试运行

composer.phar install

来自 CMD,其中当前目录是我的 XAMPP 服务器的项目文件夹。在这个文件夹中,我有一个名为:

composer.json

有了这个内容:

{
"require" {
    "zurb/foundation": "v4.3.*"
    }

}

然后我被 Windows 询问,我想用什么程序来运行 PHAR 文件……所以,我从 XAMPP 服务器安装中选择了 php.exe。

然后我得到这个输出:

c:\xampp\htdocs\playground1>composer.phar install
   ______
  / ____/___  ____ ___  ____  ____  ________  _____
 / /   / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__  )  __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
                    /_/
Composer version a2a70380c14a20b3f611d849eae7342f2e35c763 2013-10-21 09:51:22

Usage:
  [options] command [arguments]

Options:
  --help           -h Display this help message.
  --quiet          -q Do not output any message.
  --verbose        -v|vv|vvv Increase the verbosity of messages: 1 for normal ou
tput, 2 for more verbose output and 3 for debug
  --version        -V Display this application version.
  --ansi              Force ANSI output.
  --no-ansi           Disable ANSI output.
  --no-interaction -n Do not ask any interactive question.
  --profile           Display timing and memory usage information
  --working-dir    -d If specified, use the given directory as working directory
.

Available commands:
  about            Short information about Composer
  archive          Create an archive of this composer package
  config           Set config options
  create-project   Create new project from a package into given directory.
  depends          Shows which packages depend on the given package
  diagnose         Diagnoses the system to identify common errors.
  dump-autoload    Dumps the autoloader
  dumpautoload     Dumps the autoloader
  global           Allows running commands in the global composer dir ($COMPOSER
_HOME).
  help             Displays help for a command
  init             Creates a basic composer.json file in current directory.
  install          Installs the project dependencies from the composer.lock file
 if present, or falls back on the composer.json.
  licenses         Show information about licenses of dependencies
  list             Lists commands
  require          Adds required packages to your composer.json and installs the
m
  run-script       Run the scripts defined in composer.json.
  search           Search for packages
  self-update      Updates composer.phar to the latest version.
  selfupdate       Updates composer.phar to the latest version.
  show             Show information about packages
  status           Show a list of locally modified packages
  update           Updates your dependencies to the latest version according to
composer.json, and updates the composer.lock file.
  validate         Validates a composer.json

c:\xampp\htdocs\playground1>

所以,对我来说,Composer 程序似乎没有认识到我已经给它一些参数来使用......这里可能是什么错误?

谢谢!

4

1 回答 1

0

我猜在创建文件之间的连接.phar以及php作为打开这些文件的应用程序时,Windows 没有添加代码来传递更多的命令行参数。所以 PHP 实际上只获取 Phar 文件的名称,没有别的。

我发现这个问题看起来像 Marcus Pope 的答案有正确的解决方案:添加%*到 open 命令以传递所有进一步的 cli 选项。

于 2013-10-31T08:38:51.547 回答