43 $this->CacheSwitch = $Settings->get_package_setting(
44 'cache' ,
'last' ,
'cf_cache' ,
'cache_switch' ,
'off'
46 $Settings->set_package_setting(
'cache' ,
'last' ,
'cf_cache' ,
'cache_switch' ,
'on' );
48 $Cache =
get_package(
'cache' ,
'last' , __FILE__ );
66 $Settings->set_package_setting(
'cache' ,
'last' ,
'cf_cache' ,
'cache_switch' , $this->CacheSwitch );
85 $CachedFS->Cache->delete_data(
'./packages/index.html' );
87 if( $CachedFS->file_exists(
'./packages/index.html' ) ===
true &&
88 $CachedFS->Cache->data_exists(
'./packages/index.html' ) === false )
90 return(
'TEST PASSED' );
111 $CachedFS->file_exists(
'./unexisting' );
113 if( $CachedFS->Cache->data_exists(
'./unexisting' ) ===
true &&
114 $CachedFS->Cache->get_data(
'./unexisting' ) ==
'_file_was_not_found' )
116 return(
'TEST PASSED' );
137 $CachedFS->file_exists(
'./packages/index.html' );
139 $DataExists = $CachedFS->Cache->data_exists(
'./packages/index.html' );
140 $Data = $CachedFS->Cache->get_data(
'./packages/index.html' );
142 if( $DataExists ===
false && $Data ===
false )
144 return(
'TEST PASSED' );
148 return(
'ERROR : Data exists : '.( $DataExists ? 1 : 0 ).
' Data : '.htmlspecialchars( $Data ) );
165 $CachedFS->Cache->delete_data(
'./packages/index.html' );
166 $Result = $CachedFS->file_get_contents(
'./packages/index.html' );
168 if( $Result ==
'<html><head></head><body></body></html>' )
170 return(
'TEST PASSED' );
192 $CachedFS->file_get_contents(
'./packages/index.html' );
194 file_put_contents(
'./packages/index.html' ,
'' );
196 $Result = $CachedFS->file_get_contents(
'./packages/index.html' );
198 file_put_contents(
'./packages/index.html' ,
'<html><head></head><body></body></html>' );
200 if( $Result ==
'<html><head></head><body></body></html>' )
202 return(
'TEST PASSED' );
206 return(
'ERROR : Content : '.htmlspecialchars( $Result ) );
225 $CachedFS->Cache->delete_data(
'./unexisting' );
226 $CachedFS->file_get_contents(
'./unexisting' );
230 catch( Exception $e )
232 return(
'TEST PASSED' );
250 $CachedFS->file_put_contents(
'./exception.log' ,
'' );
253 if( $CachedFS->file_exists(
'./exception.log' ) === false )
259 $CachedFS->Cache->delete_data(
'./packages/index.html' );
260 if( $CachedFS->file_exists(
'./exception.log' ) === false )
265 return(
'TEST PASSED' );