note 124789 added to function.get-current-user

From: Date: Tue, 03 Mar 2020 19:37:40 +0000
Subject: note 124789 added to function.get-current-user
Groups: php.notes 
Request: Send a blank email to php-notes+get-214277@lists.php.net to get a copy of this message
Further testing of behaviour on Windows vs Linux... On Linux this function is indeed returning the owner of the script. If you want to know the username PHP is running as you can use POSIX functions (or shell_exec with 'whoami'). On Windows this function is returning the username PHP is running as. Both for IIS (IUSR) and Apache (SYSTEM - which comes from the fact Apache is a service on Windows). The behaviour on Windows is actually useful given that POSIX functions aren't available. If you need to find the owner of the script on Windows perhaps the best way is to shell_exec to use dir /Q, and parse that. ---- Server IP: 45.112.84.4 Probable Submitter: 38.142.137.34 (proxied: 65.26.220.245) ---- Manual Page -- http://php.net/manual/en/function.get-current-user.php Edit -- https://master.php.net/note/edit/124789 Del: integrated -- https://master.php.net/note/delete/124789/integrated Del: useless -- https://master.php.net/note/delete/124789/useless Del: bad code -- https://master.php.net/note/delete/124789/bad+code Del: spam -- https://master.php.net/note/delete/124789/spam Del: non-english -- https://master.php.net/note/delete/124789/non-english Del: in docs -- https://master.php.net/note/delete/124789/in+docs Del: other reasons-- https://master.php.net/note/delete/124789 Reject -- https://master.php.net/note/reject/124789 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#214277) next »