예제 #1
0
파일: queue.php 프로젝트: Junec/core
 public function __construct($host = '', $block = 'mcq1')
 {
     $this->cache = core_cache_client::factory('memcached', array('host' => $host));
     $this->prefix = $block . $this->prefix;
     $this->add($this->beginKey, 0);
     $this->add($this->endKey, 0);
 }
예제 #2
0
파일: index.php 프로젝트: Junec/admin
 public function test()
 {
     $db = core_database_client::factory('mysql', array('server' => 'lnmp', 'username' => 'root', 'password' => '...', 'port' => 3306, 'database' => 'mysql'));
     #$res = $db->select('user','*');
     #print_r($res);
     $request = core_request_client::factory('curl', 3);
     $res = $request->get('http://lnmp/s.php?id=1&type=2');
     echo '|';
     print_r($res);
     echo '|';
     $cache = core_cache_client::factory('filesystem', array('cache_dir' => 'd:/'));
     $cache = core_cache_client::factory('memcache', array('host' => '191.101.9.232:11212'));
     $res = $cache->set('test', array(1, 2, 3));
     $res = $cache->get('test');
     #var_dump($res);
     #sleep(2);
     $this->assign('a1', '<b>this is a1</b>');
     $this->assign('a2', array('this', 'is', 'a2'));
     $this->assign('a3', time());
     $this->display('test.html');
 }