blainesch / li3_memoize
有助于缓存昂贵的辅助/模型实例方法。
dev-master
2012-11-08 03:09 UTC
This package is not auto-updated.
Last update: 2024-09-14 12:16:04 UTC
README
有助于缓存昂贵的辅助/模型实例方法。
安装
Composer
{ "require": { ... "blainesch/li3_memoize": "dev-master" ... } }
php composer.phar install
子模块
git submodule add git://github.com/BlaineSch/li3_memoize.git libraries/li3_memoize
直接克隆
git clone git://github.com/BlaineSch/li3_memoize.git libraries/li3_memoize
用法
加载插件
将插件添加到Lithium的自动加载魔法中
在 app/config/bootstrap/libraries.php
中添加
<?php Libraries::add('li3_memoize'); ?>
指定要缓存哪些实例方法
<?php use li3_memoize\extensions\Memoize; Memoize::add(array( array( 'name' => 'app\extensions\helper\Prose', 'method' => array('init') ), array( 'name' => 'app\models\Users', 'method' => array('name') ), ));