开发者

Error in Doctrine 2 sandbox

开发者 https://www.devze.com 2023-01-07 12:12 出处:网络
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\\framewor

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?


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!


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消