LiveUser
[ class tree: LiveUser ] [ index: LiveUser ] [ all elements ]

Class: LiveUser_Misc_Schema_Install

Source Location: /LiveUser-0.16.14/sql/install.php

Class Overview


database schema installer class


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 2002-2006 Markus Wolff

Methods


Inherited Variables

Inherited Methods


Class Details

[line 212]
database schema installer class

This class generates XML based schema files and uses PEAR:MDB2_Schema to install them inside the users database

Requirements:

  • PEAR::LiveUser
  • PEAR::MDB2_Schema
  • PEAR::MDB2
  • PEAR::MDB2_Driver_* (where * is the name of the backend database)
  • a valid LiveUser configuration



[ Top ]


Method Detail

generateSchema   [line 255]

bool|PEAR_Error generateSchema( object LiveUser $obj, string $file, [array $lengths = array()], [array $defaults = array()])

Generates a schema file from the instance
  • Return: true on success or a PEAR_Error on error
  • Access: public

Parameters:

object LiveUser   $obj     storage instance
string   $file     name of the file into which the xml schema should be written
array   $lengths     key-value pairs with keys being field names and values being the default length
array   $defaults     key-value pairs with keys being field names and values being the default values

[ Top ]

installSchema   [line 374]

bool|PEAR_Error installSchema( object LiveUser $obj, string $file, [array $variables = array()], [bool $create = true], [ $options = array()], [bool $overwrite = false], [bool $disable_query = false], array MDB2_Schema::connect(), bool 7)

Install a schema file into the database
  • Return: true on success or a PEAR_Error on error
  • Access: public

Parameters:

array   MDB2_Schema::connect()     options
bool   7     determines if the disable_query option should be set in MDB2
object LiveUser   $obj     storage instance
string   $file     name of the file into which the xml schema should be written
array   $variables     key-value pairs with keys being variable names and values being the variable values
bool   $create     determines if the database should be created or not
bool   $overwrite     determines if the database should be created or not
bool   $disable_query     determines if the old schema file should be unlinked first
   $options     

[ Top ]

parsePDODSN   [line 226]

array parsePDODSN( string $pdo_dsn)

Accepts a PDO DSN and returns a PEAR DSN

The PEAR DSN format is specified here: http://pear.php.net/manual/en/package.database.db.intro-dsn.php

  • Return: PEAR DSN
  • Access: public

Parameters:

string   $pdo_dsn     PDO DSN

[ Top ]

writeSchema   [line 348]

bool|PEAR_Error writeSchema( array $definition, $file)

Takes a given definition array and writes it as xml to a file
  • Return: true on success or a PEAR_Error on error
  • Access: public

Parameters:

array   $definition     schema definition
   $file     

[ Top ]


Documentation generated on Fri, 15 Oct 2010 15:00:08 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.