1
我們有一個shell腳本與其他非PHP命令裹幾個PHP腳本,像這樣:放棄建立在PHP的警告/錯誤
build_stuff.sh
mv things stuff
cp files folders
composer install
php bin/console some:command
php bin/console some:other:command
這個shell腳本然後在「執行shell」構建步驟中調用。
sh ./build_stuff.sh
是否有可能儘快有PHP錯誤/警告中止建設成爲「失敗」,?
以便下一個命令不會被執行。
而仍然保持在一個腳本中的所有命令。
...
我發現日誌分析器插件,但我想中止發生錯誤時,無法繼續事後分析日誌。
我雖然僅僅大約追趕PHP退出代碼,如下所述:
Retrieve exit status from php script inside of shell script
但是,你不能立即看到PHP腳本的文本輸出,那麼,你會嗎?
錯誤代碼可以返回到shell。警告將不得不被覆蓋致命以產生相同的效果。 – Flosculus 2014-11-05 09:53:20