Packageindex Classtrees Modulegroups Elementlist Report XML Files

File: /home/schmitt/local-cvs/midgard-current/workflow/fordoc/MgdDB.php
DataWorkFlow + DataflowVC -

MgdDB

MgdDB

Represents a Midgard DB.

 

private class MgdDB

Represents a Midgard DB.
Can import and export objects via repligard and check their dependencies (uses a repligard config file for configuration)

 

Public Method Summary

void

MgdDB(mixed &$dbh, array &$dbconf, array &$fsconf)

Construct a MgdDB

Private Method Summary

void

_init_xml_handler(mixed $parser, string $tag, array $attrs)

To be called only from the XML parser. Uses the tag and attribute information to fill $_lup and $_ldown with links
array

computeDepsUp(string $guid)

Returns a list of objects that this object depends on but do not belong to it.
array

computeDepsDown(string $guid)

Returns a list of objects that depend on / belong to this object.
array

computeDepsDownReverse(string $guid)

Returns a list of objects that this object belongs to.
array

getAll()

Returns a list of all objects in the DB.
string

getAuthor(string $guid)

Get the author of an object by guid
array

&getNewByAuthor()

Returns a list of all the new / changed / deleted objects in the DB that have not yet been marked as committed, grouped by author.
array

&getNew()

Returns a list of all the new / changed / deleted objects in the DB that have not yet been marked as committed.
object [unknown]

&export(mixed $guids, integer $fpath)

Exports objects to a repligard archive.
array

import(object [unknown] &$archive)

Imports objects from a repligard archive.
array

importAsNew(object [unknown] $archive)

Imports objects from a repligard archive and marks them as uncommitted.
array

importKeepDeleted(object [unknown] &$archive)

Imports objects from a repligard archive, keeping information about deleted objects in the repligard table
string

get_path_by_guid(string $guid)

Get the path that matches the guid
string

get_guid_by_path(string $path)

Get the guid that matches the path
bool

is_owner_by_path(string $path)

Get the owner of the object, by path (can be helpful if the object is no longer present)
void

setExported([ integer $guid ])

Marks this object as exported, or all objects if not specified
bool

isNew(string $guid)

Checks if object is newly created / updated / deleted
void

exists_obj( $guid)

Warning: documentation is missing.

Private Field Summary

unknown

$_dbh

unknown

$_dbconf

unknown

$_fsconf

unknown

$_lup

unknown

$_ldown

unknown

$_xmlcontext

Public Method Details

MgdDB

public void MgdDB( mixed &$dbh, array &$dbconf, array &$fsconf )

  Construct a MgdDB

Parameter
mixed &$dbh
connection to the Midgard DB
array &$dbconf
db configuration
array &$fsconf
filesystem configuration
Returns void


Private Method Details

_init_xml_handler

private void _init_xml_handler( mixed $parser, string $tag, array $attrs )

  To be called only from the XML parser. Uses the tag and attribute information to fill $_lup and $_ldown with links

Parameter
mixed $parser
the xml parser
string $tag
the name of the current tag
array $attrs
[] attribute names => values
Returns void


computeDepsUp

private array computeDepsUp( string $guid )

  Returns a list of objects that this object depends on but do not belong to it.

Parameter
string $guid
the guid of the object
Returns array $guids

the guids of its dependencies


computeDepsDown

private array computeDepsDown( string $guid )

  Returns a list of objects that depend on / belong to this object.

Parameter
string $guid
the guid of the object
Returns array $guids

keys: the guids of the objects that depend on it => values: the language ids of the objects (0 if undefined)


computeDepsDownReverse

private array computeDepsDownReverse( string $guid )

  Returns a list of objects that this object belongs to.
(Should improve the naming)

Parameter
string $guid
Returns array $guids


getAll

private array getAll( )

  Returns a list of all objects in the DB.

Returns array $guids

guids of all objects


getAuthor

private string getAuthor( string $guid )

  Get the author of an object by guid

Parameter
string $guid
Returns string $guid


&getNewByAuthor

private array &getNewByAuthor( )

  Returns a list of all the new / changed / deleted objects in the DB that have not yet been marked as committed, grouped by author.

Returns array $authorguids

author => array $guids


&getNew

private array &getNew( )

  Returns a list of all the new / changed / deleted objects in the DB that have not yet been marked as committed.

Returns array $guids

guids of all changed objects


&export

private object [unknown] &export( mixed $guids, integer $fpath )

  Exports objects to a repligard archive.

Parameter
mixed $guids
the objects to export. can be array of guids or string "ALL"
integer $fpath
Warning: documentation is missing.
Returns object [unknown] $archive

the resulting archive


import

private array import( object [unknown] &$archive )

  Imports objects from a repligard archive.

Parameter
object [unknown] &$archive
the archive to import
Returns array $guids

the guids of the imported objects


importAsNew

private array importAsNew( object [unknown] $archive )

  Imports objects from a repligard archive and marks them as uncommitted.

Parameter
object [unknown] $archive
the archive to import
Returns array $guids

the guids of the imported objects


importKeepDeleted

private array importKeepDeleted( object [unknown] &$archive )

  Imports objects from a repligard archive, keeping information about deleted objects in the repligard table

Parameter
object [unknown] &$archive
the archive to import
Returns array $guids

the guids of the imported objects


get_path_by_guid

private string get_path_by_guid( string $guid )

  Get the path that matches the guid
Requires midgard functions and operates on the DB you are connected to

Parameter
string $guid
Returns string $path


get_guid_by_path

private string get_guid_by_path( string $path )

  Get the guid that matches the path
Requires midgard functions and operates on the DB you are connected to

Parameter
string $path
Returns string $guid


is_owner_by_path

private bool is_owner_by_path( string $path )

  Get the owner of the object, by path (can be helpful if the object is no longer present)
Requires midgard functions and operates on the DB you are connected to

Parameter
string $path
Returns bool $isOwner


setExported

private void setExported( [ integer $guid ] )

  Marks this object as exported, or all objects if not specified

Parameter
integer $guid = >>0<<
(optional)
Returns void


isNew

private bool isNew( string $guid )

  Checks if object is newly created / updated / deleted

Parameter
string $guid
Returns bool $isNew


exists_obj

private void exists_obj( $guid )

 

Warning: documentation is missing.

Parameter
$guid
Warning: documentation is missing.
Returns void


Private Field Details

$_dbh

private unknown $_dbh

>><<



$_dbconf

private unknown $_dbconf

>><<



$_fsconf

private unknown $_fsconf

>><<



$_lup

private unknown $_lup

>><<



$_ldown

private unknown $_ldown

>><<



$_xmlcontext

private unknown $_xmlcontext

>><<




Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta