net/manual/
function.chmod.php.
The last three methods we will explore are all used to read the contents of a folder
and they are: folders() and files().
The folders() method is used to list the folders within a folder. In its most basic
usage this method returns an array of all of the direct sub-folders. This example gets
the names of all of the folders in the core Poll component:
$folder = JPATH_ADMINISTRATOR.DS.'components'.DS.'com_poll';
$folders = JFolder::folders($folder);
The resultant array will look like this:
Array
(
[0] => elements
[1] => tables
[2] => views
)
The second parameter is an optional filter. This filter is an RE filter (see Chapter 11 for
more information on REs). By default the filter is '.' (A period signifies any character).
The third parameter, also optional, is a Boolean parameter that determines if we
want a recursive listing of folders. A recursive listing means that we will be provided
with all sub-folders even if they are not direct descendants. By default this is false.
Pages:
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486