Example #1
0
 public function __construct($host, $port, $ttl)
 {
     $this->console = Console::create('cache');
     $this->ttl = $ttl;
     $this->mem = new Memcache();
     $this->mem->pconnect($host, $port);
     $this->console->log('Connecting:', $host . ':' . $port, '[ttl:' . $ttl . 's]');
 }
Example #2
0
 public static function setup($domain, $prefix, $host, $port, $ttl)
 {
     self::$domain = $domain;
     self::$prefix = $prefix;
     self::$console = Console::create('session');
     self::$ttl = $ttl;
     self::$mem = new Memcache();
     self::$mem->pconnect($host, $port);
     self::$console->log('Connecting:', $host . ':' . $port, '[ttl:' . $ttl . 's]');
 }
Example #3
0
 public function __construct($controllerPath, $cntName, $methodName, $params, $req, $res)
 {
     $this->name = $cntName;
     $this->method = $methodName;
     $this->params = $params;
     $this->reqMethod = $_SERVER['REQUEST_METHOD'];
     $this->request = $req;
     $this->response = $res;
     $this->console = Console::create('router/controllerhub');
     // start operation
     $this->init($controllerPath);
     $this->run();
 }
Example #4
0
 public function __construct()
 {
     $this->console = Console::create('router');
     $this->reqHook = new Hook('request');
     $this->uri = $_SERVER['REQUEST_URI'];
     // make sure to get rid of query string
     $pos = strpos($this->uri, '?');
     if ($pos !== false) {
         $this->uri = substr($this->uri, 0, $pos);
     }
     // register exception handler
     ExceptionHandler::add('respondException', $this);
 }
Example #5
0
 public function __construct($type, $host, $dbname, $user, $password, $dataName)
 {
     // logger
     $name = $type . '.' . $dbname . ':' . $dataName;
     $this->console = Console::create($name);
     // connect to db
     $connect = $type . ':';
     $connect .= 'host=' . $host . ';';
     $connect .= 'dbname=' . $dbname . ';';
     $connect .= 'charset=utf8';
     // use connection pooling
     $options = array(PDO::ATTR_PERSISTENT => true);
     $this->console->log('Connecting:', $type, $user . '@' . $host . '.' . $dbname, '[password:'******'true' : 'false') . ']');
     $this->cn = new PDO($connect, $user, $password, $options);
 }
Example #6
0
 public function __construct($dataName)
 {
     $this->dataName = $dataName;
     $this->console = Console::create($this->NAME . $dataName);
 }
Example #7
0
 public function __construct($name)
 {
     $this->console = Console::create($name . '.hook');
 }