mirror of
https://github.com/dg/dibi.git
synced 2025-08-06 22:26:43 +02:00
- added config alias 'hostname' for 'host'
This commit is contained in:
@@ -778,15 +778,19 @@ class dibi
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns brief descriptions.
|
* Returns brief descriptions.
|
||||||
|
* @return string
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public static function getColophon()
|
public static function getColophon($sender = NULL)
|
||||||
{
|
{
|
||||||
return array(
|
$arr = array(
|
||||||
'dibi version: ' . dibi::VERSION,
|
'Number of SQL queries: ' . dibi::$numOfQueries
|
||||||
'Number or queries: ' . dibi::$numOfQueries
|
. (dibi::$totalTime === NULL ? '' : ', elapsed time: ' . sprintf('%0.3f', dibi::$totalTime * 1000) . ' ms'),
|
||||||
. (dibi::$totalTime === NULL ? '' : ' (elapsed time: ' . sprintf('%0.3f', dibi::$totalTime * 1000) . ' ms)'),
|
|
||||||
);
|
);
|
||||||
|
if ($sender === 'bluescreen') {
|
||||||
|
$arr[] = 'dibi version ' . dibi::VERSION;
|
||||||
|
}
|
||||||
|
return $arr;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -74,7 +74,7 @@ class DibiMsSqlDriver extends /*Nette::*/Object implements IDibiDriver
|
|||||||
{
|
{
|
||||||
DibiConnection::alias($config, 'username', 'user');
|
DibiConnection::alias($config, 'username', 'user');
|
||||||
DibiConnection::alias($config, 'password', 'pass');
|
DibiConnection::alias($config, 'password', 'pass');
|
||||||
DibiConnection::alias($config, 'host');
|
DibiConnection::alias($config, 'host', 'hostname');
|
||||||
|
|
||||||
if (empty($config['persistent'])) {
|
if (empty($config['persistent'])) {
|
||||||
$this->connection = @mssql_connect($config['host'], $config['username'], $config['password'], TRUE); // intentionally @
|
$this->connection = @mssql_connect($config['host'], $config['username'], $config['password'], TRUE); // intentionally @
|
||||||
|
@@ -87,6 +87,7 @@ class DibiMySqlDriver extends /*Nette::*/Object implements IDibiDriver
|
|||||||
{
|
{
|
||||||
DibiConnection::alias($config, 'username', 'user');
|
DibiConnection::alias($config, 'username', 'user');
|
||||||
DibiConnection::alias($config, 'password', 'pass');
|
DibiConnection::alias($config, 'password', 'pass');
|
||||||
|
DibiConnection::alias($config, 'host', 'hostname');
|
||||||
DibiConnection::alias($config, 'options');
|
DibiConnection::alias($config, 'options');
|
||||||
|
|
||||||
// default values
|
// default values
|
||||||
|
@@ -87,6 +87,7 @@ class DibiMySqliDriver extends /*Nette::*/Object implements IDibiDriver
|
|||||||
{
|
{
|
||||||
DibiConnection::alias($config, 'username', 'user');
|
DibiConnection::alias($config, 'username', 'user');
|
||||||
DibiConnection::alias($config, 'password', 'pass');
|
DibiConnection::alias($config, 'password', 'pass');
|
||||||
|
DibiConnection::alias($config, 'host', 'hostname');
|
||||||
DibiConnection::alias($config, 'options');
|
DibiConnection::alias($config, 'options');
|
||||||
DibiConnection::alias($config, 'database');
|
DibiConnection::alias($config, 'database');
|
||||||
|
|
||||||
|
@@ -1,11 +1,11 @@
|
|||||||
<h1>Nette::Debug && dibi example</h1>
|
<h1>Nette::Debug && dibi example</h1>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
require_once '../dibi/dibi.php';
|
|
||||||
require_once 'Nette/Debug.php';
|
require_once 'Nette/Debug.php';
|
||||||
|
require_once '../dibi/dibi.php';
|
||||||
|
|
||||||
Debug::enable();
|
Debug::enable();
|
||||||
|
Debug::enableProfiler();
|
||||||
|
|
||||||
|
|
||||||
dibi::connect(array(
|
dibi::connect(array(
|
||||||
|
Reference in New Issue
Block a user