mirror of
https://github.com/dg/dibi.git
synced 2025-08-02 12:21:06 +02:00
- year 2009 -> 2010
This commit is contained in:
@@ -3,14 +3,14 @@
|
||||
/**
|
||||
* Nette Framework
|
||||
*
|
||||
* Copyright (c) 2004, 2009 David Grudl (http://davidgrudl.com)
|
||||
* Copyright (c) 2004, 2010 David Grudl (http://davidgrudl.com)
|
||||
*
|
||||
* This source file is subject to the "Nette license" that is bundled
|
||||
* with this package in the file license.txt.
|
||||
*
|
||||
* For more information please see http://nettephp.com
|
||||
*
|
||||
* @copyright Copyright (c) 2004, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2004, 2010 David Grudl
|
||||
* @license http://nettephp.com/license Nette license
|
||||
* @link http://nettephp.com
|
||||
* @category Nette
|
||||
@@ -24,8 +24,7 @@
|
||||
/**
|
||||
* Custom output for Nette\Debug.
|
||||
*
|
||||
* @author David Grudl
|
||||
* @copyright Copyright (c) 2004, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2004, 2010 David Grudl
|
||||
* @package Nette
|
||||
*/
|
||||
interface IDebuggable
|
||||
|
@@ -4,14 +4,14 @@
|
||||
* dibi - tiny'n'smart database abstraction layer
|
||||
* ----------------------------------------------
|
||||
*
|
||||
* Copyright (c) 2005, 2009 David Grudl (http://davidgrudl.com)
|
||||
* Copyright (c) 2005, 2010 David Grudl (http://davidgrudl.com)
|
||||
*
|
||||
* This source file is subject to the "dibi license" that is bundled
|
||||
* with this package in the file license.txt.
|
||||
* with this package in the file license.txt, and/or GPL license.
|
||||
*
|
||||
* For more information please see http://dibiphp.com
|
||||
*
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @license http://dibiphp.com/license dibi license
|
||||
* @link http://dibiphp.com
|
||||
* @package dibi
|
||||
@@ -99,8 +99,7 @@ require_once dirname(__FILE__) . '/libs/DibiProfiler.php';
|
||||
* This class is static container class for creating DB objects and
|
||||
* store connections info.
|
||||
*
|
||||
* @author David Grudl
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @package dibi
|
||||
*/
|
||||
class dibi
|
||||
|
@@ -4,14 +4,7 @@
|
||||
* dibi - tiny'n'smart database abstraction layer
|
||||
* ----------------------------------------------
|
||||
*
|
||||
* Copyright (c) 2005, 2009 David Grudl (http://davidgrudl.com)
|
||||
*
|
||||
* This source file is subject to the "dibi license" that is bundled
|
||||
* with this package in the file license.txt.
|
||||
*
|
||||
* For more information please see http://dibiphp.com
|
||||
*
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @license http://dibiphp.com/license dibi license
|
||||
* @link http://dibiphp.com
|
||||
* @package dibi
|
||||
@@ -31,7 +24,7 @@
|
||||
* - 'resource' - connection resource (optional)
|
||||
*
|
||||
* @author Tomáš Kraina, Roman Sklenář
|
||||
* @copyright Copyright (c) 2009
|
||||
* @copyright Copyright (c) 2010
|
||||
* @package dibi
|
||||
*/
|
||||
class DibiFirebirdDriver extends DibiObject implements IDibiDriver
|
||||
@@ -800,7 +793,7 @@ class DibiFirebirdDriver extends DibiObject implements IDibiDriver
|
||||
* Database procedure exception.
|
||||
*
|
||||
* @author Roman Sklenář
|
||||
* @copyright Copyright (c) 2009
|
||||
* @copyright Copyright (c) 2010
|
||||
* @package dibi
|
||||
*/
|
||||
class DibiProcedureException extends DibiException
|
||||
|
@@ -4,14 +4,7 @@
|
||||
* dibi - tiny'n'smart database abstraction layer
|
||||
* ----------------------------------------------
|
||||
*
|
||||
* Copyright (c) 2005, 2009 David Grudl (http://davidgrudl.com)
|
||||
*
|
||||
* This source file is subject to the "dibi license" that is bundled
|
||||
* with this package in the file license.txt.
|
||||
*
|
||||
* For more information please see http://dibiphp.com
|
||||
*
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @license http://dibiphp.com/license dibi license
|
||||
* @link http://dibiphp.com
|
||||
* @package dibi
|
||||
@@ -30,8 +23,7 @@
|
||||
* - 'lazy' - if TRUE, connection will be established only when required
|
||||
* - 'resource' - connection resource (optional)
|
||||
*
|
||||
* @author David Grudl
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @package dibi
|
||||
*/
|
||||
class DibiMsSqlDriver extends DibiObject implements IDibiDriver
|
||||
|
@@ -4,14 +4,7 @@
|
||||
* dibi - tiny'n'smart database abstraction layer
|
||||
* ----------------------------------------------
|
||||
*
|
||||
* Copyright (c) 2005, 2009 David Grudl (http://davidgrudl.com)
|
||||
*
|
||||
* This source file is subject to the "dibi license" that is bundled
|
||||
* with this package in the file license.txt.
|
||||
*
|
||||
* For more information please see http://dibiphp.com
|
||||
*
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @license http://dibiphp.com/license dibi license
|
||||
* @link http://dibiphp.com
|
||||
* @package dibi
|
||||
@@ -28,8 +21,7 @@
|
||||
* - 'charset' - character encoding to set (default is UTF-8)
|
||||
* - 'resource' - connection resource (optional)
|
||||
*
|
||||
* @author David Grudl
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @package dibi
|
||||
*/
|
||||
class DibiMsSql2005Driver extends DibiObject implements IDibiDriver
|
||||
|
@@ -4,14 +4,7 @@
|
||||
* dibi - tiny'n'smart database abstraction layer
|
||||
* ----------------------------------------------
|
||||
*
|
||||
* Copyright (c) 2005, 2009 David Grudl (http://davidgrudl.com)
|
||||
*
|
||||
* This source file is subject to the "dibi license" that is bundled
|
||||
* with this package in the file license.txt.
|
||||
*
|
||||
* For more information please see http://dibiphp.com
|
||||
*
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @license http://dibiphp.com/license dibi license
|
||||
* @link http://dibiphp.com
|
||||
* @package dibi
|
||||
@@ -36,8 +29,7 @@
|
||||
* - 'lazy' - if TRUE, connection will be established only when required
|
||||
* - 'resource' - connection resource (optional)
|
||||
*
|
||||
* @author David Grudl
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @package dibi
|
||||
*/
|
||||
class DibiMySqlDriver extends DibiObject implements IDibiDriver
|
||||
|
@@ -4,14 +4,7 @@
|
||||
* dibi - tiny'n'smart database abstraction layer
|
||||
* ----------------------------------------------
|
||||
*
|
||||
* Copyright (c) 2005, 2009 David Grudl (http://davidgrudl.com)
|
||||
*
|
||||
* This source file is subject to the "dibi license" that is bundled
|
||||
* with this package in the file license.txt.
|
||||
*
|
||||
* For more information please see http://dibiphp.com
|
||||
*
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @license http://dibiphp.com/license dibi license
|
||||
* @link http://dibiphp.com
|
||||
* @package dibi
|
||||
@@ -36,8 +29,7 @@
|
||||
* - 'lazy' - if TRUE, connection will be established only when required
|
||||
* - 'resource' - connection resource (optional)
|
||||
*
|
||||
* @author David Grudl
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @package dibi
|
||||
*/
|
||||
class DibiMySqliDriver extends DibiObject implements IDibiDriver
|
||||
|
@@ -4,14 +4,7 @@
|
||||
* dibi - tiny'n'smart database abstraction layer
|
||||
* ----------------------------------------------
|
||||
*
|
||||
* Copyright (c) 2005, 2009 David Grudl (http://davidgrudl.com)
|
||||
*
|
||||
* This source file is subject to the "dibi license" that is bundled
|
||||
* with this package in the file license.txt.
|
||||
*
|
||||
* For more information please see http://dibiphp.com
|
||||
*
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @license http://dibiphp.com/license dibi license
|
||||
* @link http://dibiphp.com
|
||||
* @package dibi
|
||||
@@ -29,8 +22,7 @@
|
||||
* - 'lazy' - if TRUE, connection will be established only when required
|
||||
* - 'resource' - connection resource (optional)
|
||||
*
|
||||
* @author David Grudl
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @package dibi
|
||||
*/
|
||||
class DibiOdbcDriver extends DibiObject implements IDibiDriver
|
||||
|
@@ -4,14 +4,7 @@
|
||||
* dibi - tiny'n'smart database abstraction layer
|
||||
* ----------------------------------------------
|
||||
*
|
||||
* Copyright (c) 2005, 2009 David Grudl (http://davidgrudl.com)
|
||||
*
|
||||
* This source file is subject to the "dibi license" that is bundled
|
||||
* with this package in the file license.txt.
|
||||
*
|
||||
* For more information please see http://dibiphp.com
|
||||
*
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @license http://dibiphp.com/license dibi license
|
||||
* @link http://dibiphp.com
|
||||
* @package dibi
|
||||
@@ -31,8 +24,7 @@
|
||||
* - 'charset' - character encoding to set
|
||||
* - 'resource' - connection resource (optional)
|
||||
*
|
||||
* @author David Grudl
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @package dibi
|
||||
*/
|
||||
class DibiOracleDriver extends DibiObject implements IDibiDriver
|
||||
|
@@ -4,14 +4,7 @@
|
||||
* dibi - tiny'n'smart database abstraction layer
|
||||
* ----------------------------------------------
|
||||
*
|
||||
* Copyright (c) 2005, 2009 David Grudl (http://davidgrudl.com)
|
||||
*
|
||||
* This source file is subject to the "dibi license" that is bundled
|
||||
* with this package in the file license.txt.
|
||||
*
|
||||
* For more information please see http://dibiphp.com
|
||||
*
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @license http://dibiphp.com/license dibi license
|
||||
* @link http://dibiphp.com
|
||||
* @package dibi
|
||||
@@ -29,8 +22,7 @@
|
||||
* - 'resource' - PDO object (optional)
|
||||
* - 'lazy' - if TRUE, connection will be established only when required
|
||||
*
|
||||
* @author David Grudl
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @package dibi
|
||||
*/
|
||||
class DibiPdoDriver extends DibiObject implements IDibiDriver
|
||||
|
@@ -4,14 +4,7 @@
|
||||
* dibi - tiny'n'smart database abstraction layer
|
||||
* ----------------------------------------------
|
||||
*
|
||||
* Copyright (c) 2005, 2009 David Grudl (http://davidgrudl.com)
|
||||
*
|
||||
* This source file is subject to the "dibi license" that is bundled
|
||||
* with this package in the file license.txt.
|
||||
*
|
||||
* For more information please see http://dibiphp.com
|
||||
*
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @license http://dibiphp.com/license dibi license
|
||||
* @link http://dibiphp.com
|
||||
* @package dibi
|
||||
@@ -30,8 +23,7 @@
|
||||
* - 'lazy' - if TRUE, connection will be established only when required
|
||||
* - 'resource' - connection resource (optional)
|
||||
*
|
||||
* @author David Grudl
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @package dibi
|
||||
*/
|
||||
class DibiPostgreDriver extends DibiObject implements IDibiDriver
|
||||
|
@@ -4,14 +4,7 @@
|
||||
* dibi - tiny'n'smart database abstraction layer
|
||||
* ----------------------------------------------
|
||||
*
|
||||
* Copyright (c) 2005, 2009 David Grudl (http://davidgrudl.com)
|
||||
*
|
||||
* This source file is subject to the "dibi license" that is bundled
|
||||
* with this package in the file license.txt.
|
||||
*
|
||||
* For more information please see http://dibiphp.com
|
||||
*
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @license http://dibiphp.com/license dibi license
|
||||
* @link http://dibiphp.com
|
||||
* @package dibi
|
||||
@@ -32,8 +25,7 @@
|
||||
* - 'charset' - character encoding to set (default is UTF-8)
|
||||
* - 'resource' - connection resource (optional)
|
||||
*
|
||||
* @author David Grudl
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @package dibi
|
||||
*/
|
||||
class DibiSqliteDriver extends DibiObject implements IDibiDriver
|
||||
|
@@ -4,14 +4,7 @@
|
||||
* dibi - tiny'n'smart database abstraction layer
|
||||
* ----------------------------------------------
|
||||
*
|
||||
* Copyright (c) 2005, 2009 David Grudl (http://davidgrudl.com)
|
||||
*
|
||||
* This source file is subject to the "dibi license" that is bundled
|
||||
* with this package in the file license.txt.
|
||||
*
|
||||
* For more information please see http://dibiphp.com
|
||||
*
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @license http://dibiphp.com/license dibi license
|
||||
* @link http://dibiphp.com
|
||||
* @package dibi
|
||||
@@ -30,8 +23,7 @@
|
||||
* - 'charset' - character encoding to set (default is UTF-8)
|
||||
* - 'resource' - connection resource (optional)
|
||||
*
|
||||
* @author David Grudl
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @package dibi
|
||||
*/
|
||||
class DibiSqlite3Driver extends DibiObject implements IDibiDriver
|
||||
|
@@ -4,14 +4,7 @@
|
||||
* dibi - tiny'n'smart database abstraction layer
|
||||
* ----------------------------------------------
|
||||
*
|
||||
* Copyright (c) 2005, 2009 David Grudl (http://davidgrudl.com)
|
||||
*
|
||||
* This source file is subject to the "dibi license" that is bundled
|
||||
* with this package in the file license.txt.
|
||||
*
|
||||
* For more information please see http://dibiphp.com
|
||||
*
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @license http://dibiphp.com/license dibi license
|
||||
* @link http://dibiphp.com
|
||||
* @package dibi
|
||||
@@ -22,8 +15,7 @@
|
||||
/**
|
||||
* dibi connection.
|
||||
*
|
||||
* @author David Grudl
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @package dibi
|
||||
*/
|
||||
class DibiConnection extends DibiObject
|
||||
|
@@ -4,14 +4,7 @@
|
||||
* dibi - tiny'n'smart database abstraction layer
|
||||
* ----------------------------------------------
|
||||
*
|
||||
* Copyright (c) 2005, 2009 David Grudl (http://davidgrudl.com)
|
||||
*
|
||||
* This source file is subject to the "dibi license" that is bundled
|
||||
* with this package in the file license.txt.
|
||||
*
|
||||
* For more information please see http://dibiphp.com
|
||||
*
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @license http://dibiphp.com/license dibi license
|
||||
* @link http://dibiphp.com
|
||||
* @package dibi
|
||||
@@ -22,8 +15,7 @@
|
||||
/**
|
||||
* Default implementation of IDataSource for dibi.
|
||||
*
|
||||
* @author David Grudl
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @package dibi
|
||||
*/
|
||||
class DibiDataSource extends DibiObject implements IDataSource
|
||||
|
@@ -4,14 +4,7 @@
|
||||
* dibi - tiny'n'smart database abstraction layer
|
||||
* ----------------------------------------------
|
||||
*
|
||||
* Copyright (c) 2005, 2009 David Grudl (http://davidgrudl.com)
|
||||
*
|
||||
* This source file is subject to the "dibi license" that is bundled
|
||||
* with this package in the file license.txt.
|
||||
*
|
||||
* For more information please see http://dibiphp.com
|
||||
*
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @license http://dibiphp.com/license dibi license
|
||||
* @link http://dibiphp.com
|
||||
* @package dibi
|
||||
@@ -22,8 +15,7 @@
|
||||
/**
|
||||
* Reflection metadata class for a database.
|
||||
*
|
||||
* @author David Grudl
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @package dibi
|
||||
*/
|
||||
class DibiDatabaseInfo extends DibiObject
|
||||
@@ -134,8 +126,7 @@ class DibiDatabaseInfo extends DibiObject
|
||||
/**
|
||||
* Reflection metadata class for a database table.
|
||||
*
|
||||
* @author David Grudl
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @package dibi
|
||||
*/
|
||||
class DibiTableInfo extends DibiObject
|
||||
@@ -334,8 +325,7 @@ class DibiTableInfo extends DibiObject
|
||||
/**
|
||||
* Reflection metadata class for a result set.
|
||||
*
|
||||
* @author David Grudl
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @package dibi
|
||||
*/
|
||||
class DibiResultInfo extends DibiObject
|
||||
@@ -436,8 +426,7 @@ class DibiResultInfo extends DibiObject
|
||||
/**
|
||||
* Reflection metadata class for a table or result set column.
|
||||
*
|
||||
* @author David Grudl
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @package dibi
|
||||
*/
|
||||
class DibiColumnInfo extends DibiObject
|
||||
@@ -618,8 +607,7 @@ class DibiColumnInfo extends DibiObject
|
||||
/**
|
||||
* Reflection metadata class for a foreign key.
|
||||
*
|
||||
* @author David Grudl
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @package dibi
|
||||
* @todo
|
||||
*/
|
||||
@@ -667,8 +655,7 @@ class DibiForeignKeyInfo extends DibiObject
|
||||
/**
|
||||
* Reflection metadata class for a index or primary key.
|
||||
*
|
||||
* @author David Grudl
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @package dibi
|
||||
*/
|
||||
class DibiIndexInfo extends DibiObject
|
||||
|
@@ -4,14 +4,7 @@
|
||||
* dibi - tiny'n'smart database abstraction layer
|
||||
* ----------------------------------------------
|
||||
*
|
||||
* Copyright (c) 2005, 2009 David Grudl (http://davidgrudl.com)
|
||||
*
|
||||
* This source file is subject to the "dibi license" that is bundled
|
||||
* with this package in the file license.txt.
|
||||
*
|
||||
* For more information please see http://dibiphp.com
|
||||
*
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @license http://dibiphp.com/license dibi license
|
||||
* @link http://dibiphp.com
|
||||
* @package dibi
|
||||
@@ -22,8 +15,7 @@
|
||||
/**
|
||||
* dibi common exception.
|
||||
*
|
||||
* @author David Grudl
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @package dibi
|
||||
*/
|
||||
class DibiException extends Exception implements /*Nette\*/IDebuggable
|
||||
@@ -94,8 +86,7 @@ class DibiException extends Exception implements /*Nette\*/IDebuggable
|
||||
/**
|
||||
* database server exception.
|
||||
*
|
||||
* @author David Grudl
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @package dibi
|
||||
*/
|
||||
class DibiDriverException extends DibiException
|
||||
|
@@ -4,14 +4,7 @@
|
||||
* dibi - tiny'n'smart database abstraction layer
|
||||
* ----------------------------------------------
|
||||
*
|
||||
* Copyright (c) 2005, 2009 David Grudl (http://davidgrudl.com)
|
||||
*
|
||||
* This source file is subject to the "dibi license" that is bundled
|
||||
* with this package in the file license.txt.
|
||||
*
|
||||
* For more information please see http://dibiphp.com
|
||||
*
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @license http://dibiphp.com/license dibi license
|
||||
* @link http://dibiphp.com
|
||||
* @package dibi
|
||||
@@ -22,8 +15,7 @@
|
||||
/**
|
||||
* dibi SQL builder via fluent interfaces. EXPERIMENTAL!
|
||||
*
|
||||
* @author David Grudl
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @package dibi
|
||||
*/
|
||||
class DibiFluent extends DibiObject implements IDataSource
|
||||
|
@@ -4,14 +4,7 @@
|
||||
* dibi - tiny'n'smart database abstraction layer
|
||||
* ----------------------------------------------
|
||||
*
|
||||
* Copyright (c) 2005, 2009 David Grudl (http://davidgrudl.com)
|
||||
*
|
||||
* This source file is subject to the "dibi license" that is bundled
|
||||
* with this package in the file license.txt.
|
||||
*
|
||||
* For more information please see http://dibiphp.com
|
||||
*
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @license http://dibiphp.com/license dibi license
|
||||
* @link http://dibiphp.com
|
||||
* @package dibi
|
||||
@@ -57,8 +50,7 @@
|
||||
* $obj->newMethod($x);
|
||||
* </code>
|
||||
*
|
||||
* @author David Grudl
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @package dibi
|
||||
*/
|
||||
abstract class DibiObject
|
||||
|
@@ -4,14 +4,7 @@
|
||||
* dibi - tiny'n'smart database abstraction layer
|
||||
* ----------------------------------------------
|
||||
*
|
||||
* Copyright (c) 2005, 2009 David Grudl (http://davidgrudl.com)
|
||||
*
|
||||
* This source file is subject to the "dibi license" that is bundled
|
||||
* with this package in the file license.txt.
|
||||
*
|
||||
* For more information please see http://dibiphp.com
|
||||
*
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @license http://dibiphp.com/license dibi license
|
||||
* @link http://dibiphp.com
|
||||
* @package dibi
|
||||
@@ -22,8 +15,7 @@
|
||||
/**
|
||||
* dibi basic logger & profiler (experimental).
|
||||
*
|
||||
* @author David Grudl
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @package dibi
|
||||
*/
|
||||
class DibiProfiler extends DibiObject implements IDibiProfiler
|
||||
|
@@ -4,14 +4,7 @@
|
||||
* dibi - tiny'n'smart database abstraction layer
|
||||
* ----------------------------------------------
|
||||
*
|
||||
* Copyright (c) 2005, 2009 David Grudl (http://davidgrudl.com)
|
||||
*
|
||||
* This source file is subject to the "dibi license" that is bundled
|
||||
* with this package in the file license.txt.
|
||||
*
|
||||
* For more information please see http://dibiphp.com
|
||||
*
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @license http://dibiphp.com/license dibi license
|
||||
* @link http://dibiphp.com
|
||||
* @package dibi
|
||||
@@ -35,8 +28,7 @@
|
||||
* unset($result);
|
||||
* </code>
|
||||
*
|
||||
* @author David Grudl
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @package dibi
|
||||
*/
|
||||
class DibiResult extends DibiObject implements IDataSource
|
||||
|
@@ -4,14 +4,7 @@
|
||||
* dibi - tiny'n'smart database abstraction layer
|
||||
* ----------------------------------------------
|
||||
*
|
||||
* Copyright (c) 2005, 2009 David Grudl (http://davidgrudl.com)
|
||||
*
|
||||
* This source file is subject to the "dibi license" that is bundled
|
||||
* with this package in the file license.txt.
|
||||
*
|
||||
* For more information please see http://dibiphp.com
|
||||
*
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @license http://dibiphp.com/license dibi license
|
||||
* @link http://dibiphp.com
|
||||
* @package dibi
|
||||
@@ -38,8 +31,7 @@
|
||||
* }
|
||||
* </code>
|
||||
*
|
||||
* @author David Grudl
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @package dibi
|
||||
*/
|
||||
class DibiResultIterator implements Iterator, Countable
|
||||
|
@@ -4,14 +4,7 @@
|
||||
* dibi - tiny'n'smart database abstraction layer
|
||||
* ----------------------------------------------
|
||||
*
|
||||
* Copyright (c) 2005, 2009 David Grudl (http://davidgrudl.com)
|
||||
*
|
||||
* This source file is subject to the "dibi license" that is bundled
|
||||
* with this package in the file license.txt.
|
||||
*
|
||||
* For more information please see http://dibiphp.com
|
||||
*
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @license http://dibiphp.com/license dibi license
|
||||
* @link http://dibiphp.com
|
||||
* @package dibi
|
||||
@@ -22,8 +15,7 @@
|
||||
/**
|
||||
* Result-set single row.
|
||||
*
|
||||
* @author David Grudl
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @package dibi
|
||||
*/
|
||||
class DibiRow extends ArrayObject
|
||||
|
@@ -4,14 +4,7 @@
|
||||
* dibi - tiny'n'smart database abstraction layer
|
||||
* ----------------------------------------------
|
||||
*
|
||||
* Copyright (c) 2005, 2009 David Grudl (http://davidgrudl.com)
|
||||
*
|
||||
* This source file is subject to the "dibi license" that is bundled
|
||||
* with this package in the file license.txt.
|
||||
*
|
||||
* For more information please see http://dibiphp.com
|
||||
*
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @license http://dibiphp.com/license dibi license
|
||||
* @link http://dibiphp.com
|
||||
* @package dibi
|
||||
@@ -22,8 +15,7 @@
|
||||
/**
|
||||
* dibi SQL translator.
|
||||
*
|
||||
* @author David Grudl
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @package dibi
|
||||
*/
|
||||
final class DibiTranslator extends DibiObject
|
||||
|
@@ -4,14 +4,7 @@
|
||||
* dibi - tiny'n'smart database abstraction layer
|
||||
* ----------------------------------------------
|
||||
*
|
||||
* Copyright (c) 2005, 2009 David Grudl (http://davidgrudl.com)
|
||||
*
|
||||
* This source file is subject to the "dibi license" that is bundled
|
||||
* with this package in the file license.txt.
|
||||
*
|
||||
* For more information please see http://dibiphp.com
|
||||
*
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @license http://dibiphp.com/license dibi license
|
||||
* @link http://dibiphp.com
|
||||
* @package dibi
|
||||
@@ -87,8 +80,7 @@ interface IDibiProfiler
|
||||
/**
|
||||
* dibi driver interface.
|
||||
*
|
||||
* @author David Grudl
|
||||
* @copyright Copyright (c) 2005, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2005, 2010 David Grudl
|
||||
* @package dibi
|
||||
*/
|
||||
interface IDibiDriver
|
||||
|
@@ -2,23 +2,20 @@
|
||||
/**
|
||||
* Nette Framework
|
||||
*
|
||||
* Copyright (c) 2004, 2009 David Grudl (http://davidgrudl.com)
|
||||
* Copyright (c) 2004, 2010 David Grudl (http://davidgrudl.com)
|
||||
*
|
||||
* This source file is subject to the "Nette license" that is bundled
|
||||
* with this package in the file license.txt.
|
||||
*
|
||||
* For more information please see http://nettephp.com
|
||||
*
|
||||
* @copyright Copyright (c) 2004, 2009 David Grudl
|
||||
* @copyright Copyright (c) 2004, 2010 David Grudl
|
||||
* @license http://nettephp.com/license Nette license
|
||||
* @link http://nettephp.com
|
||||
* @category Nette
|
||||
* @package Nette
|
||||
*/
|
||||
|
||||
if(version_compare(PHP_VERSION,'5.2.0','<')){throw
|
||||
new
|
||||
Exception('Nette Framework requires PHP 5.2.0 or newer.');}@set_magic_quotes_runtime(FALSE);if(version_compare(PHP_VERSION,'5.2.2','<')){function
|
||||
@set_magic_quotes_runtime(FALSE);if(version_compare(PHP_VERSION,'5.2.2','<')){function
|
||||
fixCallback(&$callback){if(is_object($callback)){$callback=array($callback,'__invoke');return;}if(is_string($callback)&&strpos($callback,':')){$callback=explode('::',$callback);}if(is_array($callback)&&is_string($callback[0])&&$a=strrpos($callback[0],'\\')){$callback[0]=substr($callback[0],$a+1);}}}else{function
|
||||
fixCallback(&$callback){if(is_object($callback)){$callback=array($callback,'__invoke');}elseif(is_string($callback)&&$a=strrpos($callback,'\\')){$callback=substr($callback,$a+1);}elseif(is_array($callback)&&is_string($callback[0])&&$a=strrpos($callback[0],'\\')){$callback[0]=substr($callback[0],$a+1);}}}function
|
||||
fixNamespace(&$class){if($a=strrpos($class,'\\')){$class=substr($class,$a+1);}}class
|
||||
@@ -60,8 +57,8 @@ getSeverity(){return$this->severity;}}final
|
||||
class
|
||||
Framework{const
|
||||
NAME='Nette Framework';const
|
||||
VERSION='0.9';const
|
||||
REVISION='650d722 released on 2009-09-17';const
|
||||
VERSION='0.9.3-dev';const
|
||||
REVISION='0459182 released on 2010-01-03';const
|
||||
PACKAGE='PHP 5.2';final
|
||||
public
|
||||
function
|
||||
@@ -91,7 +88,8 @@ PRODUCTION=TRUE;const
|
||||
DETECT=NULL;public
|
||||
static$strictMode=FALSE;public
|
||||
static$onFatalError=array();public
|
||||
static$mailer=array(__CLASS__,'defaultMailer');private
|
||||
static$mailer=array(__CLASS__,'defaultMailer');public
|
||||
static$emailSnooze=172800;private
|
||||
static$enabled=FALSE;private
|
||||
static$logFile;private
|
||||
static$logHandle;private
|
||||
@@ -115,10 +113,10 @@ new
|
||||
LogicException("Cannot instantiate static class ".get_class($this));}public
|
||||
static
|
||||
function
|
||||
init(){self::$time=microtime(TRUE);self::$consoleMode=PHP_SAPI==='cli';self::$productionMode=self::DETECT;self::$firebugDetected=isset($_SERVER['HTTP_USER_AGENT'])&&strpos($_SERVER['HTTP_USER_AGENT'],'FirePHP/');self::$ajaxDetected=isset($_SERVER['HTTP_X_REQUESTED_WITH'])&&$_SERVER['HTTP_X_REQUESTED_WITH']==='XMLHttpRequest';register_shutdown_function(array(__CLASS__,'shutdownHandler'));}public
|
||||
_init(){self::$time=microtime(TRUE);self::$consoleMode=PHP_SAPI==='cli';self::$productionMode=self::DETECT;self::$firebugDetected=isset($_SERVER['HTTP_USER_AGENT'])&&strpos($_SERVER['HTTP_USER_AGENT'],'FirePHP/');self::$ajaxDetected=isset($_SERVER['HTTP_X_REQUESTED_WITH'])&&$_SERVER['HTTP_X_REQUESTED_WITH']==='XMLHttpRequest';register_shutdown_function(array(__CLASS__,'_shutdownHandler'));}public
|
||||
static
|
||||
function
|
||||
shutdownHandler(){static$types=array(E_ERROR=>1,E_CORE_ERROR=>1,E_COMPILE_ERROR=>1,E_PARSE=>1);$error=error_get_last();if(isset($types[$error['type']])){if(!headers_sent()){header('HTTP/1.1 500 Internal Server Error');}if(ini_get('html_errors')){$error['message']=html_entity_decode(strip_tags($error['message']));}self::processException(new
|
||||
_shutdownHandler(){static$types=array(E_ERROR=>1,E_CORE_ERROR=>1,E_COMPILE_ERROR=>1,E_PARSE=>1);$error=error_get_last();if(self::$enabled&&isset($types[$error['type']])){if(!headers_sent()){header('HTTP/1.1 500 Internal Server Error');}if(ini_get('html_errors')){$error['message']=html_entity_decode(strip_tags($error['message']));}self::processException(new
|
||||
FatalErrorException($error['message'],0,$error['type'],$error['file'],$error['line'],NULL),TRUE);}if(self::$productionMode){return;}foreach(headers_list()as$header){if(strncasecmp($header,'Content-Type:',13)===0){if(substr($header,14,9)==='text/html'){break;}return;}}if(self::$enabledProfiler){if(self::$firebugDetected){self::fireLog('Nette profiler',self::GROUP_START);foreach(self::$colophons
|
||||
as$callback){foreach((array)call_user_func($callback,'profiler')as$line)self::fireLog(strip_tags($line));}self::fireLog(NULL,self::GROUP_END);}if(!self::$ajaxDetected){$colophons=self::$colophons;?>
|
||||
|
||||
@@ -397,13 +395,13 @@ htmlspecialchars($item['title'])?></h2>
|
||||
|
||||
<table>
|
||||
<?php $i=0?>
|
||||
<?php foreach((is_array($item['var'])?$item['var']:array(''=>$item['var']))as$key=>$val):?>
|
||||
<?php foreach($item['dump']as$key=>$dump):?>
|
||||
<tr class="<?php echo$i++%
|
||||
2?'odd':'even'?>">
|
||||
<th><?php echo
|
||||
htmlspecialchars($key)?></th>
|
||||
<td><?php echo
|
||||
preg_replace_callback('#(<pre class="dump">|\s+)?(.*)\((\d+)\) <code>#','_netteDumpCb2',Debug::dump($val,TRUE))?></td>
|
||||
preg_replace_callback('#(<pre class="dump">|\s+)?(.*)\((\d+)\) <code>#','_netteDumpCb2',$dump)?></td>
|
||||
</tr>
|
||||
<?php endforeach?>
|
||||
</table>
|
||||
@@ -430,10 +428,10 @@ json_encode($body)?>;
|
||||
<?php }}public
|
||||
static
|
||||
function
|
||||
dump($var,$return=FALSE){if(!$return&&self::$productionMode){return$var;}$output="<pre class=\"dump\">".self::_dump($var,0)."</pre>\n";if(self::$showLocation){$trace=debug_backtrace();if(isset($trace[0]['file'],$trace[0]['line'])){$output=substr_replace($output,' <small>'.htmlspecialchars("in file {$trace[0]['file']} on line {$trace[0]['line']}",ENT_NOQUOTES).'</small>',-8,0);}}if(self::$consoleMode){$output=htmlspecialchars_decode(strip_tags($output),ENT_NOQUOTES);}if($return){return$output;}else{echo$output;return$var;}}public
|
||||
dump($var,$return=FALSE){if(!$return&&self::$productionMode){return$var;}$output="<pre class=\"dump\">".self::_dump($var,0)."</pre>\n";if(self::$showLocation){$trace=debug_backtrace();$i=isset($trace[1]['class'])&&$trace[1]['class']===__CLASS__?1:0;if(isset($trace[$i]['file'],$trace[$i]['line'])){$output=substr_replace($output,' <small>'.htmlspecialchars("in file {$trace[$i]['file']} on line {$trace[$i]['line']}",ENT_NOQUOTES).'</small>',-8,0);}}if(self::$consoleMode){$output=htmlspecialchars_decode(strip_tags($output),ENT_NOQUOTES);}if($return){return$output;}else{echo$output;return$var;}}public
|
||||
static
|
||||
function
|
||||
consoleDump($var,$title=NULL){if(!self::$productionMode){self::$consoleData[]=array('title'=>$title,'var'=>$var);}return$var;}private
|
||||
consoleDump($var,$title=NULL){if(!self::$productionMode){$dump=array();foreach((is_array($var)?$var:array(''=>$var))as$key=>$val){$dump[$key]=self::dump($val,TRUE);}self::$consoleData[]=array('title'=>$title,'dump'=>$dump);}return$var;}private
|
||||
static
|
||||
function
|
||||
_dump(&$var,$level){static$tableUtf,$tableBin,$re='#[^\x09\x0A\x0D\x20-\x7E\xA0-\x{10FFFF}]#u';if($tableUtf===NULL){foreach(range("\x00","\xFF")as$ch){if(ord($ch)<32&&strpos("\r\n\t",$ch)===FALSE)$tableUtf[$ch]=$tableBin[$ch]='\\x'.str_pad(dechex(ord($ch)),2,'0',STR_PAD_LEFT);elseif(ord($ch)<127)$tableUtf[$ch]=$tableBin[$ch]=$ch;else{$tableUtf[$ch]=$ch;$tableBin[$ch]='\\x'.dechex(ord($ch));}}$tableUtf['\\x']=$tableBin['\\x']='\\\\x';}if(is_bool($var)){return"<span>bool</span>(".($var?'TRUE':'FALSE').")\n";}elseif($var===NULL){return"<span>NULL</span>\n";}elseif(is_int($var)){return"<span>int</span>($var)\n";}elseif(is_float($var)){return"<span>float</span>($var)\n";}elseif(is_string($var)){if(self::$maxLen&&strlen($var)>self::$maxLen){$s=htmlSpecialChars(substr($var,0,self::$maxLen),ENT_NOQUOTES).' ... ';}else{$s=htmlSpecialChars($var,ENT_NOQUOTES);}$s=strtr($s,preg_match($re,$s)||preg_last_error()?$tableBin:$tableUtf);return"<span>string</span>(".strlen($var).") \"$s\"\n";}elseif(is_array($var)){$s="<span>array</span>(".count($var).") ";$space=str_repeat($space1=' ',$level);static$marker;if($marker===NULL)$marker=uniqid("\x00",TRUE);if(empty($var)){}elseif(isset($var[$marker])){$s.="{\n$space$space1*RECURSION*\n$space}";}elseif($level<self::$maxDepth||!self::$maxDepth){$s.="<code>{\n";$var[$marker]=0;foreach($var
|
||||
@@ -447,17 +445,17 @@ function
|
||||
enable($mode=NULL,$logFile=NULL,$email=NULL){error_reporting(E_ALL|E_STRICT);if(is_bool($mode)){self::$productionMode=$mode;}if(self::$productionMode===self::DETECT){if(class_exists('Environment')){self::$productionMode=Environment::isProduction();}elseif(isset($_SERVER['SERVER_ADDR'])||isset($_SERVER['LOCAL_ADDR'])){$addr=isset($_SERVER['SERVER_ADDR'])?$_SERVER['SERVER_ADDR']:$_SERVER['LOCAL_ADDR'];$oct=explode('.',$addr);self::$productionMode=$addr!=='::1'&&(count($oct)!==4||($oct[0]!=='10'&&$oct[0]!=='127'&&($oct[0]!=='172'||$oct[1]<16||$oct[1]>31)&&($oct[0]!=='169'||$oct[1]!=='254')&&($oct[0]!=='192'||$oct[1]!=='168')));}else{self::$productionMode=!self::$consoleMode;}}if(self::$productionMode&&$logFile!==FALSE){self::$logFile='log/php_error.log';if(class_exists('Environment')){if(is_string($logFile)){self::$logFile=Environment::expand($logFile);}else
|
||||
try{self::$logFile=Environment::expand('%logDir%/php_error.log');}catch(InvalidStateException$e){}}elseif(is_string($logFile)){self::$logFile=$logFile;}ini_set('error_log',self::$logFile);}if(function_exists('ini_set')){ini_set('display_errors',!self::$productionMode);ini_set('html_errors',!self::$logFile&&!self::$consoleMode);ini_set('log_errors',(bool)self::$logFile);}elseif(ini_get('log_errors')!=(bool)self::$logFile||(ini_get('display_errors')!=!self::$productionMode&&ini_get('display_errors')!==(self::$productionMode?'stderr':'stdout'))){throw
|
||||
new
|
||||
NotSupportedException('Function ini_set() must be enabled.');}self::$sendEmails=self::$logFile&&$email;if(self::$sendEmails){if(is_string($email)){self::$emailHeaders['To']=$email;}elseif(is_array($email)){self::$emailHeaders=$email+self::$emailHeaders;}}if(!defined('E_DEPRECATED')){define('E_DEPRECATED',8192);}if(!defined('E_USER_DEPRECATED')){define('E_USER_DEPRECATED',16384);}set_exception_handler(array(__CLASS__,'exceptionHandler'));set_error_handler(array(__CLASS__,'errorHandler'));self::$enabled=TRUE;}public
|
||||
NotSupportedException('Function ini_set() must be enabled.');}self::$sendEmails=self::$logFile&&$email;if(self::$sendEmails){if(is_string($email)){self::$emailHeaders['To']=$email;}elseif(is_array($email)){self::$emailHeaders=$email+self::$emailHeaders;}}if(!defined('E_DEPRECATED')){define('E_DEPRECATED',8192);}if(!defined('E_USER_DEPRECATED')){define('E_USER_DEPRECATED',16384);}set_exception_handler(array(__CLASS__,'_exceptionHandler'));set_error_handler(array(__CLASS__,'_errorHandler'));self::$enabled=TRUE;}public
|
||||
static
|
||||
function
|
||||
isEnabled(){return
|
||||
self::$enabled;}public
|
||||
static
|
||||
function
|
||||
exceptionHandler(Exception$exception){if(!headers_sent()){header('HTTP/1.1 500 Internal Server Error');}self::processException($exception,TRUE);exit;}public
|
||||
_exceptionHandler(Exception$exception){if(!headers_sent()){header('HTTP/1.1 500 Internal Server Error');}self::processException($exception,TRUE);exit;}public
|
||||
static
|
||||
function
|
||||
errorHandler($severity,$message,$file,$line,$context){if($severity===E_RECOVERABLE_ERROR||$severity===E_USER_ERROR){throw
|
||||
_errorHandler($severity,$message,$file,$line,$context){if($severity===E_RECOVERABLE_ERROR||$severity===E_USER_ERROR){throw
|
||||
new
|
||||
FatalErrorException($message,0,$severity,$file,$line,$context);}elseif(($severity&error_reporting())!==$severity){return
|
||||
NULL;}elseif(self::$strictMode){if(!headers_sent()){header('HTTP/1.1 500 Internal Server Error');}self::processException(new
|
||||
@@ -467,19 +465,18 @@ NULL;}return
|
||||
FALSE;}public
|
||||
static
|
||||
function
|
||||
processException(Exception$exception,$outputAllowed=FALSE){if(self::$logFile){error_log("PHP Fatal error: Uncaught $exception");$file=@strftime('%d-%b-%Y %H-%M-%S ',Debug::$time).strstr(number_format(Debug::$time,4,'~',''),'~');$file=dirname(self::$logFile)."/exception $file.html";self::$logHandle=@fopen($file,'x');if(self::$logHandle){ob_start(array(__CLASS__,'writeFile'),1);self::paintBlueScreen($exception);ob_end_flush();fclose(self::$logHandle);}if(self::$sendEmails){self::sendEmail((string)$exception);}}elseif(self::$productionMode){}elseif(self::$consoleMode){if($outputAllowed){echo"$exception\n";foreach(self::$colophons
|
||||
processException(Exception$exception,$outputAllowed=FALSE){if(!self::$enabled){return;}elseif(self::$logFile){error_log("PHP Fatal error: Uncaught $exception");$file=@strftime('%d-%b-%Y %H-%M-%S ',Debug::$time).strstr(number_format(Debug::$time,4,'~',''),'~');$file=dirname(self::$logFile)."/exception $file.html";self::$logHandle=@fopen($file,'x');if(self::$logHandle){ob_start(array(__CLASS__,'_writeFile'),1);self::_paintBlueScreen($exception);ob_end_flush();fclose(self::$logHandle);}if(self::$sendEmails){self::sendEmail((string)$exception);}}elseif(self::$productionMode){}elseif(self::$consoleMode){if($outputAllowed){echo"$exception\n";foreach(self::$colophons
|
||||
as$callback){foreach((array)call_user_func($callback,'bluescreen')as$line)echo
|
||||
strip_tags($line)."\n";}}}elseif(self::$firebugDetected&&self::$ajaxDetected&&!headers_sent()){self::fireLog($exception,self::EXCEPTION);}elseif($outputAllowed){if(!headers_sent()){@ob_end_clean();while(ob_get_level()&&@ob_end_clean());header('Content-Encoding: identity',TRUE);}self::paintBlueScreen($exception);}elseif(self::$firebugDetected&&!headers_sent()){self::fireLog($exception,self::EXCEPTION);}foreach(self::$onFatalError
|
||||
strip_tags($line)."\n";}}}elseif(self::$firebugDetected&&self::$ajaxDetected&&!headers_sent()){self::fireLog($exception,self::EXCEPTION);}elseif($outputAllowed){if(!headers_sent()){@ob_end_clean();while(ob_get_level()&&@ob_end_clean());if(in_array('Content-Encoding: gzip',headers_list()))header('Content-Encoding: identity',TRUE);}self::_paintBlueScreen($exception);}elseif(self::$firebugDetected&&!headers_sent()){self::fireLog($exception,self::EXCEPTION);}foreach(self::$onFatalError
|
||||
as$handler){fixCallback($handler);call_user_func($handler,$exception);}}public
|
||||
static
|
||||
function
|
||||
paintBlueScreen(Exception$exception){$internals=array();foreach(array('Object','ObjectMixin')as$class){if(class_exists($class,FALSE)){$rc=new
|
||||
_paintBlueScreen(Exception$exception){$internals=array();foreach(array('Object','ObjectMixin')as$class){if(class_exists($class,FALSE)){$rc=new
|
||||
ReflectionClass($class);$internals[$rc->getFileName()]=TRUE;}}if(class_exists('Environment',FALSE)){$application=Environment::getServiceLocator()->hasService('Nette\Application\Application',TRUE)?Environment::getServiceLocator()->getService('Nette\Application\Application'):NULL;}$colophons=self::$colophons;if(!function_exists('_netteDebugPrintCode')){function
|
||||
_netteDebugPrintCode($file,$line,$count=15){if(function_exists('ini_set')){ini_set('highlight.comment','#999; font-style: italic');ini_set('highlight.default','#000');ini_set('highlight.html','#06b');ini_set('highlight.keyword','#d24; font-weight: bold');ini_set('highlight.string','#080');}$start=max(1,$line-floor($count/2));$source=@file_get_contents($file);if(!$source)return;$source=explode("\n",highlight_string($source,TRUE));$spans=1;echo$source[0];$source=explode('<br />',$source[1]);array_unshift($source,NULL);$i=$start;while(--$i>=1){if(preg_match('#.*(</?span[^>]*>)#',$source[$i],$m)){if($m[1]!=='</span>'){$spans++;echo$m[1];}break;}}$source=array_slice($source,$start,$count,TRUE);end($source);$numWidth=strlen((string)key($source));foreach($source
|
||||
as$n=>$s){$spans+=substr_count($s,'<span')-substr_count($s,'</span');$s=str_replace(array("\r","\n"),array('',''),$s);if($n===$line){printf("<span class='highlight'>Line %{$numWidth}s: %s\n</span>%s",$n,strip_tags($s),preg_replace('#[^>]*(<[^>]+>)[^<]*#','$1',$s));}else{printf("<span class='line'>Line %{$numWidth}s:</span> %s\n",$n,$s);}}echo
|
||||
str_repeat('</span>',$spans),'</code>';}function
|
||||
_netteDump($var){return
|
||||
preg_replace_callback('#(<pre class="dump">|\s+)?(.*)\((\d+)\) <code>#','_netteDumpCb',Debug::dump($var,TRUE));}function
|
||||
_netteDump($dump){return'<pre class="dump">'.preg_replace_callback('#(^|\s+)?(.*)\((\d+)\) <code>#','_netteDumpCb',$dump).'</pre>';}function
|
||||
_netteDumpCb($m){return"$m[1]<a href='#' onclick='return !netteToggle(this)'>$m[2]($m[3]) ".(trim($m[1])||$m[3]<7?'<abbr>▼</abbr> </a><code>':'<abbr>►</abbr> </a><code class="collapsed">');}function
|
||||
_netteOpenPanel($name,$collapsed){static$id;$id++;?>
|
||||
<div class="panel">
|
||||
@@ -694,7 +691,7 @@ htmlspecialchars($exception->getMessage())?></p>
|
||||
<?php do{?>
|
||||
|
||||
<?php if($level++):?>
|
||||
<?php _netteOpenPanel('Caused by',TRUE)?>
|
||||
<?php _netteOpenPanel('Caused by',$level>2)?>
|
||||
<div class="panel">
|
||||
<h1><?php echo
|
||||
htmlspecialchars(get_class($ex)),($ex->getCode()?' #'.$ex->getCode():'')?></h1>
|
||||
@@ -744,7 +741,7 @@ htmlSpecialChars(basename(dirname($row['file']))),'/<b>',htmlSpecialChars(basena
|
||||
try{$r=isset($row['class'])?new
|
||||
ReflectionMethod($row['class'],$row['function']):new
|
||||
ReflectionFunction($row['function']);$params=$r->getParameters();}catch(Exception$e){$params=array();}foreach($row['args']as$k=>$v){echo'<tr><th>',(isset($params[$k])?'$'.$params[$k]->name:"#$k"),'</th><td>';echo
|
||||
_netteDump($v);echo"</td></tr>\n";}?>
|
||||
_netteDump(self::_dump($v,0));echo"</td></tr>\n";}?>
|
||||
</table>
|
||||
</div>
|
||||
<?php endif?>
|
||||
@@ -783,7 +780,7 @@ IDebuggable):?>
|
||||
<?php
|
||||
|
||||
foreach($ex->context
|
||||
as$k=>$v){echo'<tr><th>$',htmlspecialchars($k),'</th><td>',_netteDump($v),"</td></tr>\n";}?>
|
||||
as$k=>$v){echo'<tr><th>$',htmlspecialchars($k),'</th><td>',_netteDump(self::_dump($v,0)),"</td></tr>\n";}?>
|
||||
</table>
|
||||
<?php _netteClosePanel()?>
|
||||
<?php endif?>
|
||||
@@ -793,22 +790,20 @@ as$k=>$v){echo'<tr><th>$',htmlspecialchars($k),'</th><td>',_netteDump($v),"</td>
|
||||
|
||||
|
||||
|
||||
|
||||
<?php if(!empty($application)):?>
|
||||
<?php _netteOpenPanel('Nette Application',TRUE)?>
|
||||
<h3>Requests</h3>
|
||||
<?php echo
|
||||
_netteDump($application->getRequests())?>
|
||||
<?php $tmp=$application->getRequests();echo
|
||||
_netteDump(self::_dump($tmp,0))?>
|
||||
|
||||
<h3>Presenter</h3>
|
||||
<?php echo
|
||||
_netteDump($application->getPresenter())?>
|
||||
<?php $tmp=$application->getPresenter();echo
|
||||
_netteDump(self::_dump($tmp,0))?>
|
||||
<?php _netteClosePanel()?>
|
||||
<?php endif?>
|
||||
|
||||
|
||||
|
||||
|
||||
<?php _netteOpenPanel('Environment',TRUE)?>
|
||||
<?php
|
||||
$list=get_defined_constants(TRUE);if(!empty($list['user'])):?>
|
||||
@@ -816,7 +811,7 @@ $list=get_defined_constants(TRUE);if(!empty($list['user'])):?>
|
||||
<table id="pnl-env-const">
|
||||
<?php
|
||||
|
||||
foreach($list['user']as$k=>$v){echo'<tr'.($rn++%2?' class="odd"':'').'><th>',htmlspecialchars($k),'</th>';echo'<td>',_netteDump($v),"</td></tr>\n";}?>
|
||||
foreach($list['user']as$k=>$v){echo'<tr'.($rn++%2?' class="odd"':'').'><th>',htmlspecialchars($k),'</th>';echo'<td>',_netteDump(self::_dump($v,0)),"</td></tr>\n";}?>
|
||||
</table>
|
||||
<?php endif?>
|
||||
|
||||
@@ -838,14 +833,13 @@ foreach(get_included_files()as$v){echo'<tr'.($rn++%2?' class="odd"':'').'><td>',
|
||||
<?php
|
||||
|
||||
foreach($_SERVER
|
||||
as$k=>$v)echo'<tr'.($rn++%2?' class="odd"':'').'><th>',htmlspecialchars($k),'</th><td>',_netteDump($v),"</td></tr>\n";?>
|
||||
as$k=>$v)echo'<tr'.($rn++%2?' class="odd"':'').'><th>',htmlspecialchars($k),'</th><td>',_netteDump(self::_dump($v,0)),"</td></tr>\n";?>
|
||||
</table>
|
||||
<?php endif?>
|
||||
<?php _netteClosePanel()?>
|
||||
|
||||
|
||||
|
||||
|
||||
<?php _netteOpenPanel('HTTP request',TRUE)?>
|
||||
<?php if(function_exists('apache_request_headers')):?>
|
||||
<h3>Headers</h3>
|
||||
@@ -865,7 +859,7 @@ foreach(apache_request_headers()as$k=>$v)echo'<tr'.($rn++%2?' class="odd"':'').'
|
||||
<table>
|
||||
<?php
|
||||
|
||||
foreach($GLOBALS[$name]as$k=>$v)echo'<tr'.($rn++%2?' class="odd"':'').'><th>',htmlspecialchars($k),'</th><td>',_netteDump($v),"</td></tr>\n";?>
|
||||
foreach($GLOBALS[$name]as$k=>$v)echo'<tr'.($rn++%2?' class="odd"':'').'><th>',htmlspecialchars($k),'</th><td>',_netteDump(self::_dump($v,0)),"</td></tr>\n";?>
|
||||
</table>
|
||||
<?php endif?>
|
||||
<?php endforeach?>
|
||||
@@ -902,10 +896,10 @@ as$callback):?>
|
||||
</html><?php }public
|
||||
static
|
||||
function
|
||||
writeFile($buffer){fwrite(self::$logHandle,$buffer);}private
|
||||
_writeFile($buffer){fwrite(self::$logHandle,$buffer);}private
|
||||
static
|
||||
function
|
||||
sendEmail($message){$monitorFile=self::$logFile.'.monitor';if(!is_file($monitorFile)){if(@file_put_contents($monitorFile,'e-mail has been sent')){call_user_func(self::$mailer,$message);}}}private
|
||||
sendEmail($message){$monitorFile=self::$logFile.'.monitor';if(@filemtime($monitorFile)+self::$emailSnooze<time()&&@file_put_contents($monitorFile,'sent')){call_user_func(self::$mailer,$message);}}private
|
||||
static
|
||||
function
|
||||
defaultMailer($message){$host=isset($_SERVER['HTTP_HOST'])?$_SERVER['HTTP_HOST']:(isset($_SERVER['SERVER_NAME'])?$_SERVER['SERVER_NAME']:'');$headers=str_replace(array('%host%','%date%','%message%'),array($host,@date('Y-m-d H:i:s',Debug::$time),$message),self::$emailHeaders);$subject=$headers['Subject'];$to=$headers['To'];$body=$headers['Body'];unset($headers['Subject'],$headers['To'],$headers['Body']);$header='';foreach($headers
|
||||
@@ -920,7 +914,7 @@ static
|
||||
function
|
||||
addColophon($callback){fixCallback($callback);if(!is_callable($callback)){$able=is_callable($callback,TRUE,$textual);throw
|
||||
new
|
||||
InvalidArgumentException("Colophon handler '$textual' is not ".($able?'callable.':'valid PHP callback.'));}if(!in_array($callback,self::$colophons,TRUE)){self::$colophons[]=$callback;}}public
|
||||
InvalidArgumentException("Colophon handler '$textual' is not ".($able?'callable.':'valid PHP callback.'));}if(!in_array($callback,self::$colophons,TRUE)){self::$colophons[]=$callback;}}private
|
||||
static
|
||||
function
|
||||
getDefaultColophons($sender){if($sender==='profiler'){$arr[]='Elapsed time: <b>'.number_format((microtime(TRUE)-Debug::$time)*1000,1,'.',' ').'</b> ms | Allocated memory: <b>'.number_format(memory_get_peak_usage()/1000,1,'.',' ').'</b> kB';foreach((array)self::$counters
|
||||
@@ -944,4 +938,4 @@ TRUE;}static
|
||||
private
|
||||
function
|
||||
replaceObjects($val){if(is_object($val)){return'object '.get_class($val).'';}elseif(is_string($val)){return@iconv('UTF-16','UTF-8//IGNORE',iconv('UTF-8','UTF-16//IGNORE',$val));}elseif(is_array($val)){foreach($val
|
||||
as$k=>$v){unset($val[$k]);$k=@iconv('UTF-16','UTF-8//IGNORE',iconv('UTF-8','UTF-16//IGNORE',$k));$val[$k]=self::replaceObjects($v);}}return$val;}}Debug::init();
|
||||
as$k=>$v){unset($val[$k]);$k=@iconv('UTF-16','UTF-8//IGNORE',iconv('UTF-8','UTF-16//IGNORE',$k));$val[$k]=self::replaceObjects($v);}}return$val;}}Debug::_init();
|
@@ -1,4 +1,4 @@
|
||||
Dibi (c) David Grudl, 2005-2009 (http://davidgrudl.com)
|
||||
Dibi (c) David Grudl, 2005-2010 (http://davidgrudl.com)
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user