本文整理汇总了PHP中mysqlConnection::weak_locks方法的典型用法代码示例。如果您正苦于以下问题:PHP mysqlConnection::weak_locks方法的具体用法?PHP mysqlConnection::weak_locks怎么用?PHP mysqlConnection::weak_locks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mysqlConnection
的用法示例。
在下文中一共展示了mysqlConnection::weak_locks方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
dcCore constructor inits everything related to Dotclear. It takes arguments
to init database connection.
@param driver <b>string</b> Database driver name
@param host <b>string</b> Database hostname
@param db <b>string</b> Database name
@param user <b>string</b> Database username
@param password <b>string</b> Database password
@param prefix <b>string</b> DotClear tables prefix
@param persist <b>boolean</b> Persistent database connection
*/
public function __construct($driver, $host, $db, $user, $password, $prefix, $persist)
{
$this->con = dbLayer::init($driver, $host, $db, $user, $password, $persist);
# define weak_locks for mysql
if ($this->con instanceof mysqlConnection) {
mysqlConnection::$weak_locks = true;
}
$this->prefix = $prefix;
$this->error = new dcError();
$this->auth = $this->authInstance();
$this->session = new sessionDB($this->con, $this->prefix . 'session', DC_SESSION_NAME, '', null, DC_ADMIN_SSL);
$this->url = new urlHandler();
$this->plugins = new dcModules($this);
$this->rest = new dcRestServer($this);
$this->addFormater('xhtml', create_function('$s', 'return $s;'));
$this->addFormater('wiki', array($this, 'wikiTransform'));
}
示例2: __construct
/**
dcCore constructor inits everything related to Dotclear. It takes arguments
to init database connection.
@param driver <b>string</b> Database driver name
@param host <b>string</b> Database hostname
@param db <b>string</b> Database name
@param user <b>string</b> Database username
@param password <b>string</b> Database password
@param prefix <b>string</b> DotClear tables prefix
@param persist <b>boolean</b> Persistent database connection
*/
public function __construct($driver, $host, $db, $user, $password, $prefix, $persist)
{
$this->con = dbLayer::init($driver, $host, $db, $user, $password, $persist);
# define weak_locks for mysql
if ($this->con instanceof mysqlConnection) {
mysqlConnection::$weak_locks = true;
}
$this->prefix = $prefix;
$this->error = new dcError();
$this->auth = $this->authInstance();
$this->session = new sessionDB($this->con, $this->prefix . 'session', BP_SESSION_NAME, '', null, false);
$this->url = new urlHandler();
$this->rest = new dcRestServer($this);
# Create the Hyla_Tpl object
$this->tpl = new Hyla_Tpl();
$this->tpl->setL10nCallback('T_');
}
示例3: __construct
/**
dcCore constructor inits everything related to Dotclear. It takes arguments
to init database connection.
@param driver <b>string</b> Database driver name
@param host <b>string</b> Database hostname
@param db <b>string</b> Database name
@param user <b>string</b> Database username
@param password <b>string</b> Database password
@param prefix <b>string</b> DotClear tables prefix
@param persist <b>boolean</b> Persistent database connection
*/
public function __construct($driver, $host, $db, $user, $password, $prefix, $persist)
{
if (defined('DC_START_TIME')) {
$this->stime = DC_START_TIME;
} else {
$this->stime = microtime(true);
}
$this->con = dbLayer::init($driver, $host, $db, $user, $password, $persist);
# define weak_locks for mysql
if ($this->con instanceof mysqlConnection) {
mysqlConnection::$weak_locks = true;
} elseif ($this->con instanceof mysqliConnection) {
mysqliConnection::$weak_locks = true;
}
# define searchpath for postgresql
if ($this->con instanceof pgsqlConnection) {
$searchpath = explode('.', $prefix, 2);
if (count($searchpath) > 1) {
$prefix = $searchpath[1];
$sql = 'SET search_path TO ' . $searchpath[0] . ',public;';
$this->con->execute($sql);
}
}
$this->prefix = $prefix;
$ttl = DC_SESSION_TTL;
if (!is_null($ttl)) {
if (substr(trim($ttl), 0, 1) != '-') {
// Clearbricks requires negative session TTL
$ttl = '-' . trim($ttl);
}
}
$this->error = new dcError();
$this->auth = $this->authInstance();
$this->session = new sessionDB($this->con, $this->prefix . 'session', DC_SESSION_NAME, '', null, DC_ADMIN_SSL, $ttl);
$this->url = new dcUrlHandlers();
$this->plugins = new dcPlugins($this);
$this->rest = new dcRestServer($this);
$this->meta = new dcMeta($this);
$this->log = new dcLog($this);
}