Skip to content

Instantly share code, notes, and snippets.

@mattonomics
Created October 7, 2012 22:50
Show Gist options
  • Save mattonomics/3849856 to your computer and use it in GitHub Desktop.
Save mattonomics/3849856 to your computer and use it in GitHub Desktop.
Check a few ownership deets
<?php
echo "get_current_user: " . (function_exists('get_current_user') ? get_current_user() : 'get_current_user() does not exist');
echo "<br>";
echo "getmyuid: " . (function_exists('getmyuid') ? getmyuid() : 'getmyuid() does not exist');
echo "<br>";
echo "fileowner(seed.php): " . (function_exists('fileowner') ? fileowner(dirname(__FILE__) . '/seed.php') : 'fileowner() does not exist');
echo "<br>";
echo "fileowner(". basename(__FILE__) ."): " . (function_exists('fileowner') ? fileowner(__FILE__) : 'fileowner() does not exist');
echo "<br>";
echo "fileowner(wp-content): " . (function_exists('fileowner') ? fileowner("../../../") : 'fileowner() does not exist');
echo "<br>";
echo "posix_getuid(): " . (function_exists('posix_getuid') ? posix_getuid() : 'posix_getuid() does not exist');
echo "<br>";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment