按照 http://www.fecshop.com/doc/fecshop-guide/develop/cn-1.0/guide-fecshop-about-update.html 这个说明文档对fecshop核心进行升级。
2.2 核心包以及第三方包升级:
打开根目录下面的composer.json配置文件, 找到下面的代码
"require": {
"php": ">=5.4.0",
"yiisoft/yii2": ">=2.0.6",
"yiisoft/yii2-bootstrap": "*",
"yiisoft/yii2-swiftmailer": "*",
"yiisoft/yii2-apidoc": "~2.0.0",
"fancyecommerce/fecshop": ">=1.1.2.9"
},
疑问1: 打开根目录,这个根目录是指网站的根目录吗? 还是/www/web/fecshop/vendor/fancyecommerce/fecshop/ fecshop核心的根目录。
打开网站的根目录(/www/web/fecshop/)下的composer.json修改以下代码
"require": {
"php": ">=5.4.0",
"yiisoft/yii2-bootstrap": "*",
"yiisoft/yii2-apidoc": "~2.0.0",
"fancyecommerce/fecshop": ">=1.4.3.0"
},
把 "fancyecommerce/fecshop": ">=1.4.2.1" 修改成 "fancyecommerce/fecshop": ">=1.4.3.0"
运行 composer update
[root@localhost fecshop]# composer update
Do not run Composer as root/super user! See https://getcomposer.org/root for details
The "extra.asset-installer-paths" option is deprecated, use the "config.fxp-asset.installer-paths" option
Loading composer repositories with package information
Updating dependencies (including require-dev) Nothing to install or update
Package phpoffice/phpexcel is abandoned, you should avoid using it. Use phpoffice/phpspreadsheet instead.
Generating autoload files
[root@localhost fecshop]#
更新不能成功
把 https://github.com/fecshop/yii2_fecshop/blob/master/composer.json
文件替换掉 网站的根目录(/www/web/fecshop/)下的composer.json。
composer update 后。
[root@localhost fecshop]# composer update
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 4 installs, 2 updates, 56 removals
- Removing yiisoft/yii2-gii (2.0.7)
- Removing yiisoft/yii2-faker (2.0.4)
- Removing yiisoft/yii2-debug (2.0.13)
- Removing yiisoft/yii2-bootstrap (2.0.8)
- Removing theseer/tokenizer (1.1.0)
- Removing symfony/yaml (v3.4.9)
- Removing symfony/polyfill-mbstring (v1.8.0)
。。。
会删除根目录下的一些包。失败。
到/www/web/fecshop/vendor/fancyecommerce/fecshop/ fecshop核心的根目录下。把composer.json替换成https://github.com/fecshop/yii2_fecshop/blob/master/composer.json 内容
composer update
[root@localhost fecshop]# composer update
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 20 installs, 0 updates, 0 removals
- Installing yiisoft/yii2-composer (2.0.6): Loading from cache
- Installing swiftmailer/swiftmailer (v5.4.9): Loading from cache
- Installing bower-asset/jquery (3.2.1): Loading from cache
- Installing bower-asset/yii2-pjax (2.0.7.1): Loading from cache
- Installing bower-asset/punycode (v1.3.2): Loading from cache
- Installing bower-asset/inputmask (3.3.11): Loading from cache
- Installing cebe/markdown (1.1.2): Loading from cache
- Installing ezyang/htmlpurifier (v4.10.0): Loading from cache
- Installing yiisoft/yii2 (2.0.15.1): Loading from cache
- Installing yiisoft/yii2-swiftmailer (2.0.7): Loading from cache
- Installing phpoffice/phpexcel (1.8.1): Loading from cache
- Installing yiisoft/yii2-redis (2.0.8): Loading from cache
- Installing imagine/imagine (v0.7.1): Loading from cache
- Installing fancyecommerce/fec (1.1.3.4): Loading from cache
- Installing fancyecommerce/fec_admin (1.3.7.0): Loading from cache
- Installing yiisoft/yii2-mongodb (2.1.7): Loading from cache
- Installing hightman/xunsearch (1.4.12-beta1): Loading from cache
- Installing paragonie/random_compat (v2.0.12): Loading from cache
- Installing ramsey/uuid (3.7.3): Loading from cache
- Installing facebook/graph-sdk (5.6.2): Loading from cache
imagine/imagine suggests installing ext-imagick (to use the Imagick implementation)
imagine/imagine suggests installing ext-gmagick (to use the Gmagick implementation)
paragonie/random_compat suggests installing ext-libsodium (Provides a modern crypto API that can be used to generate random bytes.)
ramsey/uuid suggests installing ircmaxell/random-lib (Provides RandomLib for use with the RandomLibAdapter)
ramsey/uuid suggests installing ext-libsodium (Provides the PECL libsodium extension for use with the SodiumRandomGenerator)
ramsey/uuid suggests installing ext-uuid (Provides the PECL UUID extension for use with the PeclUuidTimeGenerator and PeclUuidRandomGenerator)
ramsey/uuid suggests installing moontoast/math (Provides support for converting UUID to 128-bit integer (in string form).)
ramsey/uuid suggests installing ramsey/uuid-doctrine (Allows the use of Ramsey\Uuid\Uuid as Doctrine field type.)
ramsey/uuid suggests installing ramsey/uuid-console (A console application for generating UUIDs with ramsey/uuid)
facebook/graph-sdk suggests installing guzzlehttp/guzzle (Allows for implementation of the Guzzle HTTP client)
Package phpoffice/phpexcel is abandoned, you should avoid using it. Use phpoffice/phpspreadsheet instead.
Writing lock file
Generating autoload files
提示成功。 但是更新的文件是在 /www/web/fecshop/vendor/fancyecommerce/fecshop/ fecshop核心的根目录下生成了一个 vendor目录。 我把/www/web/fecshop/vendor/fancyecommerce/fecshop/vendor目录移到/www/web/fecshop/去替换/www/web/fecshop/vendor/ 有重复文件选覆盖。刷新网站后主页及后台全是空白的了也没提示错误。
感觉哪里姿势不对。。。
实验了很多次。每次实验都恢复之前的备份。结果还是没成功。
