[ Index ]
 

Code source de PHP PEAR 1.4.5

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/MDB/ -> Manager.php (sommaire)

(pas de description)

Poids: 2148 lignes (105 kb)
Inclus ou requis:0 fois
Référencé: 1 fois
Nécessite: 1 fichier
 MDB/Parser.php

Définit 1 class

MDB_Manager:: (26 méthodes):
  raiseError()
  captureDebugOutput()
  debugOutput()
  resetWarnings()
  getWarnings()
  setOption()
  getOption()
  connect()
  disconnect()
  setDatabase()
  _createTable()
  _dropTable()
  _createSequence()
  _dropSequence()
  _createDatabase()
  _addDefinitionChange()
  _compareDefinitions()
  _alterDatabase()
  _escapeSpecialCharacters()
  _dumpSequence()
  parseDatabaseDefinitionFile()
  _debugDatabaseChanges()
  _dumpDatabaseContents()
  getDefinitionFromDatabase()
  dumpDatabase()
  updateDatabase()


Classe: MDB_Manager  - X-Ref

The database manager is a class that provides a set of database
management services like installing, altering and dumping the data
structures of databases.

raiseError($code = MDB_MANAGER_ERROR, $mode = NULL, $options = NULL,$userinfo = NULL, $nativecode = 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 $code integer error code, or a PEAR error object (all
param: int $mode error mode, see PEAR_Error docs
param: mixed $options If error mode is PEAR_ERROR_TRIGGER, this is the
param: string $userinfo Extra debug information.  Defaults to the last
param: mixed $nativecode Native error code, integer or string depending
return: object a PEAR error object

captureDebugOutput($capture)   X-Ref
set a debug handler

param: string $capture name of the function that should be used in

debugOutput()   X-Ref
output debug info

return: string content of the debug_output class variable

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

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 MDB_OK or MDB_Error

getOption($option)   X-Ref
returns the value of an option

param: string $option option name
return: mixed the option value or error object

connect(&$dbinfo, $options = FALSE)   X-Ref
Create a new MDB connection object and connect to the specified
database

param: mixed   $dbinfo   'data source name', see the MDB::parseDSN
param: mixed   $options  An associative array of option names and
return: mixed MDB_OK on success, or a MDB error object

disconnect()   X-Ref
Log out and disconnect from the database.


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

_createTable($table_name, $table, $overwrite = FALSE)   X-Ref
create a table and inititialize the table if data is available

param: string $table_name  name of the table to be created
param: array  $table       multi dimensional array that containts the
param: boolean $overwrite  determine if the table/index should be
return: mixed MDB_OK on success, or a MDB error object

_dropTable($table_name)   X-Ref
drop a table

param: string $table_name    name of the table to be dropped
return: mixed MDB_OK on success, or a MDB error object

_createSequence($sequence_name, $sequence, $created_on_table, $overwrite = FALSE)   X-Ref
create a sequence

param: string $sequence_name  name of the sequence to be created
param: array  $sequence       multi dimensional array that containts the
param: string $created_on_table
param: boolean $overwrite    determine if the sequence should be overwritten
return: mixed MDB_OK on success, or a MDB error object

_dropSequence($sequence_name)   X-Ref
drop a table

param: string $sequence_name    name of the sequence to be dropped
return: mixed MDB_OK on success, or a MDB error object

_createDatabase()   X-Ref
Create a database space within which may be created database objects
like tables, indexes and sequences. The implementation of this function
is highly DBMS specific and may require special permissions to run
successfully. Consult the documentation or the DBMS drivers that you
use to be aware of eventual configuration requirements.

return: mixed MDB_OK on success, or a MDB error object

_addDefinitionChange(&$changes, $definition, $item, $change)   X-Ref
add change to an array of multiple changes

param: array  &$changes
param: string $definition
param: string $item
param: array  $change
return: mixed MDB_OK on success, or a MDB error object

_compareDefinitions($previous_definition)   X-Ref
compare a previous definition with the currenlty parsed definition

param: array multi dimensional array that contains the previous definition
return: mixed array of changes on success, or a MDB error object

_alterDatabase($previous_definition, $changes)   X-Ref
Execute the necessary actions to implement the requested changes
in a database structure.

param: array $previous_definition an associative array that contains
param: array $changes an associative array that contains the definition of
return: mixed MDB_OK on success, or a MDB error object

_escapeSpecialCharacters($string)   X-Ref
add escapecharacters to all special characters in a string

param: string $string string that should be escaped
return: string escaped string

_dumpSequence($sequence_name, $eol, $dump = MDB_MANAGER_DUMP_ALL)   X-Ref
dump the structure of a sequence

param: string  $sequence_name
param: string  $eol
return: mixed string with xml seqeunce definition on success, or a MDB error object

parseDatabaseDefinitionFile($input_file, $variables, $fail_on_invalid_names = 1)   X-Ref
Parse a database definition file by creating a Metabase schema format
parser object and passing the file contents as parser input data stream.

param: string $input_file the path of the database schema file.
param: array $variables an associative array that the defines the text
param: bool $fail_on_invalid_names (optional) make function fail on invalid
return: mixed MDB_OK on success, or a MDB error object

_debugDatabaseChanges($changes)   X-Ref
Dump the changes between two database definitions.

param: array $changes an associative array that specifies the list
return: mixed MDB_OK on success, or a MDB error object

_dumpDatabaseContents($schema_file, $setup_arguments, $dump_arguments, $variables)   X-Ref
Parse a database schema definition file and dump the respective structure
and contents.

param: string $schema_file path of the database schema file.
param: mixed $setup_arguments an associative array that takes pairs of tag names and values
param: array $dump_arguments an associative array that takes pairs of tag names and values
param: array $variables an associative array that the defines the text string values
return: mixed MDB_OK on success, or a MDB error object

getDefinitionFromDatabase()   X-Ref
Attempt to reverse engineer a schema structure from an existing MDB
This method can be used if no xml schema file exists yet.
The resulting xml schema file may need some manual adjustments.

return: mixed MDB_OK or array with all ambiguities on success, or a MDB error object

dumpDatabase($arguments, $dump = MDB_MANAGER_DUMP_ALL)   X-Ref
Dump a previously parsed database structure in the Metabase schema
XML based format suitable for the Metabase parser. This function
may optionally dump the database definition with initialization
commands that specify the data that is currently present in the tables.

param: array $arguments an associative array that takes pairs of tag
param: integer $dump constant that determines what data to dump
return: mixed MDB_OK on success, or a MDB error object

updateDatabase($current_schema_file, $previous_schema_file = FALSE, $variables = array()   X-Ref
Compare the correspondent files of two versions of a database schema
definition: the previously installed and the one that defines the schema
that is meant to update the database.
If the specified previous definition file does not exist, this function
will create the database from the definition specified in the current
schema file.
If both files exist, the function assumes that the database was previously
installed based on the previous schema file and will update it by just
applying the changes.
If this function succeeds, the contents of the current schema file are
copied to replace the previous schema file contents. Any subsequent schema
changes should only be done on the file specified by the $current_schema_file
to let this function make a consistent evaluation of the exact changes that
need to be applied.

param: string $current_schema_file name of the updated database schema
param: string $previous_schema_file name the previously installed database
param: array $variables an associative array that is passed to the argument
return: mixed MDB_OK on success, or a MDB error object



Généré le : Sun Feb 25 14:08:00 2007 par Balluche grâce à PHPXref 0.7