mirror of
https://github.com/dg/dibi.git
synced 2025-08-04 13:17:58 +02:00
Revert "empty substitutions are going to be deprecated" commit e50b1a0b5a
.
This commit is contained in:
@@ -638,9 +638,6 @@ class dibi
|
|||||||
*/
|
*/
|
||||||
public static function addSubst($expr, $subst)
|
public static function addSubst($expr, $subst)
|
||||||
{
|
{
|
||||||
if ($expr === '') {
|
|
||||||
trigger_error(__METHOD__ . ': empty substitutions will probably be deprecated.', E_USER_NOTICE);
|
|
||||||
}
|
|
||||||
self::$substs[$expr] = $subst;
|
self::$substs[$expr] = $subst;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -656,7 +653,7 @@ class dibi
|
|||||||
if ($expr === TRUE) {
|
if ($expr === TRUE) {
|
||||||
self::$substs = array();
|
self::$substs = array();
|
||||||
} else {
|
} else {
|
||||||
unset(self::$substs[$expr]);
|
unset(self::$substs[':'.$expr.':']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -26,6 +26,16 @@ dibi::test("SELECT * FROM [:blog:items]");
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// create new substitution :: (empty) ==> my_
|
||||||
|
dibi::addSubst('', 'my_');
|
||||||
|
|
||||||
|
dibi::test("UPDATE ::table SET [text]='Hello World'");
|
||||||
|
// -> UPDATE my_table SET [text]='Hello World'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// create substitutions using fallback callback
|
// create substitutions using fallback callback
|
||||||
function substFallBack($expr)
|
function substFallBack($expr)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user