_mkstemp() public method

public _mkstemp ( $dir )
示例#1
0
 /**
  * Create a temporary file on the same filesystem as
  * $this->association_dir.
  *
  * The temporary directory should not be cleaned if there are any
  * processes using the store. If there is no active process using
  * the store, it is safe to remove all of the files in the
  * temporary directory.
  *
  * @return array ($fd, $filename)
  * @access private
  */
 function _mktemp()
 {
     $name = Auth_OpenID_FileStore::_mkstemp($dir = $this->temp_dir);
     $file_obj = @fopen($name, 'wb');
     if ($file_obj !== false) {
         return array($file_obj, $name);
     } else {
         Auth_OpenID_FileStore::_removeIfPresent($name);
     }
 }
示例#2
0
 /**
  * Create a temporary file on the same filesystem as
  * $this->association_dir.
  *
  * The temporary directory should not be cleaned if there are any
  * processes using the store. If there is no active process using
  * the store, it is safe to remove all of the files in the
  * temporary directory.
  *
  * @return array ($fd, $filename)
  * @access private
  */
 function _mktemp()
 {
     error_log("MKTEMP!");
     $name = Auth_OpenID_FileStore::_mkstemp($dir = $this->temp_dir);
     $file_obj = @fopen($name, 'wb');
     if ($file_obj !== false) {
         error_log("I think I have a valid file object...");
         return array($file_obj, $name);
     } else {
         error_log("Attempting to remove {$name}");
         Auth_OpenID_FileStore::_removeIfPresent($name);
     }
 }