This decreases the chance of errors due to lack of user rights.
The copy() method copies a folder to a new location. The method accepts four
parameters: path to the source folder, path to the destination folder, an optional base
path, and an optional force flag.
If a base path is provided, it will be prepended to the source and destination paths.
When the force flag is true, overwrite is enabled; by default the force flag is false.
This example force copies the foo folder to the bar folder in the frontend root of the
current component:
if (!JFolder::copy('foo', 'bar', JPATH_COMPONENT, true))
{
// handle failed folder copy
}
The move() method relocates a folder. This method returns a Boolean value.
This example moves the folder foo to the folder bar in the frontend root of the
current component:
if (!JFolder::move('foo', 'bar', JPATH_COMPONENT))
{
// handle failed folder move
}
The delete() method removes folders from the file system. This method returns
a Boolean value. This example deletes the folder 'foo' from the frontend root of the
current component:
if (!JFolder::delete(JPATH_COMPONENT.
Pages:
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484