1

我刚刚启动了Api-Platform框架并在执行时:

php bin/schema generate-types src/ app/config/schema.yml

我明白了:

C:\wamp\www\sf2-api>php bin/schema generate-types src/ app/config/schema.yml

dir=$(d=${0%[/\\]*}; cd "$d"; cd "../vendor/api-platform/schema-generator/bin" &
& pwd)

# See if we are running in Cygwin by checking for cygpath program
if command -v 'cygpath' >/dev/null 2>&1; then
        # Cygwin paths start with /cygdrive/ which will break windows PHP,
        # so we need to translate the dir path to windows format. However
        # we could be using cygwin PHP which does not require this, so we
        # test if the path to PHP starts with /cygdrive/ rather than /usr/bin
        if [[ $(which php) == /cygdrive/* ]]; then
                dir=$(cygpath -m $dir);
        fi
fi

dir=$(echo $dir | sed 's/ /\ /g')
"${dir}/schema" "$@"

我在 window7 上使用 Symfony 2.7.8。我在 ubunbu 14.04 上有同样的问题。

4

3 回答 3

1

最后,我将 bin 目录替换为blog-api中的目录。

更新:

在此处输入图像描述

  • bin-api-platform 是由 api-platform 生成的。
  • bin-blog-api 是我从 blog-api 复制的。这工作正常。
于 2016-01-31T04:44:54.500 回答
0

正确的语法是:

php vendor/api-platform/schema-generator/bin/schema generate-types src/ app/config/schema.yml

于 2017-11-16T18:30:08.533 回答
0

利用 :

php vendor/api-platform/schema-generator/bin/schema generate-types src/app/config/schema.yml  

代替 :

php bin/schema generate-types src/ app/config/schema.yml
于 2016-04-26T17:23:31.883 回答