Error in Doctrine 2 sandbox

2019-09-09 22:56发布

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?

UPDATE

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?

which beta download can i use to start learning Doctrine 2?

标签: php doctrine
2条回答
叛逆
2楼-- · 2019-09-09 23:21

Did you read the note on that tutorial page?

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

I checked it out from http://svn.github.com/doctrine/doctrine2.git and it had the complete Sandbox environment.

查看更多
\"骚年 ilove
3楼-- · 2019-09-09 23:48

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

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.

The following works for me:

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

Which outputs:

Creating database schema...
Database schema created successfully!
查看更多
登录 后发表回答