本文整理汇总了PHP中base_kvstore::kvprefix方法的典型用法代码示例。如果您正苦于以下问题:PHP base_kvstore::kvprefix方法的具体用法?PHP base_kvstore::kvprefix怎么用?PHP base_kvstore::kvprefix使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类base_kvstore
的用法示例。
在下文中一共展示了base_kvstore::kvprefix方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: create_key
public function create_key($key)
{
if (isset($key[201])) {
return parent::create_key($key);
}
return sprintf("%s/%s/%s", base_kvstore::kvprefix(), $this->prefix, $key);
}
示例2: __construct
function __construct($prefix)
{
if (!isset(self::$_mongodb)) {
$server = defined('MONGODB_SERVER_CONFIG') ? MONGODB_SERVER_CONFIG : "mongodb://localhost:27017";
$option = defined('MONGODB_OPTION_CONFIG') ? eval(MONGODB_OPTION_CONFIG) : array("connect" => TRUE);
$m = new MongoClient($server, $option);
$db = $m->vmcshop_kvstore;
self::$_mongodb = $db->selectCollection(base_kvstore::kvprefix());
}
$this->prefix = $prefix;
}
示例3: __construct
function __construct($prefix)
{
if (!isset(self::$_mongodb)) {
$hosts = (array) config::get('kvstore.base_kvstore_mongodb.hosts', 'mongodb://localhost:27017');
$options = config::get('kvstore.base_kvstore_mongodb.options', array("connect" => TRUE));
$hosts = implode(',', $hosts);
$m = new MongoClient($hosts, $options);
$db = $m->ecos;
//todo 需要改成config配置
self::$_mongodb = $db->selectCollection(base_kvstore::kvprefix());
}
$this->prefix = $prefix;
}
示例4: __construct
function __construct($prefix)
{
if (!isset(self::$_mongodb)) {
$server = defined('MONGODB_SERVER_CONFIG') ? MONGODB_SERVER_CONFIG : "mongodb://localhost:27017";
$option = defined('MONGODB_OPTION_CONFIG') ? eval(MONGODB_OPEION_CONFIG) : array("connect" => TRUE);
$m = new Mongo($server, $option);
// var_dump($m);exit;
$db = $m->ecos;
//todo 需要改成config配置
self::$_mongodb = $db->selectCollection(base_kvstore::kvprefix());
}
$this->prefix = $prefix;
}
示例5: index
public function index()
{
$this->pagedata['enable'] = get_class(cachemgr::instance()) == 'base_cache_nocache' ? 'false' : 'true';
if (cachemgr::status($status)) {
// foreach ($status as $key => $value) {
// $status_obj[] = array(
// 'label'=>$key,
// 'data'=>$value
// );
// }
$this->pagedata['status'] = $status;
}
$this->pagedata['cache_name'] = cachemgr::instance()->name;
$this->pagedata['static_cache'] = array();
$this->pagedata['syscache'] = array('setting_cache' => syscache::instance('setting')->get_status(), 'service_cache' => syscache::instance('service')->get_status());
$this->pagedata['kvstore'] = array('name' => vmc::singleton('base_kvstore')->get_controller()->name, 'kvprefix' => base_kvstore::kvprefix());
foreach (vmc::servicelist('site.router.cache') as $value) {
if (!method_exists($value, 'get_cache_methods')) {
continue;
}
$methods = $value->get_cache_methods();
foreach ((array) $methods as $method) {
if (isset($method['app']) && isset($method['ctl']) && isset($method['act'])) {
$expires = app::get('site')->getConf($method['app'] . '_' . $method['ctl'] . '_' . $method['act'] . '.cache_expires');
if ($expires !== null) {
$method['expires'] = $expires;
}
$this->pagedata['static_cache'][] = $method;
}
}
}
foreach (vmc::servicelist('mobile.router.cache') as $value) {
if (!method_exists($value, 'get_cache_methods')) {
continue;
}
$methods = $value->get_cache_methods();
foreach ((array) $methods as $method) {
if (isset($method['app']) && isset($method['ctl']) && isset($method['act'])) {
$expires = app::get('mobile')->getConf($method['app'] . '_' . $method['ctl'] . '_' . $method['act'] . '.cache_expires');
if ($expires !== null) {
$method['expires'] = $expires;
}
$this->pagedata['mstatic_cache'][] = $method;
}
}
}
$this->page('cachestage/index.html');
}
示例6: __construct
function __construct($prefix)
{
if (!isset(self::$_mongodb)) {
$server = defined('MONGODB_SERVER_CONFIG') ? MONGODB_SERVER_CONFIG : "mongodb://localhost:27017";
$option = defined('MONGODB_OPTION_CONFIG') ? eval(MONGODB_OPEION_CONFIG) : array("connect" => TRUE);
$m = new Mongo($server, $option);
// Andrew 20121023
// 更改collection名称
$db = $m->tnf_store;
//todo 需要改成config配置
self::$_mongodb = $db->selectCollection(base_kvstore::kvprefix());
// Andrew 20121120
self::$_mongodb->ensureIndex(array('key' => 1));
}
$this->prefix = $prefix;
}
示例7: create_key
public function create_key($key)
{
return md5(base_kvstore::kvprefix() . $this->prefix . $key);
}