/** * 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.'); }
function testgetTempDir() { $dir = File::getTempDir(); $this->assertTrue(is_dir($dir), "is_dir({$dir})"); }
/** * 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.'); }