Ejemplo n.º 1
0
<?php

global $php;
SiteDict::$swoole = $php;
/**
 * 字典处理器,依赖于缓存系统
 * 读取/写入来自于文件系统的一个数据,并写入缓存
 * @author Tianfeng.Han
 * @package SwooleSystem
 * @subpackage dict
 */
class SiteDict
{
    static $swoole;
    static $cache_life = 600;
    static $data_dir = DICTPATH;
    public $table = 'site_dict';
    function __construct()
    {
        #import('app.SwooleDict');
    }
    /**
     * 读取字典内容
     * @param $dictname
     */
    static function get($dictname)
    {
        if (!self::$swoole->cache) {
            Error::info('SiteDict Cache Error', 'Please load Cache!');
        }
        $cache_key = 'sitedict_' . $dictname;