mirror of
https://github.com/dg/dibi.git
synced 2025-08-08 23:26:49 +02:00
DibiDatabaseInfo: provides substitutions
This commit is contained in:
@@ -564,11 +564,7 @@ final class DibiTranslator extends DibiObject
|
||||
*/
|
||||
private function delimite($value)
|
||||
{
|
||||
if (strpos($value, ':') !== FALSE) { // provide substitution
|
||||
$value = preg_replace_callback('#:([^:\s]*):#', array(__CLASS__, 'subCb'), $value);
|
||||
}
|
||||
|
||||
$parts = explode('.', $value);
|
||||
$parts = explode('.', self::substitute($value));
|
||||
foreach ($parts as & $value) {
|
||||
$value = $value === '*' ? '*' : $this->driver->escape($value, dibi::IDENTIFIER);
|
||||
}
|
||||
@@ -577,6 +573,20 @@ final class DibiTranslator extends DibiObject
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Provides substitution.
|
||||
* @return string
|
||||
*/
|
||||
public static function substitute($value)
|
||||
{
|
||||
if (strpos($value, ':') !== FALSE) { // provide substitution
|
||||
return preg_replace_callback('#:([^:\s]*):#', array(__CLASS__, 'subCb'), $value);
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Substitution callback.
|
||||
* @param array
|
||||
|
Reference in New Issue
Block a user