PHPackages                             scalpel/core - 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. scalpel/core

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

scalpel/core
============

The core components of my PHP applications

0181PHP

Since Apr 24Pushed 7y ago1 watchersCompare

[ Source](https://github.com/nangongxixi/core)[ Packagist](https://packagist.org/packages/scalpel/core)[ RSS](/packages/scalpel-core/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (1)

概述
--

[](#概述)

一些基础php组件

1. 配置
2. 缓存
3. 动态方法管理
4. 调试工具
5. 服务定位容器
6. 错误管理
7. 事件管理
8. 日志管理
9. 网络基础库
10. 安全工具
11. 其它工具

安装
--

[](#安装)

```
composer install scalpel/core

```

Usage
-----

[](#usage)

tool
----

[](#tool)

**ListFilter**

根据keys过滤数组元素

```
$listFilter->filter(sourceArray, keys)

```

example

```
  $array = [
        [
            'id' => 1, 'title' => "title", 'images' => [
                ['title' => "title", "src" => '1233', 'id' => 2],
                ['title' => "title", "src" => '1233', 'id' => 2],
            ]
        ],
        [
            'id' => 1, 'title' => "title", 'images' => [
                ['title' => "title", "src" => '1233', 'id' => 2],
                ['title' => "title", "src" => '1233', 'id' => 2],
            ]
        ]
    ];

    $listFilter = new ListFilter();
    $return = $listFilter->filter($array, [
        'id|int', 'title@name',
        ['images', ['src', 'id'], true],
        'images.id@imgId'
    ]);

    var_dump($return);

```

keys语法: array\[item, item\], item格式支持:

1. string 字段
2. string.string
3. array\[item, keys\]

Todo
----

[](#todo)

1. 详细列出 di的配置形式
2. 处理Base::createObject()的参数或是丢弃此类, 统一使用DI容器创建对象

```
Module::__constuct($id, $app);

admin => [
   class => X
   var => Value
]

Base::createObject(Array, [id, this])
# 一旦配置为数组, 导致丢弃第二参数导致错误

```

Base::createObject()
--------------------

[](#basecreateobject)

1. 参数1为数组, 丢弃第二个参数
2. 参数1为字串, 使用第二个参数用于构造函数

DI::createObject
----------------

[](#dicreateobject)

1. 不为callback, 丢弃第二个参数
2. 为callback, 使用第二个参数传递到callback

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/4a1462b884f3e73aeba6935fd74558117cea75d1b5c0dfe61cf13789f1cd777d?d=identicon)[nangongxixi](/maintainers/nangongxixi)

---

Top Contributors

[![nangongxixi](https://avatars.githubusercontent.com/u/20634027?v=4)](https://github.com/nangongxixi "nangongxixi (2 commits)")

### Embed Badge

![Health badge](/badges/scalpel-core/health.svg)

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

PHPackages © 2026

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