PHPackages                             swordfly1979/php-library - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. swordfly1979/php-library

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

swordfly1979/php-library
========================

一个自定义php工具库

v0.0.2(6y ago)026PHP

Since Feb 21Pushed 5y ago1 watchersCompare

[ Source](https://github.com/swordfly1979/phpLibrary)[ Packagist](https://packagist.org/packages/swordfly1979/php-library)[ RSS](/packages/swordfly1979-php-library/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (2)Used By (0)

一些php常用工具类
==========

[](#一些php常用工具类)

安装：`composer require swordfly1979/php-library`

---

DataImport
----------

[](#dataimport)

数据导入类，依赖phpoffice/phpspreadsheet。使用前先安装： `composer require phpoffice/phpspreadsheet``use swordfly1979\DataImport`

- ### excel() excel导入

    [](#excel-excel导入)

    ```
    $import = new DataImport()
    $list = $import->excel($param)

    $param['url'] 导入的文件咱径(必填)
    $param['isHead'] 是否包含表头 默认：false
    $param['format'] 导入的数据格式替换: 如 ['A'=>'yourKeyName'...]
    ```

---

DataExport
----------

[](#dataexport)

数据导出类依赖 phpoffice/phpspreadsheet `use swordfly1979\DataExport`

- ### excel() 导出excel

    [](#excel-导出excel)

    ```
    $export = new DataExport()
    $list = $export->excel($param)

    $param['list'] array 需要导出的数据 (必填项)
    $param['header'] array 导出的表头及格式 (选填,不填不导出表头)，如设置表头，导出的数据列以表头为准
    $param['fileName] string 导出文件名 选填 （选填，不填默认 Y-m-d导出数据
    $param['title'] string 导出的表title （选填）
    数据示例
    $param['list']
    $list = [
        [
            'nickname' => '张三',
            'mobile' => '15000000000',
            'total' => 14
        ],
        [
            'nickname' => '李四',
            'mobile' => '15800000000',
            'total' => 54
        ],
        [
            'nickname' => '王五',
            'mobile' => '15100000000',
            'total' => 554
        ],
        [
            'nickname' => '赵六',
            'mobile' => '13800000000',
            'total' => 74
        ]
    ];
    $param['head']数据示例
    $header = [
        [
            'title' => '手机',  //导出的表列名称（必填）
            'key' => 'mobile', //对应的$param['list']数据键值（必填）
            'type' => 'str',   //数据类型（选填，不填自动判断） str字符串；n数值；b布尔; null空；inlineStr
            ‘value'=>’void‘ //此列固定填充值（选填）
        ],
        [
            'title' => '昵称',
            'key' => 'nickname',
            'type' => 'str',
        ],
        [
            'title' => '昵称2',
            'type' => 'str',
            'value' =>'张三'
        ]
    ]
    ```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2278d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/44988237?v=4)[swordfly1979](/maintainers/swordfly1979)[@swordfly1979](https://github.com/swordfly1979)

---

Top Contributors

[![swordfly1979](https://avatars.githubusercontent.com/u/44988237?v=4)](https://github.com/swordfly1979 "swordfly1979 (31 commits)")

### Embed Badge

![Health badge](/badges/swordfly1979-php-library/health.svg)

```
[![Health](https://phpackages.com/badges/swordfly1979-php-library/health.svg)](https://phpackages.com/packages/swordfly1979-php-library)
```

###  Alternatives

[marcj/topsort

High-Performance TopSort/Dependency resolving algorithm

24715.6M50](/packages/marcj-topsort)[livewire/volt

An elegantly crafted functional API for Laravel Livewire.

4195.3M84](/packages/livewire-volt)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
