| [ Index ] |
|
Code source de Flux CMS 1.5 |
[Code source] [Imprimer] [Statistiques]
(pas de description)
| Author: | Lukas Smith <smith@pooteeweet.org> |
| Poids: | 3412 lignes (112 kb) |
| Inclus ou requis: | 0 fois |
| Référencé: | 0 fois |
| Nécessite: | 1 fichier inc/PEAR.php |
MDB2:: (15 méthodes):
setOptions()
factory()
connect()
singleton()
loadFile()
apiVersion()
raiseError()
isError()
isConnection()
isResult()
isResultCommon()
isStatement()
errorMessage()
parseDSN()
fileExists()
MDB2_Error:: (1 méthode):
MDB2_Error()
MDB2_Driver_Common:: (53 méthodes):
__construct()
MDB2_Driver_Common()
__destruct()
free()
__toString()
errorInfo()
raiseError()
resetWarnings()
getWarnings()
setFetchMode()
setOption()
getOption()
debug()
getDebugOutput()
escape()
quoteIdentifier()
getConnection()
_fixResultArrayValues()
loadModule()
__call()
beginTransaction()
commit()
rollback()
disconnect()
setDatabase()
getDatabase()
setDSN()
getDSN()
standaloneQuery()
_modifyQuery()
_doQuery()
_affectedRows()
exec()
query()
_wrapResult()
getServerVersion()
setLimit()
subSelect()
replace()
prepare()
quote()
getDeclaration()
compareDefinition()
supports()
getSequenceName()
getIndexName()
nextID()
lastInsertID()
currID()
queryOne()
queryRow()
queryCol()
queryAll()
MDB2_Result:: (0 méthodes):
MDB2_Result_Common:: (18 méthodes):
__construct()
MDB2_Result_Common()
setResultTypes()
seek()
fetchRow()
fetchOne()
fetchCol()
fetchAll()
rowCount()
numRows()
nextResult()
getColumnNames()
_getColumnNames()
numCols()
getResource()
bindColumn()
_assignBindColumns()
free()
MDB2_Row:: (2 méthodes):
__construct()
MDB2_Row()
MDB2_Statement_Common:: (7 méthodes):
__construct()
MDB2_Statement_Common()
bindParam()
bindParamArray()
execute()
_execute()
free()
MDB2_Module_Common:: (5 méthodes):
__construct()
MDB2_Module_Common()
getDBInstance()
MDB2_closeOpenTransactions()
MDB2_defaultDebugOutput()
| setOptions(&$db, $options) X-Ref |
| set option array in an exiting database object param: MDB2_Driver_Common $db MDB2 object param: array $options An associative array of option names and their values. |
| factory($dsn, $options = false) X-Ref |
| Create a new MDB2 object for the specified database type IMPORTANT: In order for MDB2 to work properly it is necessary that you make sure that you work with a reference of the original object instead of a copy (this is a PHP4 quirk). For example: $db =& MDB2::factory($dsn); ^^ And not: $db = MDB2::factory($dsn); param: mixed $dsn 'data source name', see the MDB2::parseDSN param: array $options An associative array of option names and return: mixed a newly created MDB2 object, or false on error |
| connect($dsn, $options = false) X-Ref |
| Create a new MDB2 connection object and connect to the specified database IMPORTANT: In order for MDB2 to work properly it is necessary that you make sure that you work with a reference of the original object instead of a copy (this is a PHP4 quirk). For example: $db =& MDB2::connect($dsn); ^^ And not: $db = MDB2::connect($dsn); ^^ param: mixed $dsn 'data source name', see the MDB2::parseDSN param: array $options An associative array of option names and return: mixed a newly created MDB2 connection object, or a MDB2 |
| singleton($dsn = null, $options = false) X-Ref |
| Returns a MDB2 connection with the requested DSN. A newnew MDB2 connection object is only created if no object with the reuested DSN exists yet. IMPORTANT: In order for MDB2 to work properly it is necessary that you make sure that you work with a reference of the original object instead of a copy (this is a PHP4 quirk). For example: $db =& MDB2::singleton($dsn); ^^ And not: $db = MDB2::singleton($dsn); ^^ param: mixed $dsn 'data source name', see the MDB2::parseDSN param: array $options An associative array of option names and return: mixed a newly created MDB2 connection object, or a MDB2 |
| loadFile($file) X-Ref |
| load a file (like 'Date') param: string $file name of the file in the MDB2 directory (without '.php') return: string name of the file that was included |
| apiVersion() X-Ref |
| Return the MDB2 API version return: string the MDB2 API version number |
| raiseError($code = null, $mode = null, $options = null, $userinfo = null) X-Ref |
| This method is used to communicate an error and invoke error callbacks etc. Basically a wrapper for PEAR::raiseError without the message string. param: mixed integer error code param: int error mode, see PEAR_Error docs param: mixed If error mode is PEAR_ERROR_TRIGGER, this is the param: string Extra debug information. Defaults to the last return: object a PEAR error object |
| isError($data, $code = null) X-Ref |
| Tell whether a value is a MDB2 error. param: mixed $data the value to test param: int $code if $data is an error object, return true return: bool true if parameter is an error |
| isConnection($value) X-Ref |
| Tell whether a value is a MDB2 connection param: mixed $value value to test return: bool whether $value is a MDB2 connection |
| isResult($value) X-Ref |
| Tell whether a value is a MDB2 result param: mixed $value value to test return: bool whether $value is a MDB2 result |
| isResultCommon($value) X-Ref |
| Tell whether a value is a MDB2 result implementing the common interface param: mixed $value value to test return: bool whether $value is a MDB2 result implementing the common interface |
| isStatement($value) X-Ref |
| Tell whether a value is a MDB2 statement interface param: mixed $value value to test return: bool whether $value is a MDB2 statement interface |
| errorMessage($value) X-Ref |
| Return a textual error message for a MDB2 error code param: int $value error code return: string error message, or false if the error code was |
| parseDSN($dsn) X-Ref |
| Parse a data source name. Additional keys can be added by appending a URI query string to the end of the DSN. The format of the supplied DSN is in its fullest form: <code> phptype(dbsyntax)://username:password@protocol+hostspec/database?option=8&another=true </code> Most variations are allowed: <code> phptype://username:password@protocol+hostspec:110//usr/db_file.db?mode=0644 phptype://username:password@hostspec/database_name phptype://username:password@hostspec phptype://username@hostspec phptype://hostspec/database phptype://hostspec phptype(dbsyntax) phptype </code> author: Tomas V.V.Cox <cox@idecnet.com> param: string $dsn Data Source Name to be parsed return: array an associative array with the following keys: |
| fileExists($file) X-Ref |
| checks if a file exists in the include path param: string filename return: boolean true success and false on error |
Classe: MDB2_Error - X-Ref
MDB2_Error implements a class for reporting portable database error| MDB2_Error($code = MDB2_ERROR, $mode = PEAR_ERROR_RETURN,$level = E_USER_NOTICE, $debuginfo = null) X-Ref |
| MDB2_Error constructor. param: mixed $code MDB error code, or string with error message. param: integer $mode what 'error mode' to operate in param: integer $level what error level to use for param: smixed $debuginfo additional debug info, such as the last query |
Classe: MDB2_Driver_Common - X-Ref
MDB2_Driver_Common: Base class that is extended by each MDB2 driver| __construct() X-Ref |
| Constructor |
| MDB2_Driver_Common() X-Ref |
| PHP 4 Constructor |
| __destruct() X-Ref |
| Destructor |
| free() X-Ref |
| Free the internal references so that the instance can be destroyed return: boolean true on success, false if result is invalid |
| __toString() X-Ref |
| String conversation return: string |
| errorInfo($error = null) X-Ref |
| This method is used to collect information about an error param: integer $error return: array |
| raiseError( $code = null, $mode = null, $options = null, $userinfo = null, $error_class = null, $foo= null,$skipmsg = false) X-Ref |
| This method is used to communicate an error and invoke error callbacks etc. Basically a wrapper for PEAR::raiseError without the message string. param: mixed integer error code, or a PEAR error object (all param: int error mode, see PEAR_Error docs param: mixed If error mode is PEAR_ERROR_TRIGGER, this is the param: string Extra debug information. Defaults to the last return: object a PEAR error object |
| resetWarnings() X-Ref |
| reset the warning array |
| getWarnings() X-Ref |
| get all warnings in reverse order. This means that the last warning is the first element in the array return: array with warnings |
| setFetchMode($fetchmode, $object_class = 'stdClass') X-Ref |
| Sets which fetch mode should be used by default on queries on this connection param: integer $fetchmode MDB2_FETCHMODE_ORDERED, MDB2_FETCHMODE_ASSOC param: string $object_class the class name of the object to be returned return: mixed MDB2_OK or MDB2 Error Object |
| setOption($option, $value) X-Ref |
| set the option for the db class param: string $option option name param: mixed $value value for the option return: mixed MDB2_OK or MDB2 Error Object |
| getOption($option) X-Ref |
| returns the value of an option param: string $option option name return: mixed the option value or error object |
| debug($message, $scope = '') X-Ref |
| set a debug message param: string $message Message with information for the user. |
| getDebugOutput() X-Ref |
| output debug info return: string content of the debug_output class variable |
| escape($text) X-Ref |
| Quotes a string so it can be safely used in a query. It will quote the text so it can safely be used within a query. param: string $text the input string to quote return: string quoted string |
| quoteIdentifier($str, $check_option = false) X-Ref |
| Quote a string so it can be safely used as a table or column name Delimiting style depends on which database driver is being used. NOTE: just because you CAN use delimited identifiers doesn't mean you SHOULD use them. In general, they end up causing way more problems than they solve. Portability is broken by using the following characters inside delimited identifiers: + backtick (<kbd>`</kbd>) -- due to MySQL + double quote (<kbd>"</kbd>) -- due to Oracle + brackets (<kbd>[</kbd> or <kbd>]</kbd>) -- due to Access Delimited identifiers are known to generally work correctly under the following drivers: + mssql + mysql + mysqli + oci8 + odbc(access) + odbc(db2) + pgsql + sqlite + sybase InterBase doesn't seem to be able to use delimited identifiers via PHP 4. They work fine under PHP 5. param: string $str identifier name to be quoted param: bool $check_option check the 'quote_identifier' option return: string quoted identifier string |
| getConnection() X-Ref |
| Returns a native connection return: mixed a valid MDB2 connection object, |
| _fixResultArrayValues(&$array, $mode) X-Ref |
| Do all necessary conversions on result arrays to fix DBMS quirks param: array $array the array to be fixed (passed by reference) return: void |
| loadModule($module, $property = null, $phptype_specific = null) X-Ref |
| loads a module param: string $module name of the module that should be loaded param: string $property name of the property into which the class will be loaded param: boolean $phptype_specific if the class to load for the module return: object on success a reference to the given module is returned |
| __call($method, $params) X-Ref |
| Calls a module method using the __call magic method param: string Method name. param: array Arguments. return: mixed Returned value. |
| beginTransaction() X-Ref |
| Start a transaction. return: mixed MDB2_OK on success, a MDB2 error on failure |
| commit() X-Ref |
| Commit the database changes done during a transaction that is in progress. This function may only be called when auto-committing is disabled, otherwise it will fail. Therefore, a new transaction is implicitly started after committing the pending changes. return: mixed MDB2_OK on success, a MDB2 error on failure |
| rollback() X-Ref |
| Cancel any database changes done during a transaction that is in progress. This function may only be called when auto-committing is disabled, otherwise it will fail. Therefore, a new transaction is implicitly started after canceling the pending changes. return: mixed MDB2_OK on success, a MDB2 error on failure |
| disconnect() X-Ref |
| Log out and disconnect from the database. return: mixed true on success, false if not connected and error |
| setDatabase($name) X-Ref |
| Select a different database param: string $name name of the database that should be selected return: string name of the database previously connected to |
| getDatabase() X-Ref |
| get the current database return: string name of the database |
| setDSN($dsn) X-Ref |
| set the DSN param: mixed $dsn DSN string or array return: MDB2_OK |
| getDSN($type = 'string', $hidepw = false) X-Ref |
| return the DSN as a string param: string $type format to return ("array", "string") param: string $hidepw string to hide the password with return: mixed DSN in the chosen type |
| standaloneQuery($query, $types = null, $is_manip = false) X-Ref |
| execute a query as database administrator param: string $query the SQL query param: mixed $types array that contains the types of the columns in param: boolean $is_manip if the query is a manipulation query return: mixed MDB2_OK on success, a MDB2 error on failure |
| _modifyQuery($query, $is_manip, $limit, $offset) X-Ref |
| Changes a query string for various DBMS specific reasons param: string $query query to modify return: the new (modified) query |
| _doQuery($query, $is_manip = false, $connection = null, $database_name = null) X-Ref |
| Execute a query param: string $query query param: boolean $is_manip if the query is a manipulation query param: resource $connection param: string $database_name return: result or error object |
| _affectedRows($connection, $result = null) X-Ref |
| returns the number of rows affected param: resource $result param: resource $connection return: mixed MDB2 Error Object or the number of rows affected |
| exec($query) X-Ref |
| Execute a manipulation query to the database and return any the affected rows param: string $query the SQL query return: mixed affected rows on success, a MDB2 error on failure |
| query($query, $types = null, $result_class = true, $result_wrap_class = false) X-Ref |
| Send a query to the database and return any results param: string $query the SQL query param: mixed $types array that contains the types of the columns in param: mixed $result_class string which specifies which result class to use param: mixed $result_wrap_class string which specifies which class to wrap results in return: object a result handle on success, a MDB2 error on failure |
| _wrapResult($result, $types = array() X-Ref |
| wrap a result set into the correct class param: ressource $result param: mixed $types array that contains the types of the columns in param: mixed $result_class string which specifies which result class to use param: mixed $result_wrap_class string which specifies which class to wrap results in param: string $limit number of rows to select param: string $offset first row to select return: mixed a result handle or MDB2_OK on success, a MDB2 error on failure |
| getServerVersion($native = false) X-Ref |
| return version information about the server param: string $native determines if the raw version string should be returned return: mixed array with versoin information or row string |
| setLimit($limit, $offset = null) X-Ref |
| set the range of the next query param: string $limit number of rows to select param: string $offset first row to select return: mixed MDB2_OK on success, a MDB2 error on failure |
| subSelect($query, $type = false) X-Ref |
| simple subselect emulation: leaves the query untouched for all RDBMS that support subselects param: string $query the SQL query for the subselect that may only param: string $type determines type of the field return: string the query |
| replace($table, $fields) X-Ref |
| Execute a SQL REPLACE query. A REPLACE query is identical to a INSERT query, except that if there is already a row in the table with the same key field values, the REPLACE query just updates its values instead of inserting a new row. The REPLACE type of query does not make part of the SQL standards. Since pratically only MySQL implements it natively, this type of query is emulated through this method for other DBMS using standard types of queries inside a transaction to assure the atomicity of the operation. param: string $table name of the table on which the REPLACE query will param: array $fields associative array that describes the fields and the return: mixed MDB2_OK on success, a MDB2 error on failure |
| prepare($query, $types = null, $result_types = null) X-Ref |
| Prepares a query for multiple execution with execute(). With some database backends, this is emulated. prepare() requires a generic query as string like 'INSERT INTO numbers VALUES(?,?)' or 'INSERT INTO numbers VALUES(:foo,:bar)'. The ? and :[a-zA-Z] and are placeholders which can be set using bindParam() and the query can be send off using the execute() method. param: string $query the query to prepare param: mixed $types array that contains the types of the placeholders param: mixed $result_types array that contains the types of the columns in return: mixed resource handle for the prepared query on success, a MDB2 |
| quote($value, $type = null, $quote = true) X-Ref |
| Convert a text value into a DBMS specific format that is suitable to compose query statements. param: string $value text string value that is intended to be converted. param: string $type type to which the value should be converted to return: string text string that represents the given argument value in |
| getDeclaration($type, $name, $field) X-Ref |
| Obtain DBMS specific SQL code portion needed to declare of the given type param: string $type type to which the value should be converted to param: string $name name the field to be declared. param: string $field definition of the field return: string DBMS specific SQL code portion that should be used to |
| compareDefinition($current, $previous) X-Ref |
| Obtain an array of changes that may need to applied param: array $current new definition param: array $previous old definition return: array containg all changes that will need to be applied |
| supports($feature) X-Ref |
| Tell whether a DB implementation or its backend extension supports a given feature. param: string $feature name of the feature (see the MDB2 class doc) return: boolean|string whether this DB implementation supports $feature |
| getSequenceName($sqn) X-Ref |
| adds sequence name formatting to a sequence name param: string $sqn name of the sequence return: string formatted sequence name |
| getIndexName($idx) X-Ref |
| adds index name formatting to a index name param: string $idx name of the index return: string formatted index name |
| nextID($seq_name, $ondemand = true) X-Ref |
| returns the next free id of a sequence param: string $seq_name name of the sequence param: boolean $ondemand when true the seqence is return: mixed MDB2 Error Object or id |
| lastInsertID($table = null, $field = null) X-Ref |
| returns the autoincrement ID if supported or $id param: mixed $id value as returned by getBeforeId() param: string $table name of the table into which a new row was inserted return: mixed MDB2 Error Object or id |
| currID($seq_name) X-Ref |
| returns the current id of a sequence param: string $seq_name name of the sequence return: mixed MDB2 Error Object or id |
| queryOne($query, $type = null) X-Ref |
| Execute the specified query, fetch the value from the first column of the first row of the result set and then frees the result set. param: string $query the SELECT query statement to be executed. param: string $type optional argument that specifies the expected return: mixed MDB2_OK or field value on success, a MDB2 error on failure |
| queryRow($query, $types = null, $fetchmode = MDB2_FETCHMODE_DEFAULT) X-Ref |
| Execute the specified query, fetch the values from the first row of the result set into an array and then frees the result set. param: string $query the SELECT query statement to be executed. param: array $types optional array argument that specifies a list of param: int $fetchmode how the array data should be indexed return: mixed MDB2_OK or data array on success, a MDB2 error on failure |
| queryCol($query, $type = null, $colnum = 0) X-Ref |
| Execute the specified query, fetch the value from the first column of each row of the result set into an array and then frees the result set. param: string $query the SELECT query statement to be executed. param: string $type optional argument that specifies the expected param: int $colnum the row number to fetch return: mixed MDB2_OK or data array on success, a MDB2 error on failure |
| queryAll($query, $types = null, $fetchmode = MDB2_FETCHMODE_DEFAULT,$rekey = false, $force_array = false, $group = false) X-Ref |
| Execute the specified query, fetch all the rows of the result set into a two dimensional array and then frees the result set. param: string $query the SELECT query statement to be executed. param: array $types optional array argument that specifies a list of param: int $fetchmode how the array data should be indexed param: boolean $rekey if set to true, the $all will have the first param: boolean $force_array used only when the query returns exactly param: boolean $group if true, the values of the returned array is return: mixed MDB2_OK or data array on success, a MDB2 error on failure |
Classe: MDB2_Result - X-Ref
Classe: MDB2_Result_Common - X-Ref
| __construct(&$db, &$result, $limit = 0, $offset = 0) X-Ref |
| Constructor |
| MDB2_Result_Common(&$db, &$result, $limit = 0, $offset = 0) X-Ref |
| Pas de description |
| setResultTypes($types) X-Ref |
| Define the list of types to be associated with the columns of a given result set. This function may be called before invoking fetchRow(), fetchOne(), fetchCol() and fetchAll() so that the necessary data type conversions are performed on the data to be retrieved by them. If this function is not called, the type of all result set columns is assumed to be text, thus leading to not perform any conversions. param: string $types array variable that lists the return: mixed MDB2_OK on success, a MDB2 error on failure |
| seek($rownum = 0) X-Ref |
| seek to a specific row in a result set param: int $rownum number of the row where the data can be found return: mixed MDB2_OK on success, a MDB2 error on failure |
| fetchRow($fetchmode = MDB2_FETCHMODE_DEFAULT, $rownum = null) X-Ref |
| Fetch and return a row of data param: int $fetchmode how the array data should be indexed param: int $rownum number of the row where the data can be found return: int data array on success, a MDB2 error on failure |
| fetchOne($colnum = 0) X-Ref |
| fetch single column from the first row from a result set param: int $colnum the column number to fetch return: string data on success, a MDB2 error on failure |
| fetchCol($colnum = 0) X-Ref |
| Fetch and return a column of data (it uses current for that) param: int $colnum the column number to fetch return: mixed data array on success, a MDB2 error on failure |
| fetchAll($fetchmode = MDB2_FETCHMODE_DEFAULT, $rekey = false,$force_array = false, $group = false) X-Ref |
| Fetch and return a column of data (it uses fetchRow for that) param: int $fetchmode the fetch mode to use: param: boolean $rekey if set to true, the $all will have the first param: boolean $force_array used only when the query returns exactly param: boolean $group if true, the values of the returned array is return: mixed data array on success, a MDB2 error on failure |
| rowCount() X-Ref |
| returns the actual row number that was last fetched (count from 0) return: integer |
| numRows() X-Ref |
| returns the number of rows in a result object return: mixed MDB2 Error Object or the number of rows |
| nextResult() X-Ref |
| Move the internal result pointer to the next available result param: a valid result resource return: true on success, false if there is no more result set or an error object on failure |
| getColumnNames() X-Ref |
| Retrieve the names of columns returned by the DBMS in a query result or from the cache. return: mixed associative array variable |
| _getColumnNames() X-Ref |
| Retrieve the names of columns returned by the DBMS in a query result. return: mixed associative array variable |
| numCols() X-Ref |
| Count the number of columns returned by the DBMS in a query result. return: mixed integer value with the number of columns, a MDB2 error |
| getResource() X-Ref |
| return the resource associated with the result object return: resource |
| bindColumn($column, &$value, $type = null) X-Ref |
| Set bind variable to a column. param: int $column param: mixed $value param: string $type specifies the type of the field return: mixed MDB2_OK on success, a MDB2 error on failure |
| _assignBindColumns($row) X-Ref |
| Bind a variable to a value in the result row. param: array $row return: mixed MDB2_OK on success, a MDB2 error on failure |
| free() X-Ref |
| Free the internal resources associated with result. return: boolean true on success, false if result is invalid |
Classe: MDB2_Statement_Common - X-Ref
| __construct(&$db, &$statement, $query, $types, $result_types, $is_manip = false, $limit = null, $offset = null) X-Ref |
| Constructor |
| MDB2_Statement_Common(&$db, &$statement, $query, $types, $result_types, $is_manip = false, $limit = null, $offset = null) X-Ref |
| Pas de description |
| bindParam($parameter, &$value, $type = null) X-Ref |
| Set the value of a parameter of a prepared query. param: int $parameter the order number of the parameter in the query param: mixed $value value that is meant to be assigned to specified param: string $type specifies the type of the field return: mixed MDB2_OK on success, a MDB2 error on failure |
| bindParamArray(&$values, $types = null) X-Ref |
| Set the values of multiple a parameter of a prepared query in bulk. param: array $values array thats specifies all necessary infromation param: array $types specifies the types of the fields return: mixed MDB2_OK on success, a MDB2 error on failure |
| execute($values = null, $result_class = true, $result_wrap_class = false) X-Ref |
| Execute a prepared query statement. param: array $values array thats specifies all necessary infromation param: mixed $result_class string which specifies which result class to use param: mixed $result_wrap_class string which specifies which class to wrap results in return: mixed a result handle or MDB2_OK on success, a MDB2 error on failure |
| _execute($result_class = true, $result_wrap_class = false) X-Ref |
| Execute a prepared query statement helper method. param: mixed $result_class string which specifies which result class to use param: mixed $result_wrap_class string which specifies which class to wrap results in return: mixed a result handle or MDB2_OK on success, a MDB2 error on failure |
| free() X-Ref |
| Release resources allocated for the specified prepared query. return: mixed MDB2_OK on success, a MDB2 error on failure |
Classe: MDB2_Module_Common - X-Ref
| __construct($db_index) X-Ref |
| Constructor |
| MDB2_Module_Common($db_index) X-Ref |
| Pas de description |
| getDBInstance() X-Ref |
| get the instance of MDB2 associated with the module instance return: object MDB2 instance or a MDB2 error on failure |
| MDB2_closeOpenTransactions() X-Ref |
| close any open transactions form persistant connections return: void |
| MDB2_defaultDebugOutput(&$db, $scope, $message) X-Ref |
| default debug output handler param: object $db reference to an MDB2 database object param: string $message message that should be appended to the debug return: string the corresponding error message, of false |
| Généré le : Wed Nov 21 13:08:55 2007 | par Balluche grâce à PHPXref 0.7 |
|