PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Caching » Cache_Lite » Bug #7732

Warning on cache reading/writing

Details

Submitted2006-05-26 12:13 UTC
Fromwebmaster at rdv69 dot com
StatusBogus
PackageCache_Lite
PHP Version4.4.2
OSLINUX / WINDOWS XP
Roadmaps(Not assigned)

Comments

[2006-05-26 12:13 UTC] webmaster at rdv69 dot com

Description:
------------
hi,

i have many warnings each time my script try to read cache :

26/05/2006 14:01:19 [warning] /usr/local/lib/php/Cache/Lite.php [754] : fopen(/tmp/cache_8/cache_86/cache_862/cache_c21f969b5f03d33d43e04f8f136e7682_7d92d087cf05a804f12aec5703b2800b): failed to open stream: No such file or directory

I don't understand because the cache file exists, i have checked !

Another one :

26/05/2006 14:01:19 [warning] /usr/local/lib/php/Cache/Lite.php [771] : mkdir(/tmp/cache_8/cache_86/): File exists

IMPORTANT : this seems to appear the first time the script is called (=cache not yet created)
The second time (when cache created), warnings don't appear.

Test script:
---------------
<?
require_once "Cache/Lite.php";
require_once "Cache/Lite/Output.php";
require_once "Log.php";

function errorHandler($code, $message, $file, $line)
{
global $logger;

/* Map the PHP error to a Log priority. */
switch ($code)
{
case E_WARNING:
case E_USER_WARNING:
$priority = PEAR_LOG_WARNING;
break;
case E_NOTICE:
case E_USER_NOTICE:
$priority = PEAR_LOG_NOTICE;
break;
case E_ERROR:
case E_USER_ERROR:
$priority = PEAR_LOG_ERR;
break;
default:
$priotity = PEAR_LOG_INFO;
}

$logger->log($file." [".$line."] : ".$message, $priority);
}

error_reporting(E_ALL);
ini_set("display_errors", "on");

$conf = array( "error_prepend" => '<font color="#ff0000"><tt>',
"error_append" => '</tt></font>');

$logger=&Log::singleton("display", "", "", $conf, PEAR_LOG_DEBUG);

set_error_handler("errorHandler");

$options=array(
"cacheDir" => "/tmp/",
"caching" => true,
"lifeTime" => 3600, /* secondes */
"fileLocking" => true,
"writeControl" => true,
"readControl" => false,
"readControlType" => "crc32",
"pearErrorMode" => CACHE_LITE_ERROR_DIE,
"fileNameProtection" => true,
"automaticSerialization" => true,
"memoryCaching" => false,
"onlyMemoryCaching" => false,
"memoryCachingLimit" => 1000,
"automaticCleaningFactor" => 50,
"hashedDirectoryLevel" => 3
);

$cache=new Cache_Lite($options);
$cache_page=new Cache_Lite_Output($options);

$id_page=md5("mypage");

if (!($cache_page->start($id_page)))
{
$cache_page->end();
}

?>

Expected result:
----------------
nothing , no warnings

Actual result:
--------------
Warning: /usr/local/lib/php/Cache/Lite.php [754] : fopen(/tmp/cache_7/cache_77/cache_775/cache_c21f969b5f03d33d43e04f8f136e7682_9bd47224986bedddcd3a2eef4e970884): failed to open stream: No such file or directory
Warning: /usr/local/lib/php/Cache/Lite.php [771] : mkdir(/tmp/cache_7/): File exists

[2006-05-28 12:03 UTC] fab at php dot net

Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. Because of this, we hope you add your comments
to the existing bug instead.

Thank you for your interest in PEAR.

see bug #7598