From 0d7b9c32c99a25120bf88f640635cd8549bbf877 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Tue, 3 Aug 2010 22:48:44 +0200 Subject: [PATCH] updated phpDoc --- dibi/drivers/firebird.php | 16 ++++++++-------- dibi/drivers/mssql.php | 16 ++++++++-------- dibi/drivers/mssql2005.php | 18 +++++++++--------- dibi/drivers/mysql.php | 28 ++++++++++++++-------------- dibi/drivers/mysqli.php | 30 +++++++++++++++--------------- dibi/drivers/odbc.php | 14 +++++++------- dibi/drivers/oracle.php | 18 +++++++++--------- dibi/drivers/pdo.php | 14 +++++++------- dibi/drivers/postgre.php | 16 ++++++++-------- dibi/drivers/sqlite.php | 20 ++++++++++---------- dibi/drivers/sqlite3.php | 16 ++++++++-------- dibi/libs/DibiConnection.php | 11 ++++++++++- dibi/libs/DibiDatabaseInfo.php | 4 ++-- dibi/libs/DibiFluent.php | 4 ++-- dibi/libs/DibiResult.php | 8 ++------ dibi/libs/DibiRow.php | 2 +- dibi/libs/DibiTranslator.php | 2 +- dibi/libs/interfaces.php | 9 ++++----- 18 files changed, 125 insertions(+), 121 deletions(-) diff --git a/dibi/drivers/firebird.php b/dibi/drivers/firebird.php index 50935c19..1d887f0d 100644 --- a/dibi/drivers/firebird.php +++ b/dibi/drivers/firebird.php @@ -14,14 +14,14 @@ /** * The dibi driver for Firebird/InterBase database. * - * Connection options: - * - 'database' - the path to database file (server:/path/database.fdb) - * - 'username' (or 'user') - * - 'password' (or 'pass') - * - 'charset' - character encoding to set - * - 'buffers' - buffers is the number of database buffers to allocate for the server-side cache. If 0 or omitted, server chooses its own default. - * - 'lazy' - if TRUE, connection will be established only when required - * - 'resource' - connection resource (optional) + * Driver options: + * - database => the path to database file (server:/path/database.fdb) + * - username (or user) + * - password (or pass) + * - charset => character encoding to set + * - buffers (int) => buffers is the number of database buffers to allocate for the server-side cache. If 0 or omitted, server chooses its own default. + * - resource (resource) => existing connection resource + * - lazy, profiler, result, substitutes, ... => see DibiConnection options * * @author Tomáš Kraina, Roman Sklenář * @copyright Copyright (c) 2010 diff --git a/dibi/drivers/mssql.php b/dibi/drivers/mssql.php index f3a2d0ed..3b35aec9 100644 --- a/dibi/drivers/mssql.php +++ b/dibi/drivers/mssql.php @@ -14,14 +14,14 @@ /** * The dibi driver for MS SQL database. * - * Connection options: - * - 'host' - the MS SQL server host name. It can also include a port number (hostname:port) - * - 'username' (or 'user') - * - 'password' (or 'pass') - * - 'persistent' - try to find a persistent link? - * - 'database' - the database name to select - * - 'lazy' - if TRUE, connection will be established only when required - * - 'resource' - connection resource (optional) + * Driver options: + * - host => the MS SQL server host name. It can also include a port number (hostname:port) + * - username (or user) + * - password (or pass) + * - database => the database name to select + * - persistent (bool) => try to find a persistent link? + * - resource (resource) => existing connection resource + * - lazy, profiler, result, substitutes, ... => see DibiConnection options * * @copyright Copyright (c) 2005, 2010 David Grudl * @package dibi\drivers diff --git a/dibi/drivers/mssql2005.php b/dibi/drivers/mssql2005.php index 03bb059e..9930a149 100644 --- a/dibi/drivers/mssql2005.php +++ b/dibi/drivers/mssql2005.php @@ -14,15 +14,15 @@ /** * The dibi driver for MS SQL Driver 2005 database. * - * Connection options: - * - 'host' - the MS SQL server host name. It can also include a port number (hostname:port) - * - 'username' - * - 'password' - * - 'database' - the database name to select - * - 'options' - connection info array {@link http://msdn.microsoft.com/en-us/library/cc296161(SQL.90).aspx} - * - 'lazy' - if TRUE, connection will be established only when required - * - 'charset' - character encoding to set (default is UTF-8) - * - 'resource' - connection resource (optional) + * Driver options: + * - host => the MS SQL server host name. It can also include a port number (hostname:port) + * - username (or user) + * - password (or pass) + * - database => the database name to select + * - options (array) => connection options {@link http://msdn.microsoft.com/en-us/library/cc296161(SQL.90).aspx} + * - charset => character encoding to set (default is UTF-8) + * - resource (resource) => existing connection resource + * - lazy, profiler, result, substitutes, ... => see DibiConnection options * * @copyright Copyright (c) 2005, 2010 David Grudl * @package dibi\drivers diff --git a/dibi/drivers/mysql.php b/dibi/drivers/mysql.php index 016b271e..634450fc 100644 --- a/dibi/drivers/mysql.php +++ b/dibi/drivers/mysql.php @@ -14,20 +14,20 @@ /** * The dibi driver for MySQL database. * - * Connection options: - * - 'host' - the MySQL server host name - * - 'port' - the port number to attempt to connect to the MySQL server - * - 'socket' - the socket or named pipe - * - 'username' (or 'user') - * - 'password' (or 'pass') - * - 'persistent' - try to find a persistent link? - * - 'database' - the database name to select - * - 'charset' - character encoding to set - * - 'unbuffered' - sends query without fetching and buffering the result rows automatically? - * - 'flags' - driver specific constants (MYSQL_CLIENT_*) - * - 'sqlmode' - see http://dev.mysql.com/doc/refman/5.0/en/server-sql-mode.html - * - 'lazy' - if TRUE, connection will be established only when required - * - 'resource' - connection resource (optional) + * Driver options: + * - host => the MySQL server host name + * - port (int) => the port number to attempt to connect to the MySQL server + * - socket => the socket or named pipe + * - username (or user) + * - password (or pass) + * - database => the database name to select + * - flags (int) => driver specific constants (MYSQL_CLIENT_*) + * - charset => character encoding to set + * - persistent (bool) => try to find a persistent link? + * - unbuffered (bool) => sends query without fetching and buffering the result rows automatically? + * - sqlmode => see http://dev.mysql.com/doc/refman/5.0/en/server-sql-mode.html + * - resource (resource) => existing connection resource + * - lazy, profiler, result, substitutes, ... => see DibiConnection options * * @copyright Copyright (c) 2005, 2010 David Grudl * @package dibi\drivers diff --git a/dibi/drivers/mysqli.php b/dibi/drivers/mysqli.php index d8ef2e75..92957e67 100644 --- a/dibi/drivers/mysqli.php +++ b/dibi/drivers/mysqli.php @@ -14,21 +14,21 @@ /** * The dibi driver for MySQL database via improved extension. * - * Connection options: - * - 'host' - the MySQL server host name - * - 'port' - the port number to attempt to connect to the MySQL server - * - 'socket' - the socket or named pipe - * - 'username' (or 'user') - * - 'password' (or 'pass') - * - 'persistent' - try to find a persistent link? - * - 'database' - the database name to select - * - 'charset' - character encoding to set - * - 'unbuffered' - sends query without fetching and buffering the result rows automatically? - * - 'flags' - driver specific bit constants (MYSQLI_CLIENT_*) {@see mysqli_real_connect} - * - 'options' - array of driver specific constants (MYSQLI_*) and values {@see mysqli_options} - * - 'sqlmode' - see http://dev.mysql.com/doc/refman/5.0/en/server-sql-mode.html - * - 'lazy' - if TRUE, connection will be established only when required - * - 'resource' - connection resource (optional) + * Driver options: + * - host => the MySQL server host name + * - port (int) => the port number to attempt to connect to the MySQL server + * - socket => the socket or named pipe + * - username (or user) + * - password (or pass) + * - database => the database name to select + * - options (array) => array of driver specific constants (MYSQLI_*) and values {@see mysqli_options} + * - flags (int) => driver specific constants (MYSQLI_CLIENT_*) {@see mysqli_real_connect} + * - charset => character encoding to set + * - persistent (bool) => try to find a persistent link? + * - unbuffered (bool) => sends query without fetching and buffering the result rows automatically? + * - sqlmode => see http://dev.mysql.com/doc/refman/5.0/en/server-sql-mode.html + * - resource (mysqli) => existing connection resource + * - lazy, profiler, result, substitutes, ... => see DibiConnection options * * @copyright Copyright (c) 2005, 2010 David Grudl * @package dibi\drivers diff --git a/dibi/drivers/odbc.php b/dibi/drivers/odbc.php index 00d25a71..d296e4da 100644 --- a/dibi/drivers/odbc.php +++ b/dibi/drivers/odbc.php @@ -14,13 +14,13 @@ /** * The dibi driver interacting with databases via ODBC connections. * - * Connection options: - * - 'dsn' - driver specific DSN - * - 'username' (or 'user') - * - 'password' (or 'pass') - * - 'persistent' - try to find a persistent link? - * - 'lazy' - if TRUE, connection will be established only when required - * - 'resource' - connection resource (optional) + * Driver options: + * - dsn => driver specific DSN + * - username (or user) + * - password (or pass) + * - persistent (bool) => try to find a persistent link? + * - resource (resource) => existing connection resource + * - lazy, profiler, result, substitutes, ... => see DibiConnection options * * @copyright Copyright (c) 2005, 2010 David Grudl * @package dibi\drivers diff --git a/dibi/drivers/oracle.php b/dibi/drivers/oracle.php index 4a949698..de54ae6b 100644 --- a/dibi/drivers/oracle.php +++ b/dibi/drivers/oracle.php @@ -14,15 +14,15 @@ /** * The dibi driver for Oracle database. * - * Connection options: - * - 'database' (or 'db') - the name of the local Oracle instance or the name of the entry in tnsnames.ora - * - 'username' (or 'user') - * - 'password' (or 'pass') - * - 'lazy' - if TRUE, connection will be established only when required - * - 'formatDate' - how to format date in SQL (@see date) - * - 'formatDateTime' - how to format datetime in SQL (@see date) - * - 'charset' - character encoding to set - * - 'resource' - connection resource (optional) + * Driver options: + * - database => the name of the local Oracle instance or the name of the entry in tnsnames.ora + * - username (or user) + * - password (or pass) + * - charset => character encoding to set + * - formatDate => how to format date in SQL (@see date) + * - formatDateTime => how to format datetime in SQL (@see date) + * - resource (resource) => existing connection resource + * - lazy, profiler, result, substitutes, ... => see DibiConnection options * * @copyright Copyright (c) 2005, 2010 David Grudl * @package dibi\drivers diff --git a/dibi/drivers/pdo.php b/dibi/drivers/pdo.php index 4ef91468..6f1eef5f 100644 --- a/dibi/drivers/pdo.php +++ b/dibi/drivers/pdo.php @@ -14,13 +14,13 @@ /** * The dibi driver for PDO. * - * Connection options: - * - 'dsn' - driver specific DSN - * - 'username' (or 'user') - * - 'password' (or 'pass') - * - 'options' - driver specific options array - * - 'resource' - PDO object (optional) - * - 'lazy' - if TRUE, connection will be established only when required + * Driver options: + * - dsn => driver specific DSN + * - username (or user) + * - password (or pass) + * - options (array) => driver specific options {@see PDO::__construct} + * - resource (PDO) => existing connection + * - lazy, profiler, result, substitutes, ... => see DibiConnection options * * @copyright Copyright (c) 2005, 2010 David Grudl * @package dibi\drivers diff --git a/dibi/drivers/postgre.php b/dibi/drivers/postgre.php index 99d6f657..f3934d37 100644 --- a/dibi/drivers/postgre.php +++ b/dibi/drivers/postgre.php @@ -14,14 +14,14 @@ /** * The dibi driver for PostgreSQL database. * - * Connection options: - * - 'host','hostaddr','port','dbname','user','password','connect_timeout','options','sslmode','service' - see PostgreSQL API - * - 'string' - or use connection string - * - 'persistent' - try to find a persistent link? - * - 'charset' - character encoding to set - * - 'schema' - the schema search path - * - 'lazy' - if TRUE, connection will be established only when required - * - 'resource' - connection resource (optional) + * Driver options: + * - host, hostaddr, port, dbname, user, password, connect_timeout, options, sslmode, service => see PostgreSQL API + * - string => or use connection string + * - schema => the schema search path + * - charset => character encoding to set + * - persistent (bool) => try to find a persistent link? + * - resource (resource) => existing connection resource + * - lazy, profiler, result, substitutes, ... => see DibiConnection options * * @copyright Copyright (c) 2005, 2010 David Grudl * @package dibi\drivers diff --git a/dibi/drivers/sqlite.php b/dibi/drivers/sqlite.php index 2bbf9c1a..f448abe2 100644 --- a/dibi/drivers/sqlite.php +++ b/dibi/drivers/sqlite.php @@ -14,16 +14,16 @@ /** * The dibi driver for SQLite database. * - * Connection options: - * - 'database' (or 'file') - the filename of the SQLite database - * - 'persistent' - try to find a persistent link? - * - 'unbuffered' - sends query without fetching and buffering the result rows automatically? - * - 'lazy' - if TRUE, connection will be established only when required - * - 'formatDate' - how to format date in SQL (@see date) - * - 'formatDateTime' - how to format datetime in SQL (@see date) - * - 'dbcharset' - database character encoding (will be converted to 'charset') - * - 'charset' - character encoding to set (default is UTF-8) - * - 'resource' - connection resource (optional) + * Driver options: + * - database (or file) => the filename of the SQLite database + * - persistent (bool) => try to find a persistent link? + * - unbuffered (bool) => sends query without fetching and buffering the result rows automatically? + * - formatDate => how to format date in SQL (@see date) + * - formatDateTime => how to format datetime in SQL (@see date) + * - dbcharset => database character encoding (will be converted to 'charset') + * - charset => character encoding to set (default is UTF-8) + * - resource (resource) => existing connection resource + * - lazy, profiler, result, substitutes, ... => see DibiConnection options * * @copyright Copyright (c) 2005, 2010 David Grudl * @package dibi\drivers diff --git a/dibi/drivers/sqlite3.php b/dibi/drivers/sqlite3.php index 32c82f36..8f9230ba 100644 --- a/dibi/drivers/sqlite3.php +++ b/dibi/drivers/sqlite3.php @@ -14,14 +14,14 @@ /** * The dibi driver for SQLite3 database. * - * Connection options: - * - 'database' (or 'file') - the filename of the SQLite3 database - * - 'lazy' - if TRUE, connection will be established only when required - * - 'formatDate' - how to format date in SQL (@see date) - * - 'formatDateTime' - how to format datetime in SQL (@see date) - * - 'dbcharset' - database character encoding (will be converted to 'charset') - * - 'charset' - character encoding to set (default is UTF-8) - * - 'resource' - connection resource (optional) + * Driver options: + * - database (or file) => the filename of the SQLite3 database + * - formatDate => how to format date in SQL (@see date) + * - formatDateTime => how to format datetime in SQL (@see date) + * - dbcharset => database character encoding (will be converted to 'charset') + * - charset => character encoding to set (default is UTF-8) + * - resource (SQLite3) => existing connection resource + * - lazy, profiler, result, substitutes, ... => see DibiConnection options * * @copyright Copyright (c) 2005, 2010 David Grudl * @package dibi\drivers diff --git a/dibi/libs/DibiConnection.php b/dibi/libs/DibiConnection.php index aa2d7723..a854240c 100644 --- a/dibi/libs/DibiConnection.php +++ b/dibi/libs/DibiConnection.php @@ -46,7 +46,16 @@ class DibiConnection extends DibiObject /** - * Creates object and (optionally) connects to a database. + * Connection options: (see driver-specific options too) + * - lazy (bool) => if TRUE, connection will be established only when required + * - result (array) => result set options + * - detectTypes (bool) => detect the types of result set fields? + * - formatDateTime => date-time format (if empty, DateTime objects will be returned) + * - profiler (array or bool) + * - run (bool) => enable profiler? + * - class => profiler class name (default is DibiProfiler) + * - substitutes (array) => map of driver specific substitutes (under development) + * @param mixed connection parameters * @param string connection name * @throws DibiException diff --git a/dibi/libs/DibiDatabaseInfo.php b/dibi/libs/DibiDatabaseInfo.php index 4d8a7b41..392ceec3 100644 --- a/dibi/libs/DibiDatabaseInfo.php +++ b/dibi/libs/DibiDatabaseInfo.php @@ -497,7 +497,7 @@ class DibiColumnInfo extends DibiObject */ public function getFullName() { - return $this->info['fullname']; + return isset($this->info['fullname']) ? $this->info['fullname'] : NULL; } @@ -613,7 +613,7 @@ class DibiColumnInfo extends DibiObject * Heuristic type detection. * @param string * @return string - * @internal + * @internal */ public static function detectType($type) { diff --git a/dibi/libs/DibiFluent.php b/dibi/libs/DibiFluent.php index 4085e311..3d96d1dd 100644 --- a/dibi/libs/DibiFluent.php +++ b/dibi/libs/DibiFluent.php @@ -95,7 +95,7 @@ class DibiFluent extends DibiObject implements IDataSource /** @var array */ private $cursor; - /** @var DibiLazyStorage normalized clauses */ + /** @var DibiLazyStorage normalized clauses */ private static $normalizer; @@ -476,7 +476,7 @@ class DibiFluent extends DibiObject implements IDataSource * Format camelCase clause name to UPPER CASE. * @param string * @return string - * @internal + * @internal */ public static function _formatClause($s) { diff --git a/dibi/libs/DibiResult.php b/dibi/libs/DibiResult.php index d1359a8a..c35bfdc7 100644 --- a/dibi/libs/DibiResult.php +++ b/dibi/libs/DibiResult.php @@ -13,7 +13,7 @@ /** - * dibi result-set. + * dibi result set. * * * $result = dibi::query('SELECT * FROM [table]'); @@ -28,10 +28,6 @@ * unset($result); * * - * Result options: - * - 'detectTypes' - whether call automatically detectTypes() - * - 'formatDateTime' - how to format datetime - * * @copyright Copyright (c) 2005, 2010 David Grudl * @package dibi * @@ -648,7 +644,7 @@ class DibiResult extends DibiObject implements IDataSource /** - * Displays complete result-set as HTML table for debug purposes. + * Displays complete result set as HTML table for debug purposes. * @return void */ final public function dump() diff --git a/dibi/libs/DibiRow.php b/dibi/libs/DibiRow.php index 0d422a94..9fa48dc0 100644 --- a/dibi/libs/DibiRow.php +++ b/dibi/libs/DibiRow.php @@ -13,7 +13,7 @@ /** - * Result-set single row. + * Result set single row. * * @copyright Copyright (c) 2005, 2010 David Grudl * @package dibi diff --git a/dibi/libs/DibiTranslator.php b/dibi/libs/DibiTranslator.php index 0d8b55b9..3242f35c 100644 --- a/dibi/libs/DibiTranslator.php +++ b/dibi/libs/DibiTranslator.php @@ -556,7 +556,7 @@ final class DibiTranslator extends DibiObject * Apply substitutions to indentifier and delimites it. * @param string indentifier * @return string - * @internal + * @internal */ public function delimite($value) { diff --git a/dibi/libs/interfaces.php b/dibi/libs/interfaces.php index 253b9ba8..958548c0 100644 --- a/dibi/libs/interfaces.php +++ b/dibi/libs/interfaces.php @@ -221,8 +221,7 @@ interface IDibiDriver /** * Returns metadata for all columns in a result set. - * @return array - * @throws DibiException + * @return array of {name, nativetype [, table, fullname, (int) size, (bool) nullable, (mixed) default, (bool) autoincrement, (array) vendor ]} */ function getColumnsMeta(); @@ -248,21 +247,21 @@ interface IDibiReflector /** * Returns list of tables. - * @return array + * @return array of {name [, (bool) view ]} */ function getTables(); /** * Returns metadata for all columns in a table. * @param string - * @return array + * @return array of {name, nativetype [, table, fullname, (int) size, (bool) nullable, (mixed) default, (bool) autoincrement, (array) vendor ]} */ function getColumns($table); /** * Returns metadata for all indexes in a table. * @param string - * @return array + * @return array of {name, (array of names) columns [, (bool) unique, (bool) primary ]} */ function getIndexes($table);