71 $this->SettingsUtilities =
get_package(
'settings::settings_utilities' ,
'last' , __FILE__ );
105 $this->SettingsList = array();
108 catch( Exception $e )
136 if( isset( $this->SettingsList[ $Name ] ) ===
false )
142 foreach( $this->SettingsList as $Key => $Value )
146 $New[ $Key ] = $Value;
149 $this->SettingsList = $New;
151 catch( Exception $e )
183 if( $Settings ===
false || $Settings ===
'' || $Settings === null )
188 if( is_array( $Settings ) ===
false )
190 $Settings = $this->SettingsUtilities->transform_settings( $Settings , $Separator );
193 $this->SettingsList = array_merge(
194 $this->SettingsList , $this->SettingsUtilities->load_settings( $Settings )
197 catch( Exception $e )
221 $this->SettingsList = array_merge( $_POST , $_GET );
223 catch( Exception $e )
251 return( $this->SettingsList );
253 catch( Exception $e )
281 $this->SettingsList = array_merge( $this->SettingsList , $Settings->SettingsList );
283 catch( Exception $e )
311 $this->SettingsList = $Settings;
313 catch( Exception $e )
341 $this->SettingsList = array_merge( $this->SettingsList , $Settings );
343 catch( Exception $e )
373 foreach( $this->SettingsList as $Key => $Value )
375 $Str [] =
"$Key=$Value";
378 $Str = implode(
';' , $Str );
382 catch( Exception $e )
406 private function get_config( $FilePath )
410 if( $this->CachedMultyFS ===
false )
412 $this->CachedMultyFS =
get_package(
'cached_multy_fs' ,
'last' , __FILE__ );
415 return( $this->CachedMultyFS->file_get_contents( $FilePath ) );
417 catch( Exception $e )
449 $this->
load_settings( $this->get_config( $FilePath ) , $Separator );
451 catch( Exception $e )
485 catch( Exception $e )
523 $this->
load_file( $PackageDirectory.
"/conf/$FileName" );
525 catch( Exception $e )
553 function define( $Name , $DefaultValue =
'_throw_exception' )
557 DEFINE( $Name , $this->
get_setting( $Name , $DefaultValue ) );
559 catch( Exception $e )
595 if( $this->SettingsList !==
false && isset( $this->SettingsList[ $Name ] ) )
600 if( $ThrowException )
602 throw(
new Exception(
"Setting \"$Name\" does not exist" ) );
607 catch( Exception $e )
639 function get_setting( $Name , $DefaultValue =
'_throw_exception' )
643 if( $this->SettingsList !==
false && isset( $this->SettingsList[ $Name ] ) )
645 return( $this->SettingsList[ $Name ] );
647 if( $DefaultValue ===
'_throw_exception' )
649 throw(
new Exception(
'Setting "'.$Name.
'" was not found' ) );
652 return( $DefaultValue );
654 catch( Exception $e )
690 $DefaultValues = explode(
',' , $DefaultValues );
692 $c1 = count( $DefaultValues );
693 $c2 = count( $SettingsNames );
697 for( $i = 0 ; $i < $c2 - $c1 ; $i++ )
699 $DefaultValues [] =
'_throw_exception';
703 return( $DefaultValues );
705 catch( Exception $e )
737 function get_settings( $SettingsNames , $DefaultValues =
'_throw_exception' )
742 $SettingsNames = explode(
',' , $SettingsNames );
746 foreach( $SettingsNames as $i => $Name )
748 $Values [] = $this->
get_setting( $Name , $DefaultValues[ $i ] );
753 catch( Exception $e )
785 if( $this->SettingsList !==
false )
787 $this->SettingsList[ $Name ] = $Value;
790 catch( Exception $e )
822 if( $this->SettingsList !==
false && isset( $this->SettingsList[ $Name ] ) ===
false )
824 $this->SettingsList[ $Name ] = $Value;
827 catch( Exception $e )
853 $this->SettingsList = array();
855 catch( Exception $e )
885 catch( Exception $e )
913 return( serialize( $this->SettingsList ) );
915 catch( Exception $e )