多个Yii项目之间共享CMemCache

红色部分为重要留意部分!

// application components
    'components'=>array(
        'user'=>array(
            // enable cookie-based authentication
            'allowAutoLogin'=>true,
            'stateKeyPrefix' => 'KOPUSTATE',
            'identityCookie'=>array('domain' => APPLICATION_COOKIE_DOMAIN,'path' => '/'),
        ),
        
        'session'=>array(
            'cookieParams' => array(
                'path'=>'/',
                'domain'=> APPLICATION_COOKIE_DOMAIN
            ),
            'class'=> 'CCacheHttpSession',
            'cacheID' => 'mcache',
            'timeout' => 3600
        ),
        'mcache' => array(
            'class' => 'system.caching.CMemCache',
            'keyPrefix' => "KOPUMCACHE",
            'servers' => array(
                array('host' => MEMCACHED_HOST, 'port' => MEMCACHED_PORT),
            ),
        ),
    )

 

posted on 2013-04-03 15:45  技术员  阅读(318)  评论(0编辑  收藏  举报

导航