mirror of
https://github.com/dg/dibi.git
synced 2025-08-06 06:07:39 +02:00
typos & whitespace
This commit is contained in:
@@ -23,7 +23,6 @@ render(){$obLevel=ob_get_level();$panels=array();foreach($this->panels
|
||||
as$id=>$panel){try{$panels[]=array('id'=>preg_replace('#[^a-z0-9]+#i','-',$id),'tab'=>$tab=(string)$panel->getTab(),'panel'=>$tab?(string)$panel->getPanel():NULL);}catch(Exception$e){$panels[]=array('id'=>"error-$id",'tab'=>"Error: $id",'panel'=>nl2br(htmlSpecialChars((string)$e)));while(ob_get_level()>$obLevel){ob_end_clean();}}}?>
|
||||
|
||||
|
||||
|
||||
<!-- Nette Debug Bar -->
|
||||
|
||||
<?php ob_start()?>
|
||||
@@ -130,7 +129,6 @@ htmlspecialchars('; caused by '.get_class($ex).' '.$ex->getMessage().($ex->getCo
|
||||
</head>
|
||||
|
||||
|
||||
|
||||
<body>
|
||||
<div id="netteBluescreen">
|
||||
<a id="netteBluescreenIcon" href="#" rel="next"><abbr>▼</abbr></a
|
||||
@@ -146,7 +144,6 @@ urlencode($title.' '.preg_replace('#\'.*\'|".*"#Us','',$exception->getMessage())
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<?php $ex=$exception;$level=0;?>
|
||||
<?php do{?>
|
||||
|
||||
@@ -165,7 +162,6 @@ htmlspecialchars($ex->getMessage())?></b></p>
|
||||
<?php endif?>
|
||||
|
||||
|
||||
|
||||
<?php foreach($panels
|
||||
as$panel):?>
|
||||
<?php $panel=call_user_func($panel,$ex);if(empty($panel['tab'])||empty($panel['panel']))continue;?>
|
||||
@@ -180,7 +176,6 @@ htmlSpecialChars($panel['tab'])?> <abbr>▼</abbr></a></h2>
|
||||
<?php endforeach?>
|
||||
|
||||
|
||||
|
||||
<?php $stack=$ex->getTrace();$expanded=NULL?>
|
||||
<?php if(strpos($ex->getFile(),$expandPath)===0){foreach($stack
|
||||
as$key=>$row){if(isset($row['file'])&&strpos($row['file'],$expandPath)!==0){$expanded=$key;break;}}}?>
|
||||
@@ -196,7 +191,6 @@ self::highlightFile($ex->getFile(),$ex->getLine(),15,isset($ex->context)?$ex->co
|
||||
</div></div>
|
||||
|
||||
|
||||
|
||||
<?php if(isset($stack[0]['class'])&&$stack[0]['class']==='NDebugger'&&($stack[0]['function']==='_shutdownHandler'||$stack[0]['function']==='_errorHandler'))unset($stack[0])?>
|
||||
<?php if($stack):?>
|
||||
<div class="panel">
|
||||
@@ -251,7 +245,6 @@ self::highlightFile($row['file'],$row['line'])?></div>
|
||||
<?php endif?>
|
||||
|
||||
|
||||
|
||||
<?php if(isset($ex->context)&&is_array($ex->context)):?>
|
||||
<div class="panel">
|
||||
<h2><a href="#" rel="netteBsPnl<?php echo++$counter?>">Variables <abbr>►</abbr></a></h2>
|
||||
@@ -272,7 +265,6 @@ as$k=>$v){echo'<tr><th>$',htmlspecialchars($k),'</th><td>',NDebugHelpers::clicka
|
||||
<?php while(--$level)echo'</div></div>'?>
|
||||
|
||||
|
||||
|
||||
<?php $bottomPanels=array()?>
|
||||
<?php foreach($panels
|
||||
as$panel):?>
|
||||
@@ -288,7 +280,6 @@ htmlSpecialChars($panel['tab'])?> <abbr>►</abbr></a></h2>
|
||||
<?php endforeach?>
|
||||
|
||||
|
||||
|
||||
<div class="panel">
|
||||
<h2><a href="#" rel="netteBsPnl<?php echo++$counter?>">Environment <abbr>►</abbr></a></h2>
|
||||
|
||||
@@ -336,7 +327,6 @@ as$k=>$v)echo'<tr><th>',htmlspecialchars($k),'</th><td>',NDebugHelpers::clickabl
|
||||
</div></div>
|
||||
|
||||
|
||||
|
||||
<div class="panel">
|
||||
<h2><a href="#" rel="netteBsPnl<?php echo++$counter?>">HTTP request <abbr>►</abbr></a></h2>
|
||||
|
||||
@@ -371,7 +361,6 @@ foreach($GLOBALS[$name]as$k=>$v)echo'<tr><th>',htmlspecialchars($k),'</th><td>',
|
||||
</div></div>
|
||||
|
||||
|
||||
|
||||
<div class="panel">
|
||||
<h2><a href="#" rel="netteBsPnl<?php echo++$counter?>">HTTP response <abbr>►</abbr></a></h2>
|
||||
|
||||
@@ -388,7 +377,6 @@ htmlspecialchars($s),'<br>';?></pre>
|
||||
</div></div>
|
||||
|
||||
|
||||
|
||||
<?php foreach($bottomPanels
|
||||
as$panel):?>
|
||||
<div class="panel">
|
||||
@@ -401,7 +389,6 @@ htmlSpecialChars($panel['tab'])?> <abbr>▼</abbr></a></h2>
|
||||
<?php endforeach?>
|
||||
|
||||
|
||||
|
||||
<ul>
|
||||
<li>Report generated at <?php echo@date('Y/m/d H:i:s',NDebugger::$time)?></li>
|
||||
<?php if(preg_match('#^https?://#',NDebugger::$source)):?>
|
||||
|
@@ -18,7 +18,6 @@ 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
|
||||
---------------
|
||||
|
||||
@@ -51,7 +50,6 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
|
||||
GNU General Public License
|
||||
--------------------------
|
||||
|
||||
|
@@ -23,8 +23,6 @@ try {
|
||||
echo "</p>\n";
|
||||
|
||||
|
||||
|
||||
|
||||
// connects to SQlite using DibiConnection object
|
||||
echo '<p>Connecting to Sqlite: ';
|
||||
try {
|
||||
@@ -40,8 +38,6 @@ try {
|
||||
echo "</p>\n";
|
||||
|
||||
|
||||
|
||||
|
||||
// connects to MySQL using DSN
|
||||
echo '<p>Connecting to MySQL: ';
|
||||
try {
|
||||
@@ -54,8 +50,6 @@ try {
|
||||
echo "</p>\n";
|
||||
|
||||
|
||||
|
||||
|
||||
// connects to MySQLi using array
|
||||
echo '<p>Connecting to MySQLi: ';
|
||||
try {
|
||||
@@ -78,8 +72,6 @@ try {
|
||||
echo "</p>\n";
|
||||
|
||||
|
||||
|
||||
|
||||
// connects to ODBC
|
||||
echo '<p>Connecting to ODBC: ';
|
||||
try {
|
||||
@@ -97,8 +89,6 @@ try {
|
||||
echo "</p>\n";
|
||||
|
||||
|
||||
|
||||
|
||||
// connects to PostgreSql
|
||||
echo '<p>Connecting to PostgreSql: ';
|
||||
try {
|
||||
@@ -115,8 +105,6 @@ try {
|
||||
echo "</p>\n";
|
||||
|
||||
|
||||
|
||||
|
||||
// connects to PDO
|
||||
echo '<p>Connecting to Sqlite via PDO: ';
|
||||
try {
|
||||
@@ -132,7 +120,6 @@ try {
|
||||
echo "</p>\n";
|
||||
|
||||
|
||||
|
||||
// connects to MS SQL
|
||||
echo '<p>Connecting to MS SQL: ';
|
||||
try {
|
||||
@@ -150,7 +137,6 @@ try {
|
||||
echo "</p>\n";
|
||||
|
||||
|
||||
|
||||
// connects to MS SQL 2005
|
||||
echo '<p>Connecting to MS SQL 2005: ';
|
||||
try {
|
||||
@@ -169,7 +155,6 @@ try {
|
||||
echo "</p>\n";
|
||||
|
||||
|
||||
|
||||
// connects to Oracle
|
||||
echo '<p>Connecting to Oracle: ';
|
||||
try {
|
||||
|
@@ -14,7 +14,6 @@ dibi::connect(array(
|
||||
));
|
||||
|
||||
|
||||
|
||||
// retrieve database reflection
|
||||
$database = dibi::getDatabaseInfo();
|
||||
|
||||
@@ -26,7 +25,6 @@ foreach ($database->getTables() as $table) {
|
||||
echo "</ul>\n";
|
||||
|
||||
|
||||
|
||||
// table reflection
|
||||
$table = $database->getTable('products');
|
||||
|
||||
@@ -40,7 +38,6 @@ foreach ($table->getColumns() as $column) {
|
||||
echo "</ul>\n";
|
||||
|
||||
|
||||
|
||||
echo "Indexes";
|
||||
echo "<ul>\n";
|
||||
foreach ($table->getIndexes() as $index) {
|
||||
|
@@ -14,7 +14,6 @@ dibi::connect(array(
|
||||
));
|
||||
|
||||
|
||||
|
||||
$res = dibi::query('
|
||||
SELECT * FROM products
|
||||
INNER JOIN orders USING (product_id)
|
||||
|
@@ -31,7 +31,6 @@ dibi::connect(array(
|
||||
dibi::query('SELECT * FROM customers WHERE customer_id < ?', 38);
|
||||
|
||||
|
||||
|
||||
dibi::connect(array(
|
||||
'driver' => 'sqlite3',
|
||||
'database' => 'data/sample.s3db',
|
||||
|
@@ -32,8 +32,6 @@ dibi::test('
|
||||
// -> SELECT * FROM customers WHERE name LIKE 'K%'
|
||||
|
||||
|
||||
|
||||
|
||||
// if & else & (optional) end
|
||||
dibi::test("
|
||||
SELECT *
|
||||
@@ -45,7 +43,6 @@ dibi::test("
|
||||
// -> SELECT * FROM people WHERE id > 0 AND bar=2
|
||||
|
||||
|
||||
|
||||
// nested condition
|
||||
dibi::test('
|
||||
SELECT *
|
||||
@@ -58,7 +55,6 @@ dibi::test('
|
||||
// -> SELECT * FROM customers WHERE LIMIT 10
|
||||
|
||||
|
||||
|
||||
// IF()
|
||||
dibi::test('UPDATE products SET', array(
|
||||
'price' => array('IF(price_fixed, price, ?)', 123),
|
||||
|
@@ -29,7 +29,6 @@ dibi::test('
|
||||
// -> SELECT COUNT(*) as [count] FROM [comments] WHERE [ip] LIKE '192.168.%' AND [date] > 876693600
|
||||
|
||||
|
||||
|
||||
// dibi detects INSERT or REPLACE command
|
||||
dibi::test('
|
||||
REPLACE INTO products', array(
|
||||
@@ -40,7 +39,6 @@ dibi::test('
|
||||
// -> REPLACE INTO products ([title], [price], [active]) VALUES ('Super product', 318, 1)
|
||||
|
||||
|
||||
|
||||
// multiple INSERT command
|
||||
$array = array(
|
||||
'title' => 'Super Product',
|
||||
@@ -52,7 +50,6 @@ dibi::test("INSERT INTO products", $array, $array, $array);
|
||||
// -> INSERT INTO products ([title], [price], [brand], [created]) VALUES ('Super Product', ...) , (...) , (...)
|
||||
|
||||
|
||||
|
||||
// dibi detects UPDATE command
|
||||
dibi::test("
|
||||
UPDATE colors SET", array(
|
||||
@@ -63,7 +60,6 @@ dibi::test("
|
||||
// -> UPDATE colors SET [color]='blue', [order]=12 WHERE id=123
|
||||
|
||||
|
||||
|
||||
// modifier applied to array
|
||||
$array = array(1, 2, 3);
|
||||
dibi::test("
|
||||
@@ -74,7 +70,6 @@ dibi::test("
|
||||
// -> SELECT * FROM people WHERE id IN ( 1, 2, 3 )
|
||||
|
||||
|
||||
|
||||
// modifier %by for ORDER BY
|
||||
$order = array(
|
||||
'field1' => 'asc',
|
||||
@@ -88,7 +83,6 @@ dibi::test("
|
||||
// -> SELECT * FROM people ORDER BY [field1] ASC, [field2] DESC
|
||||
|
||||
|
||||
|
||||
// indentifiers and strings syntax mix
|
||||
dibi::test('UPDATE [table] SET `item` = "5 1/4"" diskette"');
|
||||
// -> UPDATE [table] SET [item] = '5 1/4" diskette'
|
||||
|
@@ -33,7 +33,6 @@ dump( $res->fetch() );
|
||||
// added => "2007-03-11 17:20:03" (19)
|
||||
|
||||
|
||||
|
||||
// using auto-detection (works well with MySQL or other strictly typed databases)
|
||||
$res = dibi::query('SELECT * FROM [customers]');
|
||||
|
||||
|
@@ -10,7 +10,6 @@ require dirname(__FILE__) . '/../dibi/dibi.php';
|
||||
date_default_timezone_set('Europe/Prague');
|
||||
|
||||
|
||||
|
||||
// CHANGE TO REAL PARAMETERS!
|
||||
dibi::connect(array(
|
||||
'driver' => 'sqlite3',
|
||||
@@ -20,7 +19,6 @@ dibi::connect(array(
|
||||
));
|
||||
|
||||
|
||||
|
||||
// generate and dump SQL
|
||||
dibi::test("
|
||||
INSERT INTO [mytable]", array(
|
||||
|
@@ -15,7 +15,6 @@ dibi::connect(array(
|
||||
));
|
||||
|
||||
|
||||
|
||||
// using the "prototype" to add custom method to class DibiResult
|
||||
function DibiResult_prototype_fetchShuffle(DibiResult $obj)
|
||||
{
|
||||
|
@@ -35,7 +35,6 @@ dibi::select('product_id')->as('id')
|
||||
// USING (product_id) INNER JOIN customers USING (customer_id) ORDER BY [title]
|
||||
|
||||
|
||||
|
||||
// SELECT ...
|
||||
echo dibi::select('title')->as('id')
|
||||
->from('products')
|
||||
@@ -43,7 +42,6 @@ echo dibi::select('title')->as('id')
|
||||
// -> Chair (as result of query: SELECT [title] AS [id] FROM [products])
|
||||
|
||||
|
||||
|
||||
// INSERT ...
|
||||
dibi::insert('products', $record)
|
||||
->setFlag('IGNORE')
|
||||
@@ -51,7 +49,6 @@ dibi::insert('products', $record)
|
||||
// -> INSERT IGNORE INTO [products] ([title], [price], [active]) VALUES ('Super product', 318, 1)
|
||||
|
||||
|
||||
|
||||
// UPDATE ...
|
||||
dibi::update('products', $record)
|
||||
->where('product_id = ?', $id)
|
||||
@@ -59,7 +56,6 @@ dibi::update('products', $record)
|
||||
// -> UPDATE [products] SET [title]='Super product', [price]=318, [active]=1 WHERE product_id = 10
|
||||
|
||||
|
||||
|
||||
// DELETE ...
|
||||
dibi::delete('products')
|
||||
->where('product_id = ?', $id)
|
||||
@@ -67,7 +63,6 @@ dibi::delete('products')
|
||||
// -> DELETE FROM [products] WHERE product_id = 10
|
||||
|
||||
|
||||
|
||||
// custom commands
|
||||
dibi::command()
|
||||
->update('products')
|
||||
@@ -77,7 +72,6 @@ dibi::command()
|
||||
// -> UPDATE [products] SET [title]='Super product', [price]=318, [active]=1 WHERE product_id = 10
|
||||
|
||||
|
||||
|
||||
dibi::command()
|
||||
->truncate('products')
|
||||
->test();
|
||||
|
@@ -19,13 +19,11 @@ dibi::test('SELECT * FROM [products]');
|
||||
// -> SELECT * FROM [products]
|
||||
|
||||
|
||||
|
||||
// with limit = 2
|
||||
dibi::test('SELECT * FROM [products] %lmt', 2);
|
||||
// -> SELECT * FROM [products] LIMIT 2
|
||||
|
||||
|
||||
|
||||
// with limit = 2, offset = 1
|
||||
dibi::test('SELECT * FROM [products] %lmt %ofs', 2, 1);
|
||||
// -> SELECT * FROM [products] LIMIT 2 OFFSET 1
|
||||
|
@@ -21,7 +21,6 @@ dibi::connect(array(
|
||||
));
|
||||
|
||||
|
||||
|
||||
try {
|
||||
$res = dibi::query('SELECT * FROM [customers] WHERE [customer_id] = ?', 1);
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
<?php ob_start(1) // needed by FirePHP ?>
|
||||
<?php ob_start() // needed by FirePHP ?>
|
||||
|
||||
<!DOCTYPE html><link rel="stylesheet" href="data/style.css">
|
||||
|
||||
|
@@ -14,8 +14,6 @@ dibi::connect(array(
|
||||
));
|
||||
|
||||
|
||||
|
||||
|
||||
// create new substitution :blog: ==> wp_
|
||||
dibi::getSubstitutes()->blog = 'wp_';
|
||||
|
||||
@@ -23,9 +21,6 @@ dibi::test("SELECT * FROM [:blog:items]");
|
||||
// -> SELECT * FROM [wp_items]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// create new substitution :: (empty) ==> my_
|
||||
dibi::getSubstitutes()->{''} = 'my_';
|
||||
|
||||
@@ -33,9 +28,6 @@ dibi::test("UPDATE ::table SET [text]='Hello World'");
|
||||
// -> UPDATE my_table SET [text]='Hello World'
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// create substitutions using fallback callback
|
||||
function substFallBack($expr)
|
||||
{
|
||||
|
Reference in New Issue
Block a user