ultimix
package_settings_1_0_0 Class Reference

Public Member Functions

 __construct ()
 get_package_setting ($PackageName, $PackageVersion, $FileName, $SettingName, $DefaultValue= '_throw_exception')
 set_package_setting ($PackageName, $PackageVersion, $FileName, $SettingName, $Value)

Data Fields

 $CachedMultyFS = false

Detailed Description

Working with settings.

Author
Dodonov A.A.

Definition at line 26 of file package_settings.php.

Constructor & Destructor Documentation

__construct ( )

Constructor.

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

Definition at line 54 of file package_settings.php.

{
try
{
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

Member Function Documentation

get_package_setting (   $PackageName,
  $PackageVersion,
  $FileName,
  $SettingName,
  $DefaultValue = '_throw_exception' 
)

Function loads setting for package.

Parameters
$PackageName- Package's name.
$PackageVersion- Package's version.
$FileName- File's name from directory 'conf' for the specified package.
$SettingName- Setting title.
$DefaultValue- Default value for undefined setting.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 99 of file package_settings.php.

{
try
{
$S = get_package_object( 'settings::settings' , 'last' , __FILE__ );
$S->load_package_settings( $PackageName , $PackageVersion , $FileName );
return( $S->get_setting( $SettingName , $DefaultValue ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
set_package_setting (   $PackageName,
  $PackageVersion,
  $FileName,
  $SettingName,
  $Value 
)

Function loads setting for package.

Parameters
$PackageName- Package's name.
$PackageVersion- Package's version.
$FileName- File's name from directory 'conf' for the specified package.
$SettingName- Setting title.
$Value- Value for setting.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 150 of file package_settings.php.

{
try
{
$S = get_package_object( 'settings::settings' , 'last' , __FILE__ );
$S->load_package_settings( $PackageName , $PackageVersion , $FileName );
$S->set_setting( $SettingName , $Value );
$PackagePath = _get_package_path_ex( $PackageName , $PackageVersion );
if( $this->CachedMultyFS === false )
{
$this->CachedMultyFS = get_package( 'cached_multy_fs' , 'last' , __FILE__ );
}
$this->CachedMultyFS->file_put_contents( "$PackagePath/conf/$FileName" , $S->get_all_settings() );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

Field Documentation

$CachedMultyFS = false

Cache.

Author
Dodonov A.A.

Definition at line 38 of file package_settings.php.


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