pupuk / blog

My New Blog. Record & Share. Focus on PHP, MySQL, Javascript and Golang.
MIT License
9 stars 2 forks source link

PHP导出Excel插件进化 #11

Open pupuk opened 5 years ago

pupuk commented 5 years ago

缘由

某个业务小组在升级到PHP7.1以后,发现一个导出Excel的给功能不能使用,导出的时候chrome报 network error。对比到升级前后之前的变化,可以发现唯一的变化,就是PHP的版本由5.6升级到了PHP7.1.18,小伙伴查阅资料,也应证了PHPExcel,某些地方已经不能兼容PHP7.1.18了,为了大家都能选择合适的Excel导出工具,整理了如下的插件进化流程。

进化

1、PHPExcel github地址https://github.com/PHPOffice/PHPExcel 不过这个插件在2015年停止了维护,迁徙到新的项目PhpSpreadsheet。那个时候,PHP7.0刚刚诞生,PHP7.1和PHP7.2还没有出来,所以也可以想象这个PHPExcel对PHP7的支持情况。当然他们github上也做了如下说明:

PHPExcel last version, 1.8.1, was released in 2015. The project is no longer maintained and should not be used anymore.

All users should migrate to its direct successor PhpSpreadsheet, or another alternative.

In a few months, the GitHub project will be marked as archived, so everything will be read-only.

2、PhpSpreadsheet,github地址(https://github.com/PHPOffice/PhpSpreadsheet) 这个新开的项目使用了大量的php新特性,比如命名空间,PSR标准,性能也比PHPExcel高了不少。