Gentics Portal.Node PHP API
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
All
Classes
Namespaces
Functions
Variables
Pages
common
extensions
FileHelper.php
1
<?php
2
/**
3
* Created by JetBrains PhpStorm.
4
* User: andrew
5
* Date: 5/4/12
6
* Time: 5:29 PM
7
* To change this template use File | Settings | File Templates.
8
*/
9
class
FileHelper
10
{
11
12
13
/**
14
* Removes directory recursively
15
*
16
* @param string $path Path to the directory.
17
*
18
* @return bool true on success or false on failure.
19
*/
20
public
static
function
rmdirr
($path)
21
{
22
$iterator =
new
RecursiveIteratorIterator(
23
new
RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::SKIP_DOTS), RecursiveIteratorIterator::CHILD_FIRST
24
);
25
foreach
($iterator as $file) {
26
if
($file->isDir()) {
27
self::rmdirr
($file->getPathname());
28
}
else
{
29
unlink($file->getPathname());
30
}
31
}
32
return
rmdir($path);
33
}
34
}
Generated on Thu Feb 6 2014 15:47:54 for Gentics Portal.Node PHP API by
1.8.1.2