当前位置: 首页>>代码示例>>PHP>>正文


PHP DatabaseManager::connect方法代码示例

本文整理汇总了PHP中DatabaseManager::connect方法的典型用法代码示例。如果您正苦于以下问题:PHP DatabaseManager::connect方法的具体用法?PHP DatabaseManager::connect怎么用?PHP DatabaseManager::connect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DatabaseManager的用法示例。


在下文中一共展示了DatabaseManager::connect方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * Construct a new database object.
  * @param $settings
  */
 public function __construct($settings)
 {
     $this->database = DatabaseManager::connect($settings["host"], $settings["port"], $settings["user"], $settings["pass"], $settings["name"], isset($settings["utf8"]) ? $settings["utf8"] : true);
     // Debug
     global $settings;
     R::debug($settings["development"]);
 }
开发者ID:Rattatouille,项目名称:myaqa_test,代码行数:11,代码来源:Database.class.php

示例2: __construct

 /**
  * Constructor function to initiate the object of this class.
  * @param Array $config
  */
 public function __construct($config)
 {
     $this->dbConfig = $config;
     //store the config file.
     //Make a connection to the DB. DB Credentials are provided inside the configuration file.
     DatabaseManager::connect(new DatabaseConfig($config['ADAPTER'], $config['DBNAME'], $config['USERNAME'], $config['PASSWORD']));
     //create a new Db handler.
 }
开发者ID:sachintaware,项目名称:phpsec,代码行数:12,代码来源:DBLogs.php

示例3: DatabaseConfig

<?php

namespace phpsec;

/**
 * Required Files
 */
require_once __DIR__ . "/../../libs/db/dbmanager.php";
try {
    $config = (include __DIR__ . "/../../libs/config.php");
    $dbname = $config['DBNAME'];
    $username = $config['DBUSER'];
    $password = $config['DBPASS'];
    DatabaseManager::connect(new DatabaseConfig('pdo_mysql', $dbname, $username, $password, "127.0.0.1"));
    //create a new Db handler.
} catch (\Exception $e) {
    echo $e->getMessage();
}
开发者ID:sachintaware,项目名称:phpsec,代码行数:18,代码来源:testconfig.php

示例4: sanitize_output

function sanitize_output($buffer)
{
    $search = array('/\\>[^\\S ]+/s', '/[^\\S ]+\\</s', '/(\\s)+/s');
    $replace = array('>', '<', '\\1');
    $buffer = preg_replace($search, $replace, $buffer);
    return $buffer;
}
/** $Init the initiator class */
$Init = new Initiator();
/** Starts the init itself */
$Init::startInit();
/** $FOGFTP the FOGFTP class */
$FOGFTP = new FOGFTP();
/** $FOGCore the FOGCore class */
$FOGCore = new FOGCore();
/** $DatabaseManager the DatabaseManager class */
$DatabaseManager = new DatabaseManager();
/** $DB set's the DB class from the DatabaseManager */
$DB = $FOGCore->DB = $DatabaseManager->connect()->DB;
/** Loads any Session variables */
$FOGCore->setSessionEnv();
/** $TimeZone the timezone setter */
$TimeZone = $FOGCore->TimeZone = $_SESSION['TimeZone'];
/** $EventManager initiates the EventManager class */
$FOGCore->EventManager = $EventManager = $FOGCore->getClass('EventManager');
/** $HookManager initiates the HookManager class */
$FOGCore->HookManager = $HookManager = $FOGCore->getClass('HookManager');
$HookManager->load();
$EventManager->load();
/** $HookManager initiates the FOGURLRequest class */
$FOGCore->FOGURLRequests = $FOGURLRequests = $FOGCore->getClass('FOGURLRequests');
开发者ID:bramverstraten,项目名称:fogproject,代码行数:31,代码来源:init.php


注:本文中的DatabaseManager::connect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。