diff --git a/dibi/dibi.php b/dibi/dibi.php index 609fb650..aff38034 100644 --- a/dibi/dibi.php +++ b/dibi/dibi.php @@ -638,6 +638,9 @@ class dibi */ public static function addSubst($expr, $subst) { + if ($expr === '') { + trigger_error(__METHOD__ . ': empty substitutions will probably be deprecated.', E_USER_NOTICE); + } self::$substs[$expr] = $subst; } @@ -653,7 +656,7 @@ class dibi if ($expr === TRUE) { self::$substs = array(); } else { - unset(self::$substs[':'.$expr.':']); + unset(self::$substs[$expr]); } } diff --git a/examples/substitutions.php b/examples/substitutions.php index d50a2ff3..ebf0429b 100644 --- a/examples/substitutions.php +++ b/examples/substitutions.php @@ -23,16 +23,6 @@ dibi::test("UPDATE :blog:items SET [text]='Hello World'"); -// create new substitution :: (empty) ==> my_ -dibi::addSubst('', 'my_'); - -dibi::test("UPDATE [database.::table] SET [text]='Hello World'"); -// -> UPDATE [database].[my_table] SET [text]='Hello World' - - - - - // create substitution fallback function substFallBack($expr) {