Development

#2816 (sfFileCache creates warning message when creating directory)

You must first sign up to be able to contribute.

Ticket #2816 (closed defect: fixed)

Opened 1 year ago

Last modified 9 months ago

sfFileCache creates warning message when creating directory

Reported by: drmikecrowe Assigned to: fabien
Priority: minor Milestone: 1.0.14
Component: cache Version: 1.0.8
Keywords: Cc:
Qualification: Unreviewed

Description

Currently, sfFileCache.class.php -> setCacheDir() uses:

// create cache dir if needed if (!is_dir($cacheDir)) {

$current_umask = umask(0000); @mkdir($cacheDir, 0777, true); umask($current_umask);

}

The @mkdir() generates warning in php. The following corrects:

// create cache dir if needed if (!is_dir($cacheDir)) {

$current_umask = umask(0000); if ( $cacheDir && !is_dir($cacheDir) )

@mkdir($cacheDir, 0777, true);

umask($current_umask);

}

Change History

04/02/08 11:07:20 changed by a.alexandrov

The problem occures when trying to construct a new sfMessageCache.class.php class. In line 38 the sfFileCache.class.php constructor is invoked withoug paremeters. The constructor then invokes setCacheDir with the default value of the $file parameter, which is null (sfFileCache.class.php"m line 94).

Another solution of thte problem would be to rewrite the code dir as follows:

  // create cache dir if needed 
  if ((null != $cacheDir) && !is_dir($cacheDir)) {
    $current_umask = umask(0000); if ( $cacheDir && !is_dir($cacheDir) )
    @mkdir($cacheDir, 0777, true);
    umask($current_umask);
  }

04/02/08 11:10:07 changed by fabien

  • milestone set to 1.0.14.

04/04/08 14:06:49 changed by noel

  • status changed from new to closed.
  • resolution set to fixed.

(In [8280]) fixed sfFileCache warning message when creating directory (closes #2816)