Doctrine 2沙箱中的错误

时间:2010-07-17 04:07:37

标签: php doctrine

我正在尝试开始使用Doctrine 2.我正在阅读他们的intro。我被困在试图运行

D:\Projects\Websites\php\Doctrine\sandbox>doskey doctrine=php d:\resourcelibrary\frameworks\doctrine\bin\doctrine.php $*

D:\Projects\Websites\php\Doctrine\sandbox>doctrine --version
Doctrine Command Line Interface version 2.0-DEV

// from here u can see that doctrine works ... i used doskey to shorten typing

D:\Projects\Websites\php\Doctrine\sandbox>doctrine orm:schema-tool:create ./entities

  [RuntimeException]
  Too many arguments.

orm:schema-tool:create [--dump-sql] [-h|--help] [-q|--quiet] [-v|--verbose] [-V|--version] [-a|--ansi] [-n|--no-interact
ion] command

D:\Projects\Websites\php\Doctrine\sandbox>

我认为这或多或少与教程完全相同?

更新

我发现在从http://www.doctrine-project.org/projects/orm/download下载的包中,沙盒甚至没有文件夹实体,yaml& xml文件夹!来自SVN的那个...我认为只有DBAL包(我认为,在Doctrine中),其余的在lib中。结构似乎关闭...这真的是一个无法使用的测试版?

我可以用哪个beta下载开始学习Doctrine 2?

2 个答案:

答案 0 :(得分:2)

使用git下载它是个更好的主意,因为这样可以让你获得依赖(dbal和common)。

git clone git://github.com/doctrine/doctrine2.git doctrine2-orm
cd doctrine2-orm
git submodule update --init

但是你遇到的实际问题是你正在向orm传递一个参数:schema-tool:创建它不需要的地方。看起来此行为已更改,导致文档过时。

以下适用于我:

cd tools/sandbox
./doctrine orm:schema-tool:create

哪个输出:

Creating database schema...
Database schema created successfully!

答案 1 :(得分:0)

您是否阅读了该教程页面上的说明?

The sandbox is only available via SVN or soon as a separate download on the downloads page.

我从http://svn.github.com/doctrine/doctrine2.git查看了它,它有完整的Sandbox环境。