Example #1
0
 /**
  * Returns a temporary filename using tempnam() and File::getTmpDir().
  * 
  * @access  public 
  * @param   string  $dirname Optional directory name for the tmp file
  * @return  string  Filename and path of the tmp file
  */
 function getTempFile($dirname = null)
 {
     if (!isset($dirname)) {
         $dirname = File::getTempDir();
     }
     return tempnam($dirname, 'temp.');
 }
Example #2
0
 function testgetTempDir()
 {
     $dir = File::getTempDir();
     $this->assertTrue(is_dir($dir), "is_dir({$dir})");
 }
Example #3
0
 /**
  * Returns a temporary filename using tempnam() and the above getTmpDir() function.
  *
  * @access public
  * @param  string $dirname Optional directory name for the tmp file
  * @return string          Filename and path of the tmp file
  */
 function getTempFile($dirname = NULL)
 {
     if (is_null($dirname)) {
         $dirname = File::getTempDir();
     }
     return tempnam($dirname, 'temp.');
 }