40 if( $ConfigRow ==
'1' )
46 throw(
new Exception(
'Connection failed' ) );
81 if( filemtime( dirname( __FILE__ ).
'/cf_config' ) != $MTime )
83 return(
'ERROR: file was changed' );
87 return(
'TEST PASSED' );
90 unlink( dirname( __FILE__ ).
'/cf_config' );
107 $CachedMultyFS =
get_package(
'cached_multy_fs' ,
'last' , __FILE__ );
108 $CachedMultyFS->file_put_contents( dirname( __FILE__ ).
'/cf_config' ,
"1\r\n2" );
110 $MTime = filemtime( dirname( __FILE__ ).
'/cf_config' );
112 $DBConfigSet =
get_package(
'database::db_config_set' ,
'last' , __FILE__ );
113 $DBConfigSet->load_config( dirname( __FILE__ ).
'/cf_config' );
115 $Connection = $DBConfigSet->connect( $this );
119 catch( Exception $e )
121 unlink( dirname( __FILE__ ).
'/cf_config' );
122 return(
'ERROR: exception was thrown' );
140 $CachedMultyFS =
get_package(
'cached_multy_fs' ,
'last' , __FILE__ );
141 $Content = $CachedMultyFS->file_get_contents( dirname( __FILE__ ).
'/cf_config' );
142 if( $Content !=
"1\r\n2\r\n" )
144 unlink( dirname( __FILE__ ).
'/cf_config' );
145 return(
"ERROR: illegal config content : $Content" );
150 unlink( dirname( __FILE__ ).
'/cf_config' );
151 return(
'TEST PASSED' );
154 catch( Exception $e )
156 unlink( dirname( __FILE__ ).
'/cf_config' );
157 return(
'ERROR: exception was thrown' );
175 $CachedMultyFS =
get_package(
'cached_multy_fs' ,
'last' , __FILE__ );
176 $CachedMultyFS->file_put_contents( dirname( __FILE__ ).
'/cf_config' ,
"2\r\n1" );
178 $DBConfigSet =
get_package(
'database::db_config_set' ,
'last' , __FILE__ );
180 $DBConfigSet->load_config( dirname( __FILE__ ).
'/cf_config' );
182 $Connection = $DBConfigSet->connect( $this );
186 catch( Exception $e )
188 unlink( dirname( __FILE__ ).
'/cf_config' );
189 return(
'ERROR: exception was thrown' );
205 $Path = dirname( __FILE__ );
208 $CachedMultyFS =
get_package(
'cached_multy_fs' ,
'last' , __FILE__ );
209 $CachedMultyFS->file_put_contents( $Path.
'/cf_config' ,
"2\r\n3" );
211 $DBConfigSet =
get_package(
'database::db_config_set' ,
'last' , __FILE__ );
213 $DBConfigSet->load_config( $Path.
'/cf_config' );
215 $Connection = $DBConfigSet->connect( $this );
217 unlink( $Path.
'/cf_config' );
218 return(
'ERROR: exception must be thrown' );
220 catch( Exception $e )
222 if( $CachedMultyFS->file_get_contents( $Path.
'/cf_config' ) !=
"2\r\n3" )
224 unlink( $Path.
'/cf_config' );
225 return(
'ERROR: illegal config content' );
227 unlink( $Path.
'/cf_config' );
228 return(
'TEST PASSED' );