Support Joomla!

references:joomla.framework:filesystem:jpath-setpermissions

Table of Contents

setPermissions

API Package Subpackage Class Method Reference Last reviewed Doc status
API Home Package Joomla.Framework Subpackage FileSystem Class JPath Method setPermissions Reference setPermissions() Never Work in Progress

Changes permissions (using the PHP chmod function) on files and folders recursively to the specified permissions.

Syntax

boolean setPermissions ( $path, $filemode, $foldermode )

$path string is a string containing the root path to begin changing permissions [without trailing slash].
$filemode string is a string containing an octal representation of the value to change file permissions to. Null indicates that no change will be made to file permissions. This parameter is optional and if omitted will default to ‘0644’.
$foldermode string is a string containing an octal representation of the value to change folder permissions to. Null indicates that no change will be made to folder permissions. This parameter is optional and if omitted will default to ‘0755’.

Examples

Example

jimport( 'joomla.filesystem.path' );

if (JPath::setPermissions( JPATH_ROOT . '/libraries', '222' ) ) {
    echo "Permissions changed!";
} else {
    echo "Could not set permissions!";
}

might produce:

Result

Permissions changed!

Discussion

Full name:
E-Mail:
 
references/joomla.framework/filesystem/jpath-setpermissions.txt (534 views) · Last modified: 2007/08/15 15:06