82 $this->CachedMultyFS =
get_package(
'cached_multy_fs' ,
'last' , __FILE__ );
112 $this->Config = $this->CachedMultyFS->file_get_contents(
$ConfigPath );
114 $this->Config = str_replace(
"\r" ,
"\n" , $this->Config );
115 $this->Config = str_replace(
"\n\n" ,
"\n" , $this->Config );
116 $this->Config = explode(
"\n" , $this->Config );
120 catch( Exception $e )
154 $Content = $ConfigLine.
"\r\n";
156 foreach( $this->Config as $j => $ConfigLine2 )
158 if( $i != $j && $ConfigLine2 !=
'' )
160 $Content .= $ConfigLine2.
"\r\n";
163 $this->Config = $this->CachedMultyFS->file_put_contents( $this->ConfigPath , $Content );
166 catch( Exception $e )
206 if( $ConfigLine !=
'' )
208 $DBAdapter->connect( $ConfigLine );
212 return( $DBAdapter->get_connection() );
217 catch( Exception $e )
245 if( $this->Config ==
false )
247 throw(
new Exception(
'Config was not loaded' ) );
250 foreach( $this->Config as $i => $ConfigLine )
254 if( $Connection !==
false )
256 return( $Connection );
260 throw(
new Exception(
"Unable to connect to the database" ) );
262 catch( Exception $e )