mirror of
https://github.com/dg/dibi.git
synced 2025-08-05 13:47:33 +02:00
some stuff is deprecated and throws E_USER_WARNING: dibi::datetime(), dibi::date(), dibi::addSubst(), dibi::removeSubst(), dibi::setSubstFallback(), DibiResult::rowCount(), DibiResult::getColumnNames(), DibiVariable
This commit is contained in:
@@ -24,7 +24,7 @@ dibi::test('
|
||||
SELECT COUNT(*) as [count]
|
||||
FROM [comments]
|
||||
WHERE [ip] LIKE %s', $ipMask, '
|
||||
AND [date] > ', dibi::date($timestamp)
|
||||
AND [date] > ', new DibiDateTime($timestamp)
|
||||
);
|
||||
// -> SELECT COUNT(*) as [count] FROM [comments] WHERE [ip] LIKE '192.168.%' AND [date] > 876693600
|
||||
|
||||
|
@@ -17,7 +17,7 @@ dibi::connect(array(
|
||||
|
||||
|
||||
// create new substitution :blog: ==> wp_
|
||||
dibi::addSubst('blog', 'wp_');
|
||||
dibi::getSubstitutes()->blog = 'wp_';
|
||||
|
||||
dibi::test("SELECT * FROM [:blog:items]");
|
||||
// -> SELECT * FROM [wp_items]
|
||||
@@ -27,7 +27,7 @@ dibi::test("SELECT * FROM [:blog:items]");
|
||||
|
||||
|
||||
// create new substitution :: (empty) ==> my_
|
||||
dibi::addSubst('', 'my_');
|
||||
dibi::getSubstitutes()->{''} = 'my_';
|
||||
|
||||
dibi::test("UPDATE ::table SET [text]='Hello World'");
|
||||
// -> UPDATE my_table SET [text]='Hello World'
|
||||
@@ -48,7 +48,7 @@ function substFallBack($expr)
|
||||
}
|
||||
|
||||
// define callback
|
||||
dibi::setSubstFallBack('substFallBack');
|
||||
dibi::getSubstitutes()->setCallback('substFallBack');
|
||||
|
||||
// define substitutes as constants
|
||||
define('SUBST_ACCOUNT', 'eshop_');
|
||||
|
Reference in New Issue
Block a user