Created
April 19, 2010 12:35
-
-
Save roelven/370993 to your computer and use it in GitHub Desktop.
A function to check the permissions of a folder using PHP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// A function to check the permissions of a folder using PHP | |
// @path = path to the folder you want to check | |
// @perm = permissions you want to check on the folder (0755) | |
function ynbs_check_permissions($path, $perm) { | |
clearstatcache(); | |
$configmod = @substr(sprintf(".%o", fileperms($path)), -4); | |
if ($configmod != $perm) { | |
return '<div class="error"><p>Warning, the permissions of your XML directory are now '.$configmod.'. You should set them to <strong>'.$perm.'</strong></p></div>'; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment