<?php
namespace wcf\data\application;
use wcf\data\AbstractDatabaseObjectAction;
+use wcf\data\package\PackageCache;
+use wcf\system\cache\CacheHandler;
use wcf\system\WCF;
use wcf\util\FileUtil;
}
}
WCF::getDB()->commitTransaction();
+
+ $this->clearCache();
}
/**
if (empty($this->objects)) {
$this->readObjects();
}
-
+ $this->clearCache();
$sql = "UPDATE wcf".WCF_N."_application
SET groupID = ?,
cookieDomain = domainName,
));
}
WCF::getDB()->commitTransaction();
+
+ $this->clearCache();
+ }
+
+ /**
+ * Clears application cache.
+ */
+ protected function clearCache() {
+ foreach ($this->objects as $application) {
+ $directory = PackageCache::getInstance()->getPackage($application->packageID)->packageDir;
+ $directory = FileUtil::getRealPath(WCF_DIR.$directory);
+
+ CacheHandler::getInstance()->clear($directory.'cache', '*.php');
+ }
}
}
use wcf\data\application\ApplicationAction;
use wcf\data\application\ApplicationList;
use wcf\data\AbstractDatabaseObjectAction;
+use wcf\system\cache\CacheHandler;
+use wcf\system\language\LanguageFactory;
/**
* Executes application group-related actions.
$applicationAction = new ApplicationAction($applicationList->getObjects(), 'ungroup');
$applicationAction->executeAction();
+ // delete language cache and compiled templates
+ LanguageFactory::getInstance()->deleteLanguageCache();
+
+ // delete WCF cache
+ CacheHandler::getInstance()->clear(WCF_DIR.'cache', '*.php');
+ CacheHandler::getInstance()->clear(WCF_DIR.'cache/templateListener', '*.php');
+
return parent::delete();
}
}