SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 469 | Next

James Kennard

"Mastering Joomla! 1.5 Extension and Framework Development"

We'll begin by
looking at the getPermissions() method.
This method is used to determine the permissions of a file or folder. When passed
a path, the method returns a string that describes the permissions in terms of Read,
Write, and Execute:
echo JPath::getPermissions($cleanPath);
This is an example of the value that might be returned:
rwxrwxr-x
If the supplied path does not exist then a string suggesting no permissions will
be returned:
---------
In addition to getting permissions, we can set permissions. We do this using the
setPermissions() method. By default the permissions are modified to 0644 for
files and 0755 for folders. If supplied with the path to a folder, this method acts
recursively, updating the file and folder permissions for all sub-files and folders:
JPath::setPermissions($cleanPath);
In order to set different permissions to the default permissions, we can supply two
additional parameters, the first being the permissions to apply to the files, the second
being the permissions to apply to the folders.


Pages:
457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481