今天我跑了composer update
,更新完全破壞了我的網站。我在php.log發現如下信息:如何恢復作曲家更新?
72.15.153.139 - - [11/Nov/2015:21:01:45 -0500] "GET/HTTP/1.1" 500 - "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:42.0) Gecko/20100101 Firefox/42.0" [Wed Nov 11 21:01:48 2015] [error] [client 127.7.179.129] PHP Parse error: syntax error, unexpected 'function' (T_FUNCTION), expecting identifier (T_STRING) or \\ (T_NS_SEPARATOR) in /var/lib/openshift/55c481747628e14556000188/app-root/runtime/repo/config/vendor/danielstjules/stringy/tests/CreateTest.php on line 5 72.15.153.139 - - [11/Nov/2015:21:01:48 -0500] "GET/HTTP/1.1" 500 - "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:42.0) Gecko/20100101 Firefox/42.0"
似乎「danielstjules /粘性」是難辭其咎的一個。但是我怎樣才能恢復到這個軟件包的舊版本(或使用新聞版本?)?我試圖修改composer.lock文件,並改變
"require": {
"danielstjules/stringy": "~1.8",
到
"require": {
"danielstjules/stringy": "~1.9",
,並再次運行composer update
,但它給了信息:
Loading composer repositories with package information Updating dependencies (including require-dev) Nothing to install or update Writing lock file Generating autoload files PHP Parse error: syntax error, unexpected 'function' (T_FUNCTION), expecting identifier (T_STRING) or \ (T_NS_SEPARATOR) in /var/lib/openshift/55c481747628e14556000188/app-root/runtime/repo/config/vendor/danielstjules/stringy/tests/CreateTest.php on line 5 Script php artisan clear-compiled handling the post-update-cmd event returned with an error
[RuntimeException] Error Output: PHP Parse error: syntax error, unexpected 'function' (T_FUNC TION), expecting identifier (T_STRING) or \ (T_NS_SEPARATOR) in /var/lib/o penshift/55c481747628e14556000188/app-root/runtime/repo/config/vendor/danie lstjules/stringy/tests/CreateTest.php on line 5
我如何可以回滾該包?謝謝。
編輯2:
composer install
將自動修改composer.lock
。相反,我修改了composer.json
,它成功讀取了舊版本1.8。
但構建仍然失敗。原因是This issue description。但是在rm -rf test/
之後,問題仍然存在。
編輯3:
我試過如下:
rm -rf vendor/
composer update
的問題不見了。
你提交了'composer.lock'文件嗎? –
你的'composer.lock'應該在版本控制中。這將允許你恢復對它的更改,然後執行'composer install'來重新安裝已知的功能版本。 – ceejayoz
首先,您應該指定要更新的準確版本。修改'composer.lock'而不使用'〜'字符。如果仍然存在問題,我們必須使用GIT或SVN來完全恢復到之前的修訂版本。 –