本文整理汇总了PHP中R::setAutoResolve方法的典型用法代码示例。如果您正苦于以下问题:PHP R::setAutoResolve方法的具体用法?PHP R::setAutoResolve怎么用?PHP R::setAutoResolve使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类R
的用法示例。
在下文中一共展示了R::setAutoResolve方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: configure_redbean
public function configure_redbean($c)
{
\R::setup('mysql:host=' . $c['host'] . ';dbname=' . $c['name'], $c['user'], $c['pass']);
if (method_exists('\\R', 'setAutoResolve')) {
\R::setAutoResolve(true);
}
}
示例2: __construct
public function __construct($request)
{
// load and setup the Red Bean ORM
require_once 'include/RedBeanPHP4_3_1/rb.php';
R::setup('mysql:host=' . JAC_DB_HOST . ';dbname=' . JAC_DB_NAME, JAC_DB_USER, JAC_DB_PASS);
R::setAutoResolve(TRUE);
// set the uri of current request
$this->getSelfUri();
// assign request array
$this->request = $request;
}
示例3: define
<?php
require_once __DIR__ . "/../vendor/rb.php";
define('REDBEAN_MODEL_PREFIX', '');
class db_connect
{
static function connect()
{
//// R::setup('mysql:host=localhost;dbname=obuceisea', 'root', '');
//// R::setAutoResolve(TRUE);
//// R::freeze( TRUE );
}
}
//
R::setup('mysql:host=localhost;dbname=obuceisea', 'root', '');
R::setAutoResolve(TRUE);
R::freeze(TRUE);
//R::debug(true);
示例4: RedBeanConnect
/**
*
* @param string $dbname
* @param boolean $frozen
* @return void
*/
protected static function RedBeanConnect($dbname, $frozen = true)
{
require_once implode(DIRECTORY_SEPARATOR, [ROOT_DIR, 'Library', 'database', 'rb.php']);
$dbConfig = static::$dbConfig;
switch (strtoupper($dbConfig->type)) {
case 'SQLITE':
$dns = "sqlite:/tmp/{$dbname}.sqlite3";
$dbConfig->user = $dbConfig->password = null;
break;
case 'MARIA':
$dns = "mysql:host={$dbConfig->host};dbname={$dbname}";
break;
case 'POSTGRESQL':
$dns = "pgsql:host={$dbConfig->host};dbname={$dbname}";
break;
case null:
default:
$dns = null;
$dbConfig->user = $dbConfig->password = null;
}
if (isset(R::$toolboxes[$dbname])) {
R::selectDatabase($dbname);
} else {
R::addDatabase($dbname, $dns, $dbConfig->user, $dbConfig->password, $frozen);
R::selectDatabase($dbname);
}
R::setAutoResolve();
R::fancyDebug(DEBUG);
}