Git Product home page Git Product logo

fecshop / yii2_fecshop Goto Github PK

View Code? Open in Web Editor NEW
5.2K 318.0 1.4K 9.08 MB

yii2 ( PHP ) fecmall(fecshop) core code used for ecommerce shop 多语言多货币多入口的开源电商 B2C 商城,支持移动端vue, app, html5,微信小程序微店,微信小程序商城等

Home Page: http://www.fecmall.com

License: BSD 3-Clause "New" or "Revised" License

PHP 86.59% CSS 2.77% JavaScript 10.50% Shell 0.11% Hack 0.03%
yii2-fecshop yii2 fecshop shop cart yii ecommerce shopping vue html5

yii2_fecshop's Introduction


Latest Stable Version Total Downloads Latest Unstable Version

Fecshop更名为FecMall

详细参看:关于Fecshop更名为FecMall的原因


Fecmall-2.x版本

Fecmall-2版本在用户体验方面进行了很多的优化,请安装Fecmall-2版本

Fecmall-1.x版本

项目状态:

Fecmall开源项目已经全部开发完毕,一共六大入口:pc端(appfront),wap端(apphtml5),后台(appadmin) ,vue端(appserver),第三方系统对接端(appapi),后台脚本端(console),都全部开发完毕, 您可以使用Fecmall用于您的线上电商项目, Fecmall是一个功能齐全的开源电商系统,偏框架,适合程序员深入学习使用, 二开比较容易,欢迎大家使用Fecmall开发自己的电商项目。

1、Fecmall介绍

Fecmall 全称为Fancy ECommerce Mall,是基于php Yii2框架之上开发的一款优秀的开源电商系统, Fecmall支持多语言,多货币,架构上支持pc,手机web,手机app,和erp对接等入口,您可以免费快速的定制和部署属于您的电商系统。

详细参看地址:Fecmall开源商城功能列表

Fecmall 官网:http://www.fecmall.com ,您可以在这里提交bug,问题咨询等等。

Fecmall 【已完成】PC Web Demo :http://fecshop.appfront.fancyecommerce.com

Fecmall 【已完成】Mobile Web Demo(WAP):http://fecshop.apphtml5.fancyecommerce.com

Fecmall 【已完成】Mobile VUE Demo(Appserver,前后端彻底分离模式):http://demo.fancyecommerce.com/#/

Fecmall 【已完成】微信小程序(Appserver,前后端彻底分离模式):微信小程序搜索:Fecmall查看demo,或者扫下面的小程序码:

wx_xiaochengxu_fecmall

Fecmall 后台演示地址:http://www.fecmall.com/yanshi (该帖子里面有后台演示地址)

作者, Terry Email:[email protected]

Fecmall QQ群号(新):782387676,入群验证:fecmall

Fecmall Github地址: https://github.com/fancyecommerce/yii2_fecshop

Fecmall 码云地址: https://gitee.com/fecshopsoft/yii2_fecshop

Fecmall开源协议:Fecmall 授权协议

Fecmall线上项目案例:http://www.fecmall.com/topic/55

Fecmall问题咨询,Bug提交等参看:Fecmall论坛

Fecmall开源项目历程:Fecmall时间线

2、Fecmall文档,视频,扩展库

二开以及安装文档: Fecmall 开发文档【撰写完成】

使用帮助说明文档: Fecmall 帮助文档【撰写完成】

使用帮助说明文档: Fecmall 应用市场文档【撰写完成】

3、安装Fecmall

请务必按照说明安装,Fecmall是基于composer在线安装,直接git clone下载下来是不行的,请按照下面的说明操作

Fecmall 安装教程文档

4、联系Terry:

扫一扫添加Terry的微信:

weixin

5、架构特色

架构特色:参看详细介绍:Fecmall 架构特色

下面是简叙:

