2014-01-23 24 views
0

我在zendframework 2個工作在同一起選擇學說2zendframework 2 doctrine2模式不會打開

我試圖使用ORM:證實模式來驗證和生成在我的數據庫表;即將實體類User與新表匹配。

我隨後馬可pivetta教程

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

然而,當我試圖在我的git中打開該架構即

[email protected] /cygdrive/c/users/andreea/zend/testingZend 

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

我得到以下信息:

無法打開輸入文件: /cygdrive/c/users/endy/zend/testing Zend公司/供應商/學說/教義模塊/斌/學說模塊

沒有任何人有一個想法,爲什麼我無法打開頁面

親切問候

安德列亞

喜再次 followng foozi的意見,我嘗試了folllowing:

php public/index.php orm:validate-schema 

howeve R,我收到以下錯誤消息:

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 

我認爲該消息是指followng:

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

將gratful一些建議

回答

0

嘗試使用學說的命令行在您的應用程序的索引,而不是直接教條模塊二進制文件(實際上他們都做同樣的事情)

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

這是我喜歡的方式。

+0

嗨foozy,我試過你的解決方案,但得到了一個新的錯誤信息。我已將錯誤消息放入我的主要查詢中。感謝您的繼續幫助 – andreea115

+0

您應該在〜/ .bashrc(linux)〜/ .bashrc_profile(mac os x)中定義APPLICATION_ENV變量以便在CLI上使用環境變量。這是我寫的關於這個問題的另一個答案:http://stackoverflow.com/questions/20922814/runnig-zend-framework-2-action-from-console-not-working/20923299#20923299 – edigu

+0

哦..在Mac上os x,它應該是'〜/ .bash_profile'而不是'〜/ .bashrc_profile'抱歉。 – edigu