Cache aller verfügbaren Weblication Projekte leeren

Folgendes Script, in der DocumentRoot abgelegt, leert den Projektcache aller Weblication-Projekte (Contentverzeichnisse) der Installation
<?php

require_once $_SERVER['DOCUMENT_ROOT'] . '/weblication/grid.php';

if(
wUserCur::getType() !== 'admin' ) {
exit();
}

$dirs = wRepository::getSubdirsDir( '' );

if( !empty(
$dirs ) ) {
foreach(
$dirs as $dir ) {

$isProject = wRepository::documentExists( $dir . '/weblication/project/wProject.php' );
if(
$isProject === true ) {
$type = wProject::getValueOf( $dir, '/wProject/type/text()' );
if(
$type === 'content' ) {
print
"Projekt: " . $dir;
print
wCache::clearCacheProject( $dir ) === true ? ':<strong style="color:green;padding-left:10px;">ok</strong>' : ':<strong style="color:red;padding-left:10px;">error</strong>';
print
"<br/>";
}
}
}
}

?>