Detailed Description
Working with settings.
- Author
- Dodonov A.A.
Definition at line 26 of file settings_utilities.php.
Member Function Documentation
| load_settings |
( |
|
$Settings | ) |
|
Function loads settings.
- Parameters
-
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 86 of file settings_utilities.php.
{
try
{
$SettingsList = array();
foreach( $Settings as $s )
{
$Tmp = explode( '=' , $s );
if( isset( $Tmp[ 1 ] ) === true )
{
$SettingsList[ $Tmp[ 0 ] ] = $Tmp[ 1 ];
}
elseif( isset( $Tmp[ 0 ] ) === true && isset( $Tmp[ 1 ] ) === false )
{
$SettingsList[ $Tmp[ 0 ] ] = true;
}
elseif( isset( $Tmp[ 0 ] ) === false )
{
$Settings = serialize( $Settings );
$s = serialize( $s );
$Tmp = serialize( $Tmp );
throw_exception(
"Settings : $Settings s : $s Tmp : $Tmp Illegal settings string" );
}
}
return( $SettingsList );
}
catch( Exception $e )
{
}
}
| transform_settings |
( |
|
$Settings, |
|
|
|
$Separator |
|
) |
| |
Function transforms settings string.
- Parameters
-
| $Settings | - Settings. |
| $Separator | - Separator. |
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 50 of file settings_utilities.php.
{
try
{
$Settings = str_replace(
array( "\r" , "\n" , $Separator.$Separator ) ,
array( $Separator , $Separator , $Separator ) ,
$Settings
);
return( explode( $Separator , $Settings ) );
}
catch( Exception $e )
{
}
}
The documentation for this class was generated from the following file: