blainesch/li3_memoize

有助于缓存昂贵的辅助/模型实例方法。

安装: 7

依赖项: 0

建议者: 0

安全性: 0

星标: 2

关注者: 1

分支: 0

类型:lithium-library

dev-master 2012-11-08 03:09 UTC

This package is not auto-updated.

Last update: 2024-09-14 12:16:04 UTC


README

有助于缓存昂贵的辅助/模型实例方法。

Build Status

安装

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')
	),
));