PHPackages                             vincentmi/ccm - 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. vincentmi/ccm

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

vincentmi/ccm
=============

A simple common calculation model

1.0.17(8y ago)2274MITPHPPHP &gt;=5.5.0

Since Nov 20Pushed 8y ago1 watchersCompare

[ Source](https://github.com/vincentmi/ccm)[ Packagist](https://packagist.org/packages/vincentmi/ccm)[ Docs](https://vnzmi.com/ccm)[ RSS](/packages/vincentmi-ccm/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (10)Dependencies (1)Versions (18)Used By (0)

ccm
===

[](#ccm)

Common Calculation Model .

简介
--

[](#简介)

工作遇到的情况，需要根据一堆数学模型运算产生结果。作为投资的参考。 写了个简单的框架进行管理。

author:

blog:

特性
--

[](#特性)

- 通过 `$context->addInterceptor()` 添加拦截器可以对指定的域进行拦截 实现按需加载参数 ，比如 `db.project.area` 载入`project`表的`area`字段载入到上下文中
- 根据`context->fetch` 获取的数据量，只会运行涉及到该运算的公式。所以虽然整个模型非常庞大 但是只有需要时才会运行相关的公式。
- 如果某一运算涉及的公式非常多 `rset()`因为会检查变量的依赖会导致进行依赖检查耗费太多时间，建议 使用`reset()`重置后再进行运算。

使用
--

[](#使用)

修改`composer.json`

```
composer require vincentmi/ccm

//或者
手动修改项目的 composer.json文件

"require": {
    	"vincentmi/ccm": "1.*"
}
```

更新依赖包

```
composer update
```

测试代码

```
