From:
http://unixhelp.ed.ac.uk/CGI/man-cgi?umask+2
DESCRIPTION
umask sets the umask to mask & 0777.
The umask is used by open(2) to set initial file permis-
sions on a newly-created file. Specifically, permissions
in the umask are turned off from the mode argument to
open(2) (so, for example, the common umask default value
of 022 results in new files being created with permissions
0666 & ~022 = 0644 = rw-r--r-- in the usual case where the
mode is specified as 0666).
At:
http://www.php.net/manual/en/function.umask.php
there is an explanation on how umask interacts with the current directory settings. Given that your result mirrors the standard one in the previous example (you're ending up with 0644 after umask changes it by 0022), you are probably starting with a directory setting of 0666 ( rw rw rw).
To have the file come in with rw rw r, change umask to 0002. 0000 would leave it rw rw rw.
As far as having everything come with all permissions open, rwx rwx rwx, maybe someone else can help. I'm not sure if setting the directory's permissions to rwx rwx rwx would transfer that to the files created in that directory since the x at the directory level has a different meaning than it does at the file level.