Fecmall 全称为Fancy ECommerce Mall,是一款优秀的开源电商系统,遵循BSD-3-Clause协议(和Yii2框架一样的开源协议), 目的是为了方便yii2用户快速的 开发商城,Fecmall作为一款可以持续性发展的商城系统, 在框架层面有以下特性:

  1. 由于商城系统的复杂性,原始的框架MVC结构,显的有点力不从心,Fecmall框架 加入了Block层, Controller层只负责调度, Model只负责数据库映射,中间的处理逻辑由block来完成,View层 负责显示,这样各司其职, 以免造成controller文件过于庞大。

  2. 加入独立功能块,有点类似Yii2的Widget,目的是为了让一些侧栏公用块 可以通过配置的方式 添加,同时,还可以具有设置缓存的功能,譬如分类侧栏的产品推荐, newsletter等独立显示块可能在很多 页面用到,通过独立功能块可以配置方便的载入。

  3. 在Model层的上层加入服务层Services,这样,Controller,Block,View 层,在原则上 不能直接调用model,必须通过Services层以及子Services层,然后Services访问各个 model,组织数据,事务处理等操作, 将数据结果返回给上层,这种设计可以方便以后业务 发展后,进而根据业务特点进行重构,或者以后如果出现新技术,新方式, 都重构成自己想要的样子,譬如, 将某个底层由mysql换成mongodb,或者为了应付高并发读写并且多事务性的功能部分, 进行分库分表的设计方式。

关于Fecmall Service,详细参看:Fecshop Services

  1. Fecmall多模板系统,Fecmall设置了多个模板路径,各个模板路径下的文件被加载 的优先级不同,其中,Fecmall的模板路径下的文件最全面,但是优先级最低, ,第三方模板路径优先级其次,用户本地模板路径优先级最高, 用户可以通过 复制相应路径下的view或者js,css文件到本地模板路径,存在于高优先级 模板路径的文件会被优先加载,这样用户可以通过多模板系统的原理进行模板的 制作,同时,不影响Fecmall模板的升级,如果Fecmall view文件升级后被修改, 那么用户可以比对本地模板文件与升级模板文件的代码的不同, 复制更改的代码到本地模板路径 即可。第三方的模板路径的优先级介于本地模板路径和Fecmall 模板路径之间。

  2. 重写机制,Fecmall的功能基本都可以被用户重写,包括servies层,Modules, Controller,Block,Views,View Layout, 以及Js Css Img等,都可以被用户重写,其中 Js,Css,Img,Views,View Layout 是通过多模板 路径优先级来实现的,其他的是通过配置文件的覆盖更改来实现重写,这样,用户 就可以很方便重构Fecmall或者第三方的功能和模板。

  3. 升级最小化干扰,Fecmall的核心文件是放到vendor/fancyecommerce/fecshop 路径下面,和第三方扩展,用户二次开发路径完全隔离开, Fecmall可以通过composer进行核心功能的升级,用户只需要通过composer升级 即可。

  4. 快速高效,Fecmall Servises遵循Yii2的懒加载方式,只初始化使用到的组件服务, 缓存方面有整页缓存,block部分缓存,动态数据ajax加载等方式,让您的网站快速响应。

  5. Fecmall 多入口模式,分为 appadmin(后台), appfront(PC前端),apphtml5(手机web), appserver(手机app服务),appapi(erp,或者其他接口对接), 不同的业务,不同的设备,进入不同的入口,各个入口共用服务层services, 但是modules部分独立,这样相互干扰最小,可以相互独立开发。

  6. 后台封装化,fec_admin扩展可以快速的实现增删改查类型的表单列表, 方便用户快速的做增删改查。

鉴于以上特点,您可以下载安装Fecmall,然后更改Fecmall的模板和功能,扩展自己想要 的功能,或者安装第三方开发好了的扩展或者模板,来快速的组建起来您的网站。

6、捐赠

如果您认为这是一个不错的项目,对您有帮助,你可以通过下面的方式进行捐赠, 这里感谢您对开源项目的支持。

支付宝:

微信:

捐赠历史:(捐助,建议写一下留言)

