1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-30 17:29:53 +02:00

renamed parser -> translator

added "Undefined property usage prevention"
This commit is contained in:
David Grudl
2006-10-26 13:09:56 +00:00
parent d705f4089d
commit 11b294be44
4 changed files with 54 additions and 20 deletions

View File

@@ -28,14 +28,14 @@ if (version_compare(PHP_VERSION , '5.0.3', '<'))
// libraries
require_once dirname(__FILE__).'/libs/driver.php';
require_once dirname(__FILE__).'/libs/resultset.php';
require_once dirname(__FILE__).'/libs/parser.php';
require_once dirname(__FILE__).'/libs/translator.php';
require_once dirname(__FILE__).'/libs/exception.php';
// required since PHP 5.1.0
if (function_exists('date_default_timezone_set'))
date_default_timezone_set('Europe/Prague'); // or 'GMT'
// if (function_exists('date_default_timezone_set'))
// date_default_timezone_set('Europe/Prague'); // or 'GMT'
@@ -125,6 +125,13 @@ class dibi
/**
* Monostate class
*/
private function __construct()
{}
/**
* Creates a new DibiDriver object and connects it to specified database
*
@@ -243,8 +250,8 @@ class dibi
$args = func_get_args();
// and generate SQL
$parser = new DibiParser(self::$conn, self::$substs);
self::$sql = $parser->parse($args);
$trans = new DibiTranslator(self::$conn, self::$substs);
self::$sql = $trans->translate($args);
if (is_error(self::$sql)) return self::$sql; // reraise the exception
// execute SQL
@@ -306,8 +313,8 @@ class dibi
$args = func_get_args();
// and generate SQL
$parser = new DibiParser(self::$conn, self::$substs);
$sql = $parser->parse($args);
$trans = new DibiTranslator(self::$conn, self::$substs);
$sql = $trans->translate($args);
$dump = TRUE; // !!!
if ($dump) {
if (is_error($sql))