arjang27
arjang27

Reputation: 241

Doctrine CLI outputs contents of doctrine.php

i followed an online tutorial on integrating doctrine 2 and ZF2. i am able to insert data to database but whenever i run doctrine CLI it outputs:

#!/usr/bin/env sh
SRC_DIR="`pwd`"
cd "`dirname "$0"`"
cd "../doctrine/orm/bin"
BIN_TARGET="`pwd`/doctrine.php"
cd "$SRC_DIR"
"$BIN_TARGET" "$@"

which is the content to doctrine.php that i replaced with codes frome tutorial.

Upvotes: 8

Views: 2513

Answers (5)

kaiser
kaiser

Reputation: 22363

What works for me is to use the original shell/bash script in the vendor dir (running on win7)

$ vendor/doctrine/orm/bin/doctrine orm:schema-tool:create

Upvotes: 1

Petr Novotny
Petr Novotny

Reputation: 198

I found this on another question here and it works on Windows. There are also a bin folder in vendor/doctrine/orm/bin/ you can use this one like this in your console commands:

php vendor/doctrine/orm/bin/doctrine orm:schema-tool:create

Upvotes: 5

Mr Coder
Mr Coder

Reputation: 8196

Face the same problem , it turns out using forward slash instead of backward slash was the real culprit

So move inside the project directory and do

vendor\bin\doctrine.bat orm:schema-tool:create

Upvotes: 1

Crashthatch
Crashthatch

Reputation: 1293

On Windows, you need to run the .bat files instead. eg.

vendor\bin\doctrine.bat orm:schema-tool:create

Upvotes: 1

Ninj
Ninj

Reputation: 1522

Copy the path to doctrine binaries (containing "doctrine", "doctrine.php", "doctrine.bat"...

Go to the root of your project, and type:

php path_to_doctrine_bin/doctrine.php [options]

That should do it.

Upvotes: 3

Related Questions