modxbot / migrate

A testground for migrating issues and other such fun
0 stars 0 forks source link

cacheManager returns 1 if cache file exists but is totally empty #10246

Open bertoost opened 10 years ago

bertoost commented 10 years ago

bertoost created Redmine issue ID 10246

I always do;

$output = $modx->cacheManager->get(....); if(empty($output) /.. and some other checks ../ ) { // get from db & set cache $output = $modx->getChunk(...); $modx->cacheManager->set(...); } return $output;

But somehow my cache file is totally empty. Even no <?php in it. In this case, the cache file exists but without contents, 0kb. Because the file exists cacheManager::get() is able to include it perfectly, which will make it return 1 (probably for TRUE) and then my $output from above get() method isn't empty.

The 1 appears on the website, and that should not be happening.

I guess the best is to check the filesize of a cache file too!

bertoost commented 10 years ago

bertoost submitted:

"even no < ? php" hehe