ultimix
package_manager_1_0_0 Class Reference

Public Member Functions

 __construct ()
 install_package ($Options)
 delete_package ($Options)
 controller ($Options)
 compile_package_tree_branch ($Branch, $Package)
 show_package_tree_rec ($Packages)
 show_package_tree ($Options)
 show_system_tree_meta_rec ($MetaFiles)
 show_system_tree_conf_rec ($ConfigFiles)
 compile_system_tree_branch ($Branch, $Package)
 show_system_tree_rec ($Packages)
 show_system_tree ($Options)
 view ($Options)

Data Fields

 $Output = false
 $CachedMultyFS = false

Detailed Description

This manager helps to manage packages.

Author
Dodonov A.A.

Definition at line 26 of file package_manager.php.

Constructor & Destructor Documentation

__construct ( )

Constructor.

Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 66 of file package_manager.php.

{
try
{
$this->CachedMultyFS = get_package( 'cached_multy_fs' , 'last' , __FILE__ );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

Member Function Documentation

compile_package_tree_branch (   $Branch,
  $Package 
)

Function compiles branch.

Parameters
$Branch- Branch code.
$Package- Package.
Returns
HTML code of the tree branch.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 214 of file package_manager.php.

{
try
{
$Title = $Package[ 'package_name' ].'.'.$Package[ 'package_version' ];
$Branch .= $this->CachedMultyFS->get_template( __FILE__ , 'package_item_start.tpl' );
$Branch = str_replace( '{title}' , $Title , $Branch );
$Branch .= $this->show_package_tree_rec( $Package[ 'subpackages' ] );
$Branch .= $this->CachedMultyFS->get_template( __FILE__ , 'package_item_end.tpl' );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
compile_system_tree_branch (   $Branch,
  $Package 
)

Function compiles branch.

Parameters
$Branch- Branch code.
$Package- Package.
Returns
HTML code of the tree branch.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 446 of file package_manager.php.

{
try
{
$Title = $Package[ 'package_name' ].'.'.$Package[ 'package_version' ];
$Branch .= $this->CachedMultyFS->get_template( __FILE__ , 'package_system_item_start.tpl' );
$Branch = str_replace( '{title}' , $Title , $Branch );
$Branch .= $this->show_system_tree_rec( $Package[ 'subpackages' ] );
$Branch .= $this->show_system_tree_meta_rec( $Package[ 'meta' ] );
$Branch .= $this->show_system_tree_conf_rec( $Package[ 'conf' ] );
$Branch .= $this->CachedMultyFS->get_template( __FILE__ , 'package_system_item_end.tpl' );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
controller (   $Options)

Controller of the component.

Parameters
$Options- Settings.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 168 of file package_manager.php.

{
try
{
$ContextSet = get_package( 'gui::context_set' , 'last' , __FILE__ );
$ContextSet->add_context( dirname( __FILE__ ).'/conf/cfcx_delete_package' );
$ContextSet->add_context( dirname( __FILE__ ).'/conf/cfcx_install_package' );
if( $ContextSet->execute( $Options , $this , __FILE__ ) )
{
return;
}
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
delete_package (   $Options)

Function deletes package.

Parameters
$Options- Settings.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 131 of file package_manager.php.

{
try
{
$Security = get_package( 'security' , 'last' , __FILE__ );
$PackageName = $Security->get_gp( 'package_name' , 'string' );
$PackageVersion = $Security->get_gp( 'package_version' , 'string' );
$ROOT_DIR = _get_root_dir( $PackageName , $PackageVersion , INSTALL_DIR );
$PackageDirectory = _get_package_path( $PackageName , $PackageVersion , $ROOT_DIR );
_delete_package( $PackageName , $PackageVersion );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
install_package (   $Options)

Function installs package.

Parameters
$Options- Settings.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 96 of file package_manager.php.

{
try
{
$Security = get_package( 'security' , 'last' , __FILE__ );
$PackageAlgoritms = get_package( 'core::package_algorithms' , 'last' , __FILE__ );
$MasterPackage = explode( '#' , $Security->get_gp( 'package_selection' , 'string' ) );
$PackageAlgoritms->install_package(
$UploadFileAccess->UploadedFilePath , $MasterPackage[ 0 ] , $MasterPackage[ 1 ]
);
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
show_package_tree (   $Options)

Function draws component.

Parameters
$Options- Settings.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 298 of file package_manager.php.

{
try
{
$PackageAlgorithms = get_package( 'core::package_algorithms' , 'last' , __FILE__ );
$Packages = $PackageAlgorithms->get_packages_tree();
$this->Output = $this->CachedMultyFS->get_template( __FILE__ , 'package_start.tpl' );
foreach( $Packages as $i => $Package )
{
$this->Output = $this->compile_package_tree_branch( $this->Output , $Package );
}
$this->Output .= $this->CachedMultyFS->get_template( __FILE__ , 'package_end.tpl' );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
show_package_tree_rec (   $Packages)

Function draws component.

Parameters
$Packages- Packages.
Returns
HTML code of the tree branch.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 256 of file package_manager.php.

{
try
{
if( isset( $Packages[ 0 ] ) == false )
{
return( '' );
}
$Branch = $this->CachedMultyFS->get_template( __FILE__ , 'package_branch_start.tpl' );
foreach( $Packages as $i => $Package )
{
$Branch = $this->compile_package_tree_branch( $Branch , $Package );
}
return( $Branch.$this->CachedMultyFS->get_template( __FILE__ , 'package_branch_end.tpl' ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
show_system_tree (   $Options)

Function draws component.

Parameters
$Options- Settings.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 534 of file package_manager.php.

{
try
{
$PackageAlgorithms = get_package( 'core::package_algorithms' , 'last' , __FILE__ );
$Packages = $PackageAlgorithms->get_packages_tree();
$this->Output = $this->CachedMultyFS->get_template( __FILE__ , 'system_start.tpl' );
foreach( $Packages as $i => $Package )
{
$this->Output = $this->compile_system_tree_branch( $this->Output , $Package );
}
$this->Output .= $this->CachedMultyFS->get_template( __FILE__ , 'system_end.tpl' );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
show_system_tree_conf_rec (   $ConfigFiles)

Function draws config files.

Parameters
$MetaFiles- Config files.
Returns
HTML code of the tree branch.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 392 of file package_manager.php.

{
try
{
if( isset( $ConfigFiles[ 0 ] ) == false )
{
return( '' );
}
$Branch = $this->CachedMultyFS->get_template( __FILE__ , 'package_conf_start.tpl' );
foreach( $ConfigFiles as $i => $File )
{
$Title = basename( $File );
$Branch .= $this->CachedMultyFS->get_template( __FILE__ , 'package_conf_item.tpl' );
$Branch = str_replace( '{title}' , $Title , $Branch );
}
return( $Branch.$this->CachedMultyFS->get_template( __FILE__ , 'package_conf_end.tpl' ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
show_system_tree_meta_rec (   $MetaFiles)

Function draws meta files.

Parameters
$MetaFiles- Meta-files.
Returns
HTML code of the tree branch.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 342 of file package_manager.php.

{
try
{
if( isset( $MetaFiles[ 0 ] ) == false )
{
return( '' );
}
$Branch = $this->CachedMultyFS->get_template( __FILE__ , 'package_meta_start.tpl' );
foreach( $MetaFiles as $i => $File )
{
$Title = basename( $File );
$Branch .= $this->CachedMultyFS->get_template( __FILE__ , 'package_meta_item.tpl' );
$Branch = str_replace( '{title}' , $Title , $Branch );
}
return( $Branch.$this->CachedMultyFS->get_template( __FILE__ , 'package_meta_end.tpl' ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
show_system_tree_rec (   $Packages)

Function draws component.

Parameters
$Packages- Packages.
Returns
HTML code of the tree branch.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 492 of file package_manager.php.

{
try
{
if( isset( $Packages[ 0 ] ) == false )
{
return( '' );
}
$Branch = $this->CachedMultyFS->get_template( __FILE__ , 'package_system_start.tpl' );
foreach( $Packages as $i => $Package )
{
$Branch = $this->compile_system_tree_branch( $Branch , $Package );
}
return( $Branch.$this->CachedMultyFS->get_template( __FILE__ , 'package_system_end.tpl' ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
view (   $Options)

Function draws component.

Parameters
$Options- Settings.
Returns
HTML code of the компонента.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 578 of file package_manager.php.

{
try
{
$ContextSet = get_package( 'gui::context_set' , 'last' , __FILE__ );
$ContextSet->add_context( dirname( __FILE__ ).'/conf/cfcx_show_package_tree' );
$ContextSet->add_context( dirname( __FILE__ ).'/conf/cfcx_show_system_tree' );
if( $ContextSet->execute( $Options , $this , __FILE__ ) )
{
return( $this->Output );
}
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

Field Documentation

$CachedMultyFS = false

Cached objects.

Author
Dodonov A.A.

Definition at line 50 of file package_manager.php.

$Output = false

View output.

Author
Dodonov A.A.

Definition at line 38 of file package_manager.php.


The documentation for this class was generated from the following file: