mirror of
https://github.com/dg/dibi.git
synced 2025-08-30 09:19:48 +02:00
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
a118c2cf96 | ||
|
9b0e64220b | ||
|
1c386d5582 | ||
|
c9944b3886 | ||
|
d0fd009dda | ||
|
c32251357d |
@@ -14,6 +14,7 @@
|
||||
"php": ">=5.2.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"tracy/tracy": "~2.2",
|
||||
"nette/tester": "~1.1"
|
||||
},
|
||||
"replace": {
|
||||
|
@@ -39,8 +39,8 @@ class dibi
|
||||
FIELD_TIME = dibi::TIME;
|
||||
|
||||
/** version */
|
||||
const VERSION = '2.2.0',
|
||||
REVISION = 'released on 2014-06-02';
|
||||
const VERSION = '2.2.2',
|
||||
REVISION = 'released on 2014-06-30';
|
||||
|
||||
/** sorting order */
|
||||
const ASC = 'ASC',
|
||||
|
@@ -111,7 +111,7 @@ class DibiConnection extends DibiObject
|
||||
$this->onEvent[] = array(new DibiFirePhpLogger($filter), 'logEvent');
|
||||
}
|
||||
|
||||
if (class_exists('DibiNettePanel') && !interface_exists('Tracy\IBarPanel')) {
|
||||
if (!interface_exists('Tracy\IBarPanel') && (interface_exists('Nette\Diagnostics\IBarPanel') || interface_exists('IBarPanel'))) {
|
||||
$panel = new DibiNettePanel(isset($profilerCfg['explain']) ? $profilerCfg['explain'] : TRUE, $filter);
|
||||
$panel->register($this);
|
||||
}
|
||||
|
@@ -51,7 +51,6 @@ final class DibiTranslator extends DibiObject
|
||||
public function __construct(DibiConnection $connection)
|
||||
{
|
||||
$this->connection = $connection;
|
||||
$this->driver = $connection->getDriver();
|
||||
$this->identifiers = new DibiHashMap(array($this, 'delimite'));
|
||||
}
|
||||
|
||||
@@ -64,6 +63,10 @@ final class DibiTranslator extends DibiObject
|
||||
*/
|
||||
public function translate(array $args)
|
||||
{
|
||||
if (!$this->driver) {
|
||||
$this->driver = $this->connection->getDriver();
|
||||
}
|
||||
|
||||
$args = array_values($args);
|
||||
while (count($args) === 1 && is_array($args[0])) { // implicit array expansion
|
||||
$args = array_values($args[0]);
|
||||
@@ -187,6 +190,10 @@ final class DibiTranslator extends DibiObject
|
||||
return "...";
|
||||
}
|
||||
|
||||
if (!$this->driver) {
|
||||
$this->driver = $this->connection->getDriver();
|
||||
}
|
||||
|
||||
// array processing (with or without modifier)
|
||||
if ($value instanceof Traversable) {
|
||||
$value = iterator_to_array($value);
|
||||
|
2
examples/.gitignore
vendored
2
examples/.gitignore
vendored
@@ -1,4 +1,4 @@
|
||||
_test.bat
|
||||
ref
|
||||
output
|
||||
log
|
||||
log
|
||||
|
@@ -1,63 +0,0 @@
|
||||
Tracy - PHP debugger, see http://tracy.nette.org
|
||||
|
||||
|
||||
Licenses
|
||||
========
|
||||
|
||||
Good news! You may use Nette Framework under the terms of either
|
||||
the New BSD License or the GNU General Public License (GPL) version 2 or 3.
|
||||
|
||||
The BSD License is recommended for most projects. It is easy to understand and it
|
||||
places almost no restrictions on what you can do with the framework. If the GPL
|
||||
fits better to your project, you can use the framework under this license.
|
||||
|
||||
You don't have to notify anyone which license you are using. You can freely
|
||||
use Nette Framework in commercial projects as long as the copyright header
|
||||
remains intact.
|
||||
|
||||
Please be advised that the name "Nette Framework" is a protected trademark and its
|
||||
usage has some limitations. So please do not use word "Nette" in the name of your
|
||||
project or top-level domain, and choose a name that stands on its own merits.
|
||||
If your stuff is good, it will not take long to establish a reputation for yourselves.
|
||||
|
||||
|
||||
New BSD License
|
||||
---------------
|
||||
|
||||
Copyright (c) 2004, 2012 David Grudl (http://davidgrudl.com)
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
* Neither the name of "Nette Framework" nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
GNU General Public License
|
||||
--------------------------
|
||||
|
||||
GPL licenses are very very long, so instead of including them here we offer
|
||||
you URLs with full text:
|
||||
|
||||
- GPL version 2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
- GPL version 3: http://www.gnu.org/licenses/gpl-3.0.html
|
Binary file not shown.
@@ -2,7 +2,7 @@ body {
|
||||
font: 15px/1.5 Tahoma, Verdana, Myriad Web, Syntax, sans-serif;
|
||||
color: #333;
|
||||
background: #fff url('dibi-powered.gif') no-repeat 99% 1em;
|
||||
margin: 1.6em;
|
||||
margin: 1.6em;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
|
@@ -4,8 +4,9 @@
|
||||
|
||||
<?php
|
||||
|
||||
require __DIR__ . '/Tracy/tracy.phar';
|
||||
require __DIR__ . '/../dibi/dibi.php';
|
||||
if (@!include __DIR__ . '/../vendor/autoload.php') {
|
||||
die('Install dependencies using `composer install --dev`');
|
||||
}
|
||||
|
||||
Tracy\Debugger::enable();
|
||||
|
||||
|
@@ -4,8 +4,9 @@
|
||||
|
||||
<?php
|
||||
|
||||
require __DIR__ . '/Tracy/tracy.phar';
|
||||
require __DIR__ . '/../dibi/dibi.php';
|
||||
if (@!include __DIR__ . '/../vendor/autoload.php') {
|
||||
die('Install dependencies using `composer install --dev`');
|
||||
}
|
||||
|
||||
Tracy\Debugger::enable();
|
||||
|
||||
|
@@ -10,8 +10,9 @@
|
||||
|
||||
<?php
|
||||
|
||||
require __DIR__ . '/Tracy/tracy.phar';
|
||||
require __DIR__ . '/../dibi/dibi.php';
|
||||
if (@!include __DIR__ . '/../vendor/autoload.php') {
|
||||
die('Install dependencies using `composer install --dev`');
|
||||
}
|
||||
|
||||
|
||||
Tracy\Debugger::enable();
|
||||
|
@@ -12,8 +12,9 @@
|
||||
|
||||
<?php
|
||||
|
||||
require __DIR__ . '/Tracy/tracy.phar';
|
||||
require __DIR__ . '/../dibi/dibi.php';
|
||||
if (@!include __DIR__ . '/../vendor/autoload.php') {
|
||||
die('Install dependencies using `composer install --dev`');
|
||||
}
|
||||
|
||||
|
||||
Tracy\Debugger::enable();
|
||||
|
@@ -4,8 +4,9 @@
|
||||
|
||||
<?php
|
||||
|
||||
require __DIR__ . '/Tracy/tracy.phar';
|
||||
require __DIR__ . '/../dibi/dibi.php';
|
||||
if (@!include __DIR__ . '/../vendor/autoload.php') {
|
||||
die('Install dependencies using `composer install --dev`');
|
||||
}
|
||||
|
||||
Tracy\Debugger::enable();
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
[Dibi](http://dibiphp.com) - smart database layer for PHP
|
||||
[Dibi](http://dibiphp.com) - smart database layer for PHP [](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9XXL5ZJHAYQUN)
|
||||
=========================================================
|
||||
|
||||
[](https://packagist.org/packages/dibi/dibi)
|
||||
|
@@ -1,26 +1,11 @@
|
||||
-- phpMyAdmin SQL Dump
|
||||
-- version 2.11.1.2
|
||||
-- http://www.phpmyadmin.net
|
||||
--
|
||||
-- Po<50><6F>ta<74>: localhost
|
||||
-- Vygenerov<6F>no: Ned<65>le 02. prosince 2007, 19:49
|
||||
-- Verze MySQL: 5.0.45
|
||||
-- Verze PHP: 5.2.1
|
||||
-- MySQL: 5.0.45
|
||||
|
||||
SET FOREIGN_KEY_CHECKS=0;
|
||||
|
||||
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
|
||||
|
||||
--
|
||||
-- Datab<61>ze: `dibi`
|
||||
--
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Struktura tabulky `customers`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `customers`;
|
||||
CREATE TABLE IF NOT EXISTS `customers` (
|
||||
`customer_id` int(11) NOT NULL auto_increment,
|
||||
@@ -28,9 +13,6 @@ CREATE TABLE IF NOT EXISTS `customers` (
|
||||
PRIMARY KEY (`customer_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ;
|
||||
|
||||
--
|
||||
-- Vypisuji data pro tabulku `customers`
|
||||
--
|
||||
|
||||
INSERT INTO `customers` (`customer_id`, `name`) VALUES
|
||||
(1, 'Dave Lister'),
|
||||
@@ -42,10 +24,6 @@ INSERT INTO `customers` (`customer_id`, `name`) VALUES
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Struktura tabulky `enumtest`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `enumtest`;
|
||||
CREATE TABLE IF NOT EXISTS `enumtest` (
|
||||
`id` int(11) NOT NULL auto_increment,
|
||||
@@ -53,17 +31,9 @@ CREATE TABLE IF NOT EXISTS `enumtest` (
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
--
|
||||
-- Vypisuji data pro tabulku `enumtest`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Struktura tabulky `orders`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `orders`;
|
||||
CREATE TABLE IF NOT EXISTS `orders` (
|
||||
`order_id` int(11) NOT NULL,
|
||||
@@ -72,9 +42,6 @@ CREATE TABLE IF NOT EXISTS `orders` (
|
||||
`amount` float NOT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Vypisuji data pro tabulku `orders`
|
||||
--
|
||||
|
||||
INSERT INTO `orders` (`order_id`, `customer_id`, `product_id`, `amount`) VALUES
|
||||
(1, 2, 1, 7),
|
||||
@@ -84,10 +51,6 @@ INSERT INTO `orders` (`order_id`, `customer_id`, `product_id`, `amount`) VALUES
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Struktura tabulky `products`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `products`;
|
||||
CREATE TABLE IF NOT EXISTS `products` (
|
||||
`product_id` int(11) NOT NULL auto_increment,
|
||||
@@ -95,9 +58,6 @@ CREATE TABLE IF NOT EXISTS `products` (
|
||||
PRIMARY KEY (`product_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
--
|
||||
-- Vypisuji data pro tabulku `products`
|
||||
--
|
||||
|
||||
INSERT INTO `products` (`product_id`, `title`) VALUES
|
||||
(1, 'Chair'),
|
||||
@@ -106,10 +66,6 @@ INSERT INTO `products` (`product_id`, `title`) VALUES
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Struktura tabulky `settest`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `settest`;
|
||||
CREATE TABLE IF NOT EXISTS `settest` (
|
||||
`id` int(11) NOT NULL auto_increment,
|
||||
@@ -117,17 +73,8 @@ CREATE TABLE IF NOT EXISTS `settest` (
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
--
|
||||
-- Vypisuji data pro tabulku `settest`
|
||||
--
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
--
|
||||
-- Struktura tabulky `where`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `where`;
|
||||
CREATE TABLE IF NOT EXISTS `where` (
|
||||
`select` int(11) NOT NULL,
|
||||
@@ -136,9 +83,6 @@ CREATE TABLE IF NOT EXISTS `where` (
|
||||
`quot'n' space` int(11) NOT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
--
|
||||
-- Vypisuji data pro tabulku `where`
|
||||
--
|
||||
|
||||
INSERT INTO `where` (`select`, `dot.dot`, `is`, `quot'n' space`) VALUES
|
||||
(1, 2, 3, 4);
|
||||
@@ -146,4 +90,3 @@ INSERT INTO `where` (`select`, `dot.dot`, `is`, `quot'n' space`) VALUES
|
||||
SET FOREIGN_KEY_CHECKS=1;
|
||||
|
||||
SET SQL_MODE="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION";
|
||||
|
||||
|
@@ -1 +1 @@
|
||||
Dibi 2.2.0 (released on 2014-06-02)
|
||||
Dibi 2.2.2 (released on 2014-06-30)
|
||||
|
Reference in New Issue
Block a user