Download the PHP package aoding9/dcat-xlswriter-export without Composer

On this page you can find all versions of the php package aoding9/dcat-xlswriter-export. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package dcat-xlswriter-export

简介

dcat扩展:xlswriter导出

之前用了laravel-excel做数据导出,很耗内存速度也慢,数据量大的时候内存占用容易达到php上限,或者响应超时,换成xlswriter这个扩展来做。

由于直接导出的表格不太美观,经常需要进行合并单元格和自定义表格样式等操作,我对此进行了一些封装,使用更加方便直观。

本扩展是laravel-xlswriter-export 的dcat版本,使用文档直接看laravel-xlswriter-export的readme即可,此处只介绍不同点。

安装

首先按文档把xlswriter扩展安装上

https://xlswriter-docs.viest.me/

在phpinfo中确认安装成功后,进行下一步

composer require aoding9/dcat-xlswriter-export

国内composer镜像如果安装失败,请设置官方源

composer config -g repo.packagist composer https://packagist.org

官方源下载慢,国内镜像偶尔出问题可能导致安装失败,也可以把以下代码添加到composer.json,直接从github安装

如果无法访问github,可以将url改为gitee:https://gitee.com/aoding9/dcat-xlswriter-export

使用

1.定义导出类

和laravel-xlswriter-export相同,不同点在于,不传参数将使用dcat中grid的查询构造器作为数据源,另外由于make方法与dcat不兼容,只能使用new的方式。

2、在控制器中使用

在grid方法中使用$grid->export(new UserExport());即可

由于构造函数传参为空,数据源为other类型,走buildDataFromOther获取grid数据,如有特殊需要,可以重写该方法修改获取到的数据

3、通过swoole使用

由于swoole中不能调用exit()方法,需要在控制器中直接return下载响应

为此,需要在导出类中将$useSwoole属性设为true,然后在dcat控制器中引入HandleExportIfUseSwoole,这个trait将重写index方法,以正确地触发下载

版本更新


All versions of dcat-xlswriter-export with dependencies

PHP Build Version
Package Version
Requires laravel/framework Version ~5.5|~6.0|~7.0|~8.0|~9.0|~10.0
dcat/laravel-admin Version 2.*
php Version >=7.1.0
viest/php-ext-xlswriter-ide-helper Version dev-master
ext-xlswriter Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package aoding9/dcat-xlswriter-export contains the following files

Loading the files please wait ....