捐赠人 金额 时间 方式 账户 捐助者留言
(*飞) ¥66.60 2020-02-25 微信 - 感谢,祝公司稳健发展
(*) ¥50 2020-02-20 微信 -
(*然) ¥166 2020-01-20 微信 - 开源界的一股清流,加油
(T*t) ¥20.00 2019-12-11 微信 - 很不错,赞一个
(*圣茜) ¥200.00 2019-12-09 支付宝 - 支持开源 支持分享
(*光) ¥0.66 2019-11-27 微信 -
(*可) ¥1.00 2019-11-26 微信 - 支持你,加油
(*可) ¥1.00 2019-11-26 微信 -
(*可) ¥1.00 2019-09-30 微信 - 失业中没钱只能表示下
(*爱) ¥200.00 2019-09-02 微信 - 基于fecshop二次开发的商城已上线,感谢这么好的开源系统
(*志兵) ¥50.00 2019-08-11 微信 - 支持一下
(*懿卿 ¥20.00 2019-07-29 支付宝 -
(*彩虹) ¥10.00 2019-07-24 微信 - 学生党不宽裕但支持
(*堂) ¥1.00 2019-07-12 微信 - 支持
(*葫芦娃) ¥200.00 2019-06-06 微信 - 咨询了很多电商的事情,感谢帮助
(*锋) ¥20.00 2019-05-13 支付宝 - 我想做个商城
(*宁) ¥50.00 2019-04-29 微信 -
(*亮亮 ¥100.00 2019-04-06 支付宝 - 支持榜样,标杆
(*亮) ¥50.00 2019-04-06 微信 - 坚持,加油!
(*树桓) ¥50.00 2019-03-30 支付宝 -
pptrue ¥50.00 2019-03-19 微信 - 支持开源,感谢Terry
(*军) ¥188.00 2019-03-10 微信 - 为3年的坚持点赞
(*浩) ¥66.00 2019-02-13 微信 - 支持fecshop长久发展
(*嘉文) ¥0.10 2019-01-28 支付宝 -
(*凡) ¥10.00 2019-01-07 支付宝 - 加油
(y*g) ¥100.00 2018-12-26 微信 - 腾讯andehuang
(董*) ¥10.00 2018-12-24 微信 -
(*间) ¥1.00 2018-12-14 微信 -
pptrue ¥100.00 2018-12-13 微信 - 很喜欢这个项目,感谢terry和大家的无私奉献。作为编程小白一名,我还在努力学习中。感觉最近生活都充实了
(*树桓) ¥20.00 2018-11-30 支付宝 -
(*艺业) ¥1.00 2018-11-30 支付宝 -
(*泰) ¥100.00 2018-11-27 微信 -
(*潇) ¥10.00 2018-11-26 微信 - well done
(*少平) ¥1.00 2018-11-15 支付宝 - 学生,赚钱了再来捐,牛逼,看源码学习
(*) ¥120.00 2018-10-28 微信 - 尽我一点绵薄之力给你帮助。
(*) ¥20.00 2018-10-27 微信 - 支持一下
(*) ¥8.88 2018-10-26 微信 - 国产良心之作!!
(*华峰) ¥5.00 2018-10-19 支付宝 - 官网看着真不错,项目好用再来捐赠,开学了
(*A) ¥6.66 2018-09-21 微信 - 感谢fecshop
(*大成) ¥1.00 2018-09-18 支付宝 -
(*江林) ¥1.00 2018-09-11 支付宝 -
(*) ¥500.00 2018-07-31 微信 -
(*) ¥15.00 2018-07-23 微信 -
(*) ¥15.00 2018-07-19 微信 -
(*) ¥99.99 2018-07-12 微信 - 作为国内的真正开源系统,真是良心之作,支持,祝愿长久发展!
*方招 ¥30.00 2018-07-10 支付宝 fan***gmail.com 感谢作者。非常不错的电商平台
厦门码农网络科技有限公司 ¥16.66 2018-07-04 支付宝 cod***@126.com 厦门码农支持开源,为Fecshop!
*雷雷 ¥800.00 2018-06-27 支付宝 134******22 支持作者,支持fecshop
(*) ¥1.00 2018-06-22 微信 -
*建欣 ¥50.00 2018-06-15 支付宝 593***@qq.com 小小心意,支持fecshop的发展
*宁 ¥5.00 2018-06-08 支付宝 pay***@itoumao.com 感谢作者的开源精神,同为程序猿的我做不到
(*) ¥10.00 2018-06-06 微信 - 感谢作者,感谢开源
*庆飞 ¥188.00 2018-06-05 支付宝 lin***@aliyun.com 逛v2看到的,支持开源,为你点赞!
*桦 ¥10.00 2018-05-24 支付宝 - 真心做得不错
(*) ¥1.00 2018-05-17 微信 - 搞的不错
(*) ¥13.14 2018-05-11 微信 - 北京智翔财务为你加油
(*) ¥10.00 2018-05-04 微信 - 希望fecshop越做越好
(*) ¥16.66 2018-04-20 微信 - 为你们打call
(*) ¥6.60 2018-04-16 微信 - 不会用一yii,为开源
(*) ¥166.00 2018-04-03 微信 - 为开源打call!
*仲春 ¥66.66 2018-03-19 支付宝 - 加油加油,准备学习学习
(*) ¥10.00 2018-03-19 微信 - -
(*) ¥8.88 2018-03-18 微信 - 为作者坚持和耐心点赞
Simon ¥20.00 2018-03-16 支付宝 186***40 希望继续坚持开源事业
(*) ¥8.88 2018-03-16 微信 - -
(*) ¥100.00 2018-03-15 微信 - 干得漂亮
(*) ¥3.33 2018-03-15 微信 - 感谢为开源做出的贡献
xhq ¥2.00 2018-03-14 支付宝 143***@qq.com 好项目就是要让更多人知道
(*) ¥2.00 2018-03-13 微信 - -
饭饭 ¥120.00 2018-03-13 支付宝 420***@qq.com 为2年半的坚持加油
kingsee ¥6.66 2018-03-13 支付宝 kin***@gmail.com -
(*) ¥10.00 2018-03-13 微信 - 感谢为开源做出的贡献
yangfch3 ¥66.66 2018-03-13 支付宝 875***@qq.com 感谢为开源默默付出的工程师们
(*) ¥66.66 2018-03-08 微信 - 已经在线上项目使用了,多谢Terry开发的这么好的开源系统。
(*) ¥8.88 2018-03-06 微信 - 好项目,在学习。支持
华生 ¥8.88 2018-02-22 支付宝 294***@qq.com 不错的开源项目,支持一下
(*) ¥6.66 2018-02-18 微信 - 诚意的开源祝项目66顺
剑清 ¥99.99 2018-01-03 支付宝 262***@qq.com 很好的项目,祝越做越好,长久发展
(*) ¥2.00 2017-12-28 微信 - -
(*) ¥6.60 2017-12-21 微信 - -
水哥 ¥99.99 2017-12-20 支付宝 dd_***@sohu.com 祝fecshop发展永久
(*) ¥9.90 2017-12-11 微信 - 希望长久!
(*) ¥100.00 2017-10-21 微信 - 希望你坚持下去成为更多人的榜样
(*) ¥100.00 2017-09-27 微信 - -
(*) ¥2.00 2017-09-18 微信 - 赞一个
(*) ¥1.00 2017-09-15 微信 - -

yii2_fecshop's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yii2_fecshop's Issues

管理后台采用新的权限系统后,富文本编辑商品图片时报错,没有权限

$uploadImgUrl = 'upimgurl="'.CUrl::getUrl('cms/staticblock/imageupload').'" upimgext="jpg,jpeg,gif,png"';
$uploadFlashUrl = 'upflashurl="'.CUrl::getUrl('cms/staticblock/flashupload').'" upflashext="swf"';
$uploadLinkUrl = 'uplinkurl="'.CUrl::getUrl('cms/staticblock/linkupload').'" uplinkext="zip,rar,txt"';
$uploadMediaUrl = 'upmediaurl="'.CUrl::getUrl('cms/staticblock/mediaupload').'" upmediaext:"avi"="" ';

base里可见这部分代码。不过没有默认的权限。另外个人觉得在AppadminbaseBlockEdit调用cms/staticblock/imageupload的路由,没有解耦

货运在哪里配置呢?

What steps will reproduce the problem?

What is the expected result?

What do you get instead?

Additional info

Q A
Fecshop version 1.1.3.?
PHP version
Operating system

erro import mongobd

[nihaomodas.com.br@Umbler fecshop]$ ./yii mongodb-migrate --interactive=0 --migrationPath=@fecshop/migrations/mongodb
Yii Migration Tool (based on Yii v2.0.13.1)

Exception 'yii\mongodb\Exception' with message 'No suitable servers found (serverSelectionTryOnce set): [Failed to resolve 'mongo_ghjfhjdgh']'

Average rating not update when user rating.

I. Average Rating.

I clone new account to test function Add Review in Desktop version.
When user review, the values of average rating should be updated.

Test link: https://fecshop.appfront.fancyecommerce.com/reindeer-pattern-glitter-christmas-dress-86519596

I can't see average rating is not update.

II. Admin Fecshop

Can you provider screenshot of Admin Fecshop?

I can't install yii2_fecshop because of language barriers, but I feel your project very interesting.

Have you plan to do fecshop like Magento, you need to add more function in Admin.

Please add your roadmap and checked in a feature was completed.

III. Suggestions (almost in appfront, because I don't access to appadmin)

  1. Add button Add To Card.

I think you should add button Add To Cart in the main layout of the webpage. Like:

capture

This feature will easy for end user. Quick add to the card and continues shopping, don't need to go to details of the product.

  1. Hover product shows more information about that products.

  2. Keep .top_nav (don't hide) when scroll.

I think think this easy for end user. When user click adds to the card with Ajax will update in .mycart. Customer know products are added in their card(include number item in the cart), continues to surf your shop.
The height of your .top_nav is short. So, it doesn't affect to a user experience.

Thanks.

error composer update

The "extra.asset-installer-paths" option is deprecated, use the "config.fxp-asset.installer-paths" option

erro 403

安装后, 打开页面出现403 , 我没有设置redis, 可以不

Yii2 migratge方式导入表结构 mysql部分失败

What steps will reproduce the problem?

执行 ./yii migrate --interactive=0 --migrationPath=@fecshop/migrations/mysqldb

What is the expected result?

What do you get instead?

/migrations/mysqldb/m170228_072156_fecshop_tables.php 186 行 应该;结尾

Additional info

Q A
Fecshop version 1.1.3.?
PHP version
Operating system

add

What steps will reproduce the problem?

What is the expected result?

What do you get instead?

Additional info

Q A
Fecshop version 1.1.3.?
PHP version
Operating system

请问考虑增加 小程序入口吗?

What steps will reproduce the problem?

What is the expected result?

What do you get instead?

Additional info

Q A
Fecshop version 1.1.3.?
PHP version
Operating system

安装应用市场插件时,应检查php zip依赖

问题症状

Ubuntu 18.04 (使用php7.2) 未安装 php7.2-zip 依赖,购买成功应用市场插件后点击“点击安装”,图标提示加载,但之后失去响应,既没有成功,也无错误提示。观察浏览器开发者工具Console面板,提示:

Failed to load resource: the server responded with a status of 500 (Internal Server Error)

按钮对应HTML和JS:

<a title="点击该按钮,进行应用的在线安装" class="abutton" href="javascript:void(0)" addonname="furnilife模板,简洁风格的模板" rel="fectfurnilife" foldername="furnilife_theme" packagename="fecmall">点击安装</a>
$(document).off("click").on("click",".abutton",function(){
            namespace = $(this).attr('rel');
            var packageName = $(this).attr('packageName');
            var addonName = $(this).attr('addonName');
            var folderName = $(this).attr('folderName');
            
            var url = "<?= Yii::$service->url->getUrl("system/extensionmarket/install"); ?>";
            url += '?namespace=' + namespace;
            url += '&packageName=' + packageName;
            url += '&folderName=' + folderName;
            url += '&addonName=' + encodeURIComponent(addonName);
            
            $.ajax({
                url: url,
                async: true,
                timeout: 800000,
                dataType: 'json', 
                type: 'get',
                success:function(data, textStatus){
                    if(data.statusCode == 200){
                        //alert(data.statusCode);
                        message = data.message;
                        alertMsg.correct(message);
                        navTab.reloadFlag('page1');
                    } else if (data.statusCode == 300){
                        message = data.message;
                        alertMsg.error(message)
                    } else {
                        alertMsg.error("错误");
                    }
                    //
                },
                error:function(){
                }
            });
        });

从浏览器端看不到太多有价值的信息,用 xdebug 调试

ZipFile.php:28, fecshop\services\helper\ZipFile->unzip()
ExtensionmarketController.php:148, fecshop\app\appadmin\modules\System\controllers\ExtensionmarketController->actionInstall()
InlineAction.php:57, call_user_func_array:{/home/zime/DATA/www/xymall/vendor/yiisoft/yii2/base/InlineAction.php:57}()
InlineAction.php:57, yii\base\InlineAction->runWithParams()
Controller.php:157, fecshop\app\appadmin\modules\System\controllers\ExtensionmarketController->runAction()
Module.php:528, yii\web\Application->runAction()
Application.php:103, yii\web\Application->handleRequest()
Application.php:386, yii\web\Application->run()
index.php:50, {main}()

到以下代码中 zip_open 时出现异常

class ZipFile extends Service
{
    public function unzip($src_file, $dest_dir=false, $create_zip_name_dir=true, $overwrite=true){
        if ($dest_dir) {
            $dest_dir .= '/';
        }
        if ($zip = zip_open($src_file)){
           ...................
        }else{
            return false;
        }
        return true;
    }

由于 zip_open 异常,不会执行到unzip()的任何一条 return 语句,所以 ExtensionmarketController.php 的以下代码不能响应给浏览器合适的 AJAX 响应

// 进行zip文件的解压
        $dest_dir = dirname($zipFilePath);
        if (!Yii::$service->helper->zipFile->unzip($zipFilePath, $dest_dir, true, true)) {
            echo  json_encode([
                'statusCode' => '300',
                'message'    => Yii::$service->page->translate->__('unzip addons fail'),
            ]);
            exit;
        }

调试中可以知道 yiisoft/yii2/base/ErrorHandler.php中handleException()的异常消息为

Call to undefined function fecshop\services\helper\zip_open()

所以可以联想到是 zip_open 函数对应的扩展没有安装

预期的结果

安装插件应该有阶段性指示:如 正在下载插件安装包、正在解压安装包、正在安装插件、正在清理、安装成功

可以考虑的fix

@fecshop/services/helper/ZipFile.php 文件

@@ -28,1 +28,1  @@  public function unzip($src_file, $dest_dir=false, $create_zip_name_dir=true, $overwrite=true){
-           if ($zip = zip_open($src_file)){  
+          if (function_exists('zip_open') && ($zip = zip_open($src_file))){

这样,最起码能够看到 unzip addons fail 的提示,当然,提示语句最好改为 unzip addons fail, please make sure php extension zip is installed

Additional info

Q A
Fecshop version 2.3.6
PHP version 7.2
Operating system Ubuntu 18.04

roadmap about code improvement

Roadmap

To make our code more human-readable, and more IDE friendly, we could do the following:

  • remove OPTIONS request in each controller
  • Add proper comments to each variable and method, even class when they have some magic calls

autoload.php): failed to open stream

What steps will reproduce the problem?

10.1

What is the expected result?

导入数据库

What do you get instead?

./yii migrate --interactive=0 --migrationPath=@fecshop/migrations/mysqldb
PHP Warning: require(/home/xuan/work/fecshop/vendor/autoload.php): failed to open stream: No such file or directory in /home/xuan/work/fecshop/yii on line 16
PHP Fatal error: require(): Failed opening required '/home/xuan/work/fecshop/vendor/autoload.php' (include_path='.:/usr/share/php7:/usr/share/php7/PEAR') in /home/xuan/work/fecshop/yii on line 16

Additional info

composer create-project fancyecommerce/fecshop-app-advanced fecshop 1.7.2.0 -vvv
cd fecshop
proxychains4 composer update -vvv
./init

php -v
PHP 7.2.5 (cli) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

NAME="openSUSE Leap"
VERSION="15.0"
ID="opensuse-leap"
ID_LIKE="suse opensuse"
VERSION_ID="15.0"
PRETTY_NAME="openSUSE Leap 15.0"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:leap:15.0"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.opensuse.org/"

Issues when install Fecshop

I have some issues when tried to install Fecshop in my Arch.

  1. DocRoot.
    I tried to run the command:
    php yii serve

show errors like:

Document root "/srv/http/fecshop/console/web" does not exist.

So, I must tried to:

php yii serve --port=8888 --docroot="/srv/http/fecshop/appserver/web"

How to skip this error?

  1. this domain is not config in store component

Iin /srv/http/fecshop/vendor/fancyecommerce/fecshop/services/Store.php it go to exception at line 113:

if(!$init_compelte){
      throw new InvalidValueException('this domain is not config in store component');
}
  1. Bootstrap error:

I take a photo error relate with Bootstrap.

screenshot_2017-04-27_03-53-26

  1. Another error you will see in this photo. I think I lost any config in your document. I tried. But not a success.

See this photo:
screenshot_2017-04-27_03-56-48

Finally, I tried to using Google Translate to translate your document, but I don't know all. So, I have some error when setup on my PC.

Thanks.

The message file for category 'yii' does not exist: /path/to/vendor/yiisoft/yii2/messages/zh_CN/yii.php Fallback file does not exist as well: /path/to/vendor/yiisoft/yii2/messages/zh/yii.php

在日常的日志巡检过程中,发现了一个不断出现在日志中的翻译的错误很是让人恼火。

The message file for category 'yii' does not exist: /path/to/vendor/yiisoft/yii2/messages/zh_CN/yii.php Fallback file does not exist as well: /path/to/vendor/yiisoft/yii2/messages/zh/yii.php

复现步骤

在vue 端,编辑地址,点保存时,即会触发上述问题。(added 20190216)

经过一番排查,基本定位到了问题的原因:关于语言定义的规范问题。

原因说明

yii 本身使用多语言的定义时,采取这样的格式:zh-CN。如下图:

image

然而 fecshop 在使用多语言的定义时,采用了格式:zh_CN。如下图:

image

fecshop 代码剖析

关于 fecshoplang service 的配置信息相关代码:

return [
    'fecshoplang' => [
        //'class' => 'fecshop\services\FecshopLang',
        //  mongoSearchLangName 在各个语言下字段参考资料如下:(不支持中文)
        //  https://docs.mongodb.com/manual/reference/text-search-languages/#text-search-languages
        'allLangCode' => [
            // 'en_US' 是标准语言简码  code对应的值en取 “标准语言简码”的前两位字符,
            // 该值设置后,进行了产品分类数据的添加后,不能修改,否则会出现部分翻译语言丢失。
            'zh_CN' => [
                'code'                    => 'zh',
            ],
        ],
        // 默认语言。
        'defaultLangCode' => 'zh',
    ],
];

上述代码位于 @common/config/fecshop_local_services/FecshopLang.php

上述代码,删除了原有的其他语言配置项,仅保留了中文。

关于 Yii i18n 的文档链接:https://www.yiiframework.com/doc/guide/2.0/en/tutorial-i18n 中的说明:

For consistency reasons, all locale IDs used in Yii applications should be canonicalized to the format of ll-CC, where ll is a two- or three-letter lowercase language code according to ISO-639 and CC is a two-letter country code according to ISO-3166.

Yii::$service->page->translate 服务中,有一方法定义如下:

    /**
     * @property $language | String,设置当前的语言。
     * 语言部分使用的是Yii2的语言功能。
     */
    protected function actionSetLanguage($language)
    {
        Yii::$app->language = $language;
    }

同时请注意,Yii::$app->language 属性也被 Yii::t() 所使用。

如下:

    public static function t($category, $message, $params = [], $language = null)
    {
        if (static::$app !== null) {
            return static::$app->getI18n()->translate($category, $message, $params, $language ?: static::$app->language);
        }

        $placeholders = [];
        foreach ((array) $params as $name => $value) {
            $placeholders['{' . $name . '}'] = $value;
        }

        return ($placeholders === []) ? $message : strtr($message, $placeholders);
    }

那么此时来讲,fecshop 的语言是什么时候被设置的呢?

答案是在 fecshop 的 store 初始化的时候。

Yii::$service->store 服务的 actionBootstrap() 方法中有关键代码如下:

Yii::$service->page->translate->setLanguage($store['language']);

而 store 的配置相关如下:

            // store key:域名去掉http部分,作为key,这个必须这样定义。
            'appserver.fecshoptest.com' => [
                'language'         => 'zh_CN',        // 语言简码需要在@common/config/fecshop_local_services/FecshopLang.php 中定义。
                'languageName'     => '中文',    // 语言简码对应的文字名称,将会出现在语言切换列表中显示。
                'currency'         => 'CNY', // 当前store的默认货币,这个货币简码,必须在货币配置中配置
                ...
            ]

至此分析结束。

修复方法

使用与 Yii 一致的语言的定义格式:

zh-CN

所有关于语言的设定的地方均要修改。

整合到微信公众号

现在流行新零售,先不说实体门店和网店,准备与微信公众号进行整合吗?

  1. 君不见做微信整合的收费都是超级黑吗?我感觉他们都是在给SaaS抹黑。fecshop完善了,搞个SaaS的版本,干掉它们
  2. 通过配置替换掉公众号自带的微信小店
  3. 会员与微信的卡包进行深度整合
  4. 在1和2的基础上提供营销方面的多种玩法。其实这才是最重要的,毕竟单纯的整合没太大意义,必须用到、用好微信的社交特性才值得这些付出

Found unrestricted file upload vulnerability

What steps will reproduce the problem?

Login the admin page and find a place to upload .jpg image. Intercept the request, change the file extension to .php and insert the content of webshell:

What is the expected result?

The backend should deny for uploading unexpected file type (with .php extension) in services/Image.php, function getUniqueImgNameInPath()

$imagePath = $imgSaveFloder.'/'.$name.$randStr.'.'.$imageType;

What do you get instead?

The php webshell was successfully uploaded to the website:

Additional info

Q A
Fecshop version 2.1.6
PHP version 7.1.13
Operating system Debian 8

支持多商城吗

What steps will reproduce the problem?

What is the expected result?

What do you get instead?

Additional info

Q A
Fecshop version 1.1.3.?
PHP version
Operating system
支持多商城吗

提示 'Method fecshop\services\Store::bootstrap() does not exist'

安装了v1.1.3.3版本,在没有配置好域名情况下执行时的报错问题:提示 'Method fecshop\services\Store::bootstrap() does not exist'。需要在vendor\fancyecommerce\fecshop\services\Store.php里添加以下代码才能正常报错:

public function bootstrap($app)
{
    $this->actionBootstrap($app);
}

安装时候出现错误

What steps will reproduce the problem?

安装时候出现下面错误:

Notice: Undefined variable: argv in /var/www/fecmall/common/config/bootstrap.php on line 18

Fatal error: Uncaught PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'fecmall.extensions' doesn't exist in /var/www/fecmall/vendor/yiisoft/yii2/db/Command.php:1290 Stack trace: #0 /var/www/fecmall/vendor/yiisoft/yii2/db/Command.php(1290): PDOStatement->execute() #1 /var/www/fecmall/vendor/yiisoft/yii2/db/Command.php(1158): yii\db\Command->internalExecute('SELECT * FROM ...') #2 /var/www/fecmall/vendor/yiisoft/yii2/db/Command.php(399): yii\db\Command->queryInternal('fetchAll', NULL) #3 /var/www/fecmall/common/config/bootstrap.php(34): yii\db\Command->queryAll() #4 /var/www/fecmall/appfront/web/index.php(25): require('/var/www/fecmal...') #5 {main} Next yii\db\Exception: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'fecmall.extensions' doesn't exist The SQL being executed was: SELECT * FROM extensions where status=1 AND installed_status=1 ORDER BY priority ASC in /var/www/fecmall/vendor/yiisoft/yii2/db/Schema.php:674 Stack trace: #0 /var/www/fecmall/vendor/yiisoft/yii2/db/Command.p in /var/www/fecmall/vendor/yiisoft/yii2/db/Schema.php on line 674

What is the expected result?

What do you get instead?

Additional info

Q A
Fecshop version 2.3.4
PHP version 7.2.19
Operating system ubuntu 19.04

安装完成后,无法打开appadmin管理界面

Windows 10
phpstudy
php 7.3.4
nginx 1.15.11
mysql 5.7.26

安装完成,期间没有报错

但是打开管理界面提示404

server {
        listen        80;
        server_name  appadmin.syuez.cn;
        root   "D:/phpstudy_pro/WWW/fecmall/appadmin/web";
        location / {
            index index.php index.html error/index.html;
            autoindex  off;
        }
        location ~ \.php(.*)$ {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            fastcgi_param  PATH_INFO  $fastcgi_path_info;
            fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
            include        fastcgi_params;
        }
}

这是nginx配置

nginx 错误日志

2020/01/04 14:32:28 [error] 2596#9956: *57 CreateFile() "D:/phpstudy_pro/WWW/fecmall/appadmin/web/fecadmin/login/index" failed (3: The system cannot find the path specified), client: 127.0.0.1, server: appadmin.syuez.cn, request: "GET /fecadmin/login/index HTTP/1.1", host: "appadmin.syuez.cn"

为什么会出现/fecadmin/这个目录,在/appadmin/web/下,我看到没有这个目录,这是在安装过程中自动生成的吗?

typo report with *response*

What steps will reproduce the problem?

see the source code

What is the expected result?

correct spelling with response

What do you get instead?

reponse

Additional info

Q A
Fecshop version 1.4.6.4
PHP version Any
Operating system Any

安装不上。

What steps will reproduce the problem?

mongodb is not installed ??

What is the expected result?

What do you get instead?

Additional info

Q A
Fecshop version 1.1.3.?
PHP version
Operating system

Very nice Yii2 project

Very nice Yii2 project

This is Yii2 inside, I have seen the best open source project, thanks for sharing

关于 Code Style 的提议

这不是一个 bug report,这是一个关于建立代码规范的建议。

我建议,遵循 PSR1 PSR2 规范。然后基于此基础再制订其它规范。

如何写规则?

在项目里建一个 .php_cs.dist 文件。可参考 这个

如何使用工具进行检测和处理规范问题?

symfony 框架作者写的工具 php-cs-fixer

@fancyecommerce 有兴趣推动一下吗?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.