Doctrine 2沙箱出错 [英] Error in Doctrine 2 sandbox
问题描述
我正在尝试开始使用Doctrine 2.我正在阅读他们的介绍。我试图运行
i am trying to get started with Doctrine 2. and i am reading their intro. i am stuck trying to run
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>
我以为这或多或少是与教程完全相同的代码?
i thought this is more or less the exact same code as the tutorial?
我发现在从 http://www.doctrine-project.org/projects/orm/download 沙箱甚至没有文件夹实体,yaml& xml文件夹!一个来自SVN ...我认为只有有DBAL包(我认为在Doctrine),其余的在lib。结构似乎是...这真的是一个不可用的测试版?
i discovered that in the package download from http://www.doctrine-project.org/projects/orm/download the sand box dont even have the folders entities, yaml & xml folders! the one from SVN ... i think onlye had the DBAL package (i think, in Doctrine) and the rest in lib. the structure seems off ... thats really a unusable beta?
我可以使用哪个测试版下载开始学习Doctrine 2?
which beta download can i use to start learning Doctrine 2?
推荐答案
使用git下载它是一个更好的主意,因为这将允许您获得依赖(dbal和常见)。
It's a better idea to download it using git, because that will allow you to get your dependencies (dbal and common).
git clone git://github.com/doctrine/doctrine2.git doctrine2-orm
cd doctrine2-orm
git submodule update --init
但是您遇到的实际问题是,将一个参数传递给orm:schema-tool:创建它不想要的参数。看来这个行为被改变,导致过期的文档。
But the actual problem you are having is that you're passing an argument to orm:schema-tool:create where it doesn't want one. It looks like this behaviour was changed resulting in out-of-date documentation.
以下内容适用于我:
cd tools/sandbox
./doctrine orm:schema-tool:create
哪些输出:
Creating database schema...
Database schema created successfully!
这篇关于Doctrine 2沙箱出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!