/** * Create a new instance for magic data storage. * @param string $name The name assigned to this storage object */ public function __construct($name) { parent::__construct($name); $db = MDB2::singleton(); if (!($db_name = $db->database_name)) { I2CE::raiseError("No database to connect to MongoDB"); return false; } if (!($db_password = $db->dsn['password'])) { I2CE::raiseError("No password to connect to MongoDB"); return false; } if (!($db_user = $db->dsn['username'])) { I2CE::raiseError("No user to connect to MongoDB"); return false; } $conn_string = "mongodb://localhost:27017"; //$conn_string = 'mongodb:///tmp/mongo-27017.sock'; try { $this->m = new Mongo($conn_string); } catch (Exception $e) { I2CE::raiseError("Could not connect to mongodb using: " . $conn_string); return false; } }
/** * Create a new instance for magic data storage. * @param string $name The name assigned to this storage object */ public function __construct($name) { parent::__construct($name); if (class_exists('Memcached', false)) { $this->memcached = new Memcached(); if (count($this->memcached->getServerList()) == 0) { $this->memcached->addServer('127.0.0.1', 11211); } } }
public function __construct($name) { parent::__construct($name); $this->db = MDB2::singleton(); $this->setUpStatements(); $this->db->query("SET SESSION group_concat_max_len = @@max_allowed_packet"); $res = $this->db->query("SELECT @@group_concat_max_len = @@max_allowed_packet AS use_quick, @@group_concat_max_len as len"); if (I2CE::pearError($res, "Bad statement") || !($row = $res->fetchRow())) { I2CE::raiseError("Bad group concat check"); return false; } if ($row->use_quick) { $this->use_quick = true; } else { I2CE::raiseError("Using slow config_alt retreival. Please set group_concat_max_len in mysql's config to be the same as max_allowed_packet. Currently it is set " . $row->len . " to bytes"); } }
public function __construct($name) { parent::__construct($name); $this->setUpStatements(); }