0

i am working in zendframework 2 in conjuction with doctrine 2

i am trying to use the orm:validate-schema to validate and generate tables in my database; i.e match the entity class User with a new table.

i followed the tutorial by marco pivetta

http://marco-pivetta.com/doctrine-orm-zf2-tutorial/#/24

however when i try to open the schema in my git i.e

andreea@Andreea-HP /cygdrive/c/users/andreea/zend/testingZend

./vendor/bin/doctrine-module orm:validate-schema

i get the following message:

Could not open input file: /cygdrive/c/users/endy/zend/testingZend/vendor/doctrine/doctrine-module/bin/doctrine-module

does anyone have an idea why i am unable to open the page

warm regards

Andreea

hi again followng the advice of foozi i tried the folllowing:

php public/index.php orm:validate-schema

however, i received the following error message:

 Undefined index: APPLICATION_ENV in C:\Users\andreea\zend\testingZend\public\index.php on line 19

Call Stack:
    0.0002     235176   1. {main}() C:\Users\andreea\zend\testingZend\public\index.php:0


Zend Framework 2.2.5 application
Usage:

Reason for failure: Invalid arguments or no arguments provided
PHP Notice:  Undefined index: APPLICATION_ENV in C:\Users\andreea\zend\testingZend\public\index.php on line 19
PHP Stack trace:
PHP   1. {main}() C:\Users\andreea\zend\testingZend\public\index.php:0

i believe that the message is referring to the followng:

/**
 * Display all errors when APPLICATION_ENV is development.
 */
if ('development' === $_SERVER['APPLICATION_ENV']) {
    error_reporting(E_ALL);
    ini_set("display_errors", 1);
}

would be gratful for some advice

andreea115
  • 289
  • 1
  • 3
  • 14

1 Answers1

0

Try to use doctrine command line over your application's index instead of directly doctrine-module binaries (actually both of them does same thing)

$ cd /your/zf2/project
$ php public/index.php orm:validate-schema

This is the way which i prefer.

edigu
  • 9,878
  • 5
  • 57
  • 80
  • hi foozy, i tried your solution but got a new error message. i have placed the error message in my main query. thanks for continued help – andreea115 Jan 23 '14 at 10:31
  • You should define APPLICATION_ENV variable in your ~/.bashrc (linux) ~/.bashrc_profile (mac os x) to use environment variables on CLI. Here is another answer which i wrote about this subject: http://stackoverflow.com/questions/20922814/runnig-zend-framework-2-action-from-console-not-working/20923299#20923299 – edigu Jan 23 '14 at 10:45
  • Oh.. on mac os x, it should be `~/.bash_profile` not `~/.bashrc_profile` sorry. – edigu Jan 23 '14 at 10:52
  • sorry, where is the bash file located and where do i need to go to change it – andreea115 Jan 23 '14 at 10:56