Revision 1978
Added by Luisehahne about 12 years ago
| functions.php | ||
|---|---|---|
| 27 | 27 |
|
| 28 | 28 |
/** |
| 29 | 29 |
* Delete an Accessfiles Tree |
| 30 |
* @param string $sDirToDelete |
|
| 30 |
* @param string $sDirToDelete |
|
| 31 |
* @param array &$aReport returns report if set |
|
| 31 | 32 |
* @return boolean true/false |
| 32 | 33 |
* @description Delete all accessfiles and its depending directory tree |
| 33 | 34 |
* inside the given directory. |
| 34 | 35 |
*/ |
| 35 |
|
|
| 36 |
function DeleteAccessFilesTree($sDirToDelete) |
|
| 36 |
function DeleteAccessFilesTree($sDirToDelete, array &$aReport = null) |
|
| 37 | 37 |
{
|
| 38 |
$aReport = array(); |
|
| 38 | 39 |
$sBaseDir = realpath($sDirToDelete); |
| 39 | 40 |
if( $sBaseDir !== false) {
|
| 40 | 41 |
$sBaseDir = rtrim(str_replace('\\', '/', $sBaseDir), '/') . '/';
|
| ... | ... | |
| 44 | 45 |
try{
|
| 45 | 46 |
$oAccFile = new AccessFile($sItem); |
| 46 | 47 |
$oAccFile->delete(); |
| 48 |
$aReport = array_merge($aReport, AccessFileHelper::getDelTreeLog()); |
|
| 47 | 49 |
}catch(AccessFileIsNoAccessfileException $e) {
|
| 48 | 50 |
continue; |
| 49 | 51 |
} |
| ... | ... | |
| 1451 | 1453 |
/** |
| 1452 | 1454 |
* try to remove access files and build new folder protect files |
| 1453 | 1455 |
*/ |
| 1454 |
// $sTempDir = (defined('PAGES_DIRECTORY') && (PAGES_DIRECTORY != '') ? PAGES_DIRECTORY : '').'/';
|
|
| 1456 |
// $sTempDir = (defined('PAGES_DIRECTORY') && (PAGES_DIRECTORY != '') ? PAGES_DIRECTORY : '').'/';
|
|
| 1455 | 1457 |
$sTreeToDelete = WbAdaptor::getInstance()->AppPath.WbAdaptor::getInstance()->PagesDir; |
| 1456 | 1458 |
if(($sTreeToDelete!='') && is_writeable($sTreeToDelete)==true) {
|
| 1457 | 1459 |
// if(rm_full_dir (WB_PATH.$sTempDir, true, $aProtectedFiles )==false) {
|
| 1458 | 1460 |
// $aRetval[] = 'Could not delete existing access files'; |
| 1459 | 1461 |
// } |
| 1460 |
DeleteAccessFilesTree($sTreeToDelete); |
|
| 1462 |
$aDeleteLog = array(); // <<< ge?ndert |
|
| 1463 |
DeleteAccessFilesTree($sTreeToDelete, $aDeleteLog); // <<< ge?ndert |
|
| 1461 | 1464 |
if($bShowDetails) {
|
| 1462 |
$aRetval = array_merge($aRetval, AccessFileHelper::getDelTreeLog());
|
|
| 1465 |
$aRetval = array_merge($aRetval, $aDeleteLog); // <<< ge?ndert
|
|
| 1463 | 1466 |
} |
| 1464 | 1467 |
} |
| 1465 | 1468 |
|
Also available in: Unified diff
/framework/functions.php::rebuild_all_accessfiles() output of detailed log corrected