src/PEAR/Common.php
function mkTempDir($tmpdir = '')
    {
        $topt = $tmpdir ? array('-t', $tmpdir) : array();
        $topt = array_merge($topt, array('-d', 'pear'));
        if (!class_exists('System')) {
            require_once 'System.php';
        }

        if (!$tmpdir = System::mktemp($topt)) {
            return false;
        }

        $this->addTempFile($tmpdir);
        return $tmpdir;
    }
function mkTempDir($tmpdir = '')
    {
        $topt = $tmpdir ? array('-t', $tmpdir) : array();
        $topt = array_merge($topt, array('-d', 'pear'));
        if (!class_exists('System')) {
            require_once 'System.php';
        }

        if (!$tmpdir = System::mktemp($topt)) {
            return false;
        }

        $this->addTempFile($tmpdir);
        return $tmpdir;
    }
Create and register a temporary directory.

@param string $tmpdir (optional) Directory to use as tmpdir.
Will use system defaults (for example
/tmp or c:\windows\temp) if not specified

@return string name of created directory

@access public