PHPackages                             lkcodes/mycode - 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. lkcodes/mycode

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

lkcodes/mycode
==============

A collection of commonly used tools, such as exporting tables, manipulating databases,File caching, string processing/encoding and decoding, array and object conversion, and so on. It can be used in any framework

1.5.7(6y ago)144MITPHP

Since Oct 17Pushed 6y ago1 watchersCompare

[ Source](https://github.com/linkaias/code)[ Packagist](https://packagist.org/packages/lkcodes/mycode)[ RSS](/packages/lkcodes-mycode/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)Dependencies (3)Versions (3)Used By (0)

\#备注

\#####代码引入

```
composer require lkcodes/mycode

```

\#####代码初始化

```
//在项目公共加载位置添加如下代码
(new \lkcodes\Mycode\lib\ParentController());

```

运行项目会生成config.php文件 /lkcodes/mycode/src/lib/config.php 如未生成会使用备用配置文件 /lkcodes/mycode/src/lib/config\_bak.php 请检查文件权限以自动生成或手动复制备用配置文件 #####修改数据库配置文件

```
 array (
    'db_host' => '127.0.0.1',
    'db_name' => 'dbname',
    'db_user' => 'root',
    'db_pwd' => 'root',
    'db_port' => '3360',
  ),

```

\#####查看助手方法

```
//使用此方法可打印出所有助手方法
http:test.php?showhelper

```

\#####使用助手方法

```
//友好的变量输出
dump($arr);

```

\#####使用kint代码调试器

```
//使用trace
//在config.php中配置开启（默认开启）
Kint\Kint::trace();
//打印变量
Kint\Kint::trace($array);
//若开启助手方法可使用
d($array);
~d($array);等
详情请参考kint官方文档

```

\#####使用DB库操作数据库

```
//首先配置好config.php配置项
基本使用：
//基本代码查询/执行
$res = (new \lkcodes\Mycode\lib\DB())->query($sql);

//快捷查询/执行操作 在地址栏输入
http:test.php?query_q=你的查询语句
如：http:test.php?query_q=show databases;

//可视化切换数据库快捷查询
http:test.php?query_t=1
//会出现可视化视图

```

\#####使用集成phpoffice导出/导入表格

```
//导出表格
$table = new \lkcodes\Mycode\lib\Excel();
$data=[
    ['test1'=>'value1','test2'=>'value2','test3'=>'value3']
];
$param=[
                 'name'=>'风险广告列表', //文件名称
                 'suffix'=>'xlsx',  //文件后缀
                 'top_title'=>['ID','姓名','age'], //首行标题
                 'title'=>'title',
                 'data_title'=>['test1','test2','test3'], 数组对应字段
                 'description'=>'文件描述',
                 'keywords'=>'关键词',
                 'category'=>'分类',
               ];
$table->exportData($data,$param);
//若导出表格字段带有图片 则在数组对应字段中加入前缀 _IMG_
//示例
$param=[
            'name'=>'测试',
            'suffix'=>'xlsx',
            'top_title'=>['图片','姓名'],
            'title'=>'title',
            'data_title'=>['_IMG_file_path','name'],
            'description'=>'文件描述',
            'keywords'=>'关键词',
            'category'=>'分类',
        ];
        $info =[
            ['_IMG_file_path'=>"./static/theme/img/404_icon.png",'name'=>'张三'],
            ['_IMG_file_path'=>"./static/theme/img/404_icon.png",'name'=>'李四'],
        ];
        (new \lkcodes\Mycode\lib\Excel())->exportData($info,$param);die;

//导入表格数据 return array;
$table = new \lkcodes\Mycode\lib\Excel();
$table->importTable('/1.xlsx');

```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

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

Every ~31 days

Total

2

Last Release

2370d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d34c3ebd76840fe8518b17d8d489d13637ec34e57ed6491883920952e1f1c3bd?d=identicon)[a jug of wine](/maintainers/a%20jug%20of%20wine)

---

Top Contributors

[![goRiceCooker](https://avatars.githubusercontent.com/u/121207157?v=4)](https://github.com/goRiceCooker "goRiceCooker (63 commits)")

### Embed Badge

![Health badge](/badges/lkcodes-mycode/health.svg)

```
[![Health](https://phpackages.com/badges/lkcodes-mycode/health.svg)](https://phpackages.com/packages/lkcodes-mycode)
```

###  Alternatives

[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)[in2code/powermail

Powermail is a well-known, editor-friendly, powerful and easy to use mailform extension for TYPO3 with a lots of features

982.5M38](/packages/in2code-powermail)[blair2004/nexopos

The Free Modern Point Of Sale System build with Laravel, TailwindCSS and Vue.js.

1.2k2.3k](/packages/blair2004-nexopos)[solspace/craft-freeform

The most flexible and user-friendly form building plugin!

52664.9k12](/packages/solspace-craft-freeform)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

116.6k](/packages/tomshaw-electricgrid)

PHPackages © 2026

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