PHPackages                             lin/components - 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. lin/components

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

lin/components
==============

lin框架组件

1.0.0(7y ago)3441Apache-2.0PHPPHP ^7.2.0

Since Jan 22Pushed 7y ago1 watchersCompare

[ Source](https://github.com/linlanye/lin-components)[ Packagist](https://packagist.org/packages/lin/components)[ Docs](https://github.com/linlanye/lin-components)[ RSS](/packages/lin-components/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (1)Versions (3)Used By (1)

Lin-components/1.0
==================

[](#lin-components10)

[![Latest Stable Version](https://camo.githubusercontent.com/577ff062b4edbfc97944b19f48269739beca9e2dec610558fc59b3bf378aadc3/68747470733a2f2f706f7365722e707567782e6f72672f6c696e2f636f6d706f6e656e74732f762f737461626c65)](https://packagist.org/packages/lin/components)[![Total Downloads](https://camo.githubusercontent.com/13fd174eb16e11cbe5feb77624289b3a4f31591aa123f047a64f233b21b07d18/68747470733a2f2f706f7365722e707567782e6f72672f6c696e2f636f6d706f6e656e74732f646f776e6c6f616473)](https://packagist.org/packages/lin/components)[![PHP Version](https://camo.githubusercontent.com/facf49f38d3f6bf192c14ce71a5e2479a4641044e627d4b7a27e4298a3002704/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344372e322d3838393242462e737667)](http://www.php.net/)[![License](https://camo.githubusercontent.com/638e5edb406a1958fb7ef0d098d7e2349c320d37f2f0c600f2497686a1e7926e/68747470733a2f2f706f7365722e707567782e6f72672f6c696e2f636f6d706f6e656e74732f6c6963656e7365)](https://packagist.org/packages/lin/components)

介绍
--

[](#介绍)

**Lin-components**是[Lin](https://www.lin-php.com)框架的组件代码，这套组件可以独立于框架运行，它涵盖了常用的web方法和功能，是一套完备的web开发组件集合。其基于[basement](https://github.com/linlanye/basement)(一套web常见功能的开发规范)项目，并提供了更为多样的功能。

特性
--

[](#特性)

- 自带高性能**kv、queue**型模拟服务器，无需安装`redis`和`memcached`等缓存或队列服务器，并能一键实现无缝替换为专用服务器。
- 原生透明化支持SQL、Key-Value、Queue等服务器主从、多节点访问。
- 极简主义设计。所有的方法无论命名、调用都保持简单一致，对外屏蔽了复杂的设计模式，**只呈现最基本的php语法**，避免二次学习成本。例如入参和出参都仅有php基础变量。
- 零耦合。组件里的每一个小组件都相互独立，之间没有直接性耦合，**皆可以作为一个单独的包使用**。
- 涵盖场景广。对web应用场景做了深度涵盖，组件所提供的功能可以**满足大型开发需求**。
- 高度整合。对很多相似的功能做了统一化，如对**验证码、oauth、login-in、XSRF、单点登录**等安全场景，都只需一个简单的类`Security`和其仅有的几个方法组合实现。
- 学习简单。所有**复杂的概念都被屏蔽**，使用者开发时的逻辑思维只需单向进行，如关联关系模型中，n对n的直接关联或远程关联等复杂概念都被屏蔽，使用者只需考虑单方向的主从关系（定义主到从模型即可，无需定义从到主模型）

功能列表
----

[](#功能列表)

- [basement组件](https://github.com/linlanye/basement)及功能扩展。
- 完整的ORM，包括模型类和查询构建类，对复杂sql语句具有高度处理能力。
- 全面化的数据处理，包括数据映射、数据格式化、数据校验等。
- 完善的响应方式，json、xml、视图页面、http常见响应等。
- 高性能路由，无论哪种风格的路由皆可以轻松构建并快速解析。
- 完备的安全处理，强化保障各个web安全场景。
- 弹性化的session，可一键切换多种session存储方式。
- 灵活的url生成，无论动态或静态url轻松实现。
- 完备简洁的视图引擎，贴近php的原生语法，并可实现页面的全局或局部静态化。
- 扩展了的mvc模式，提供更灵活和更统一的调度方式，并可实现流程流水化执行，降低耦合，省略大量`if-else`。
- 更快速的算法库，如对称加密算法有数据量低、瞬时加解密、动态加密、超高安全特性等。

安装
--

[](#安装)

```
配置composer.json文件
"require": {
    "lin/components": "^1.0"
}
执行composer install

```

或命令行执行

```
composer require lin/components 1.0

```

使用
--

[](#使用)

使用前需先通过[basement](https://github.com/linlanye/basement)加载配置文件

```
Linker::Config()::set('lin', include 'config/lin-production.php'); //按需修改并加载组件配置项（生产环境）
Linker::Config()::set('servers', include 'config/lin-servers.php'); //加载服务器配置项

```

测试
--

[](#测试)

安装memcached和redis服务器，并使这二者数据为空，配置`config/test-servers.php`文件，执行`phpunit`后，清空memcached和redis数据即可。（若不想测试这二者，可将`phpunit.xml`中的`redis`和`memcached`组排除在外）

详细文档
----

[](#详细文档)

- [github](https://github.com/linlanye/lin-docs)
- [官网](https://docs.lin-php.com)

捐赠
--

[](#捐赠)

[![捐赠林澜叶](https://camo.githubusercontent.com/d1564c70505b5ea82069cab2c3da177f1d950d4ed58424e12f7aba8d57bb2d67/68747470733a2f2f696d672e6c696e2d7068702e636f6d2f646f6e6174696f6e732e706e67)](https://camo.githubusercontent.com/d1564c70505b5ea82069cab2c3da177f1d950d4ed58424e12f7aba8d57bb2d67/68747470733a2f2f696d672e6c696e2d7068702e636f6d2f646f6e6174696f6e732e706e67)

版权信息
----

[](#版权信息)

- 作者：林澜叶(linlanye)版权所有。
- Email：
- 开源协议：[Apache-2.0](LICENSE)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity56

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 ~0 days

Total

2

Last Release

2670d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/933fe7e15e77d7cc8515ffb00919adfb38668a8cccc2869127e7b21084c0cf13?d=identicon)[linlanye](/maintainers/linlanye)

---

Top Contributors

[![linlanye](https://avatars.githubusercontent.com/u/16683274?v=4)](https://github.com/linlanye "linlanye (69 commits)")

---

Tags

componentsPHP7linlinlanye

### Embed Badge

![Health badge](/badges/lin-components/health.svg)

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

###  Alternatives

[knplabs/knp-components

Knplabs component library

77343.6M46](/packages/knplabs-knp-components)[livewire/flux

The official UI component library for Livewire.

9385.0M86](/packages/livewire-flux)[league/uri-components

URI components manipulation library

31932.3M67](/packages/league-uri-components)[nette/component-model

⚛ Nette Component Model

28516.5M92](/packages/nette-component-model)[dereuromark/cakephp-tools

A CakePHP plugin containing lots of useful and reusable tools

338920.1k32](/packages/dereuromark-cakephp-tools)[qaribou/immutable.php

Immutable, highly-performant collections, well-suited for functional programming and memory-intensive applications.

344146.0k](/packages/qaribou-immutablephp)

PHPackages © 2026

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