diff options
| author | Max Kremmel <xing@synapse.plus.com> | 2007-07-07 17:57:26 +0000 |
|---|---|---|
| committer | Max Kremmel <xing@synapse.plus.com> | 2007-07-07 17:57:26 +0000 |
| commit | ddaecadf39f764219adef3e389ae8e869e621dfc (patch) | |
| tree | c0d21a06e9f2f355478710d335eab6cd78560102 | |
| parent | 26063a9a40e101257dc180d797503304ed3a06a0 (diff) | |
| download | liberty-ddaecadf39f764219adef3e389ae8e869e621dfc.tar.gz liberty-ddaecadf39f764219adef3e389ae8e869e621dfc.tar.bz2 liberty-ddaecadf39f764219adef3e389ae8e869e621dfc.zip | |
add expungeCache method to remove all cache files at once. this will be used when plugin settings are changed and perhaps some other settings.
| -rw-r--r-- | LibertyContent.php | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/LibertyContent.php b/LibertyContent.php index 6713de7..62f603c 100644 --- a/LibertyContent.php +++ b/LibertyContent.php @@ -3,7 +3,7 @@ * Management of Liberty content * * @package liberty -* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyContent.php,v 1.254 2007/07/06 22:04:37 squareing Exp $ +* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyContent.php,v 1.255 2007/07/07 17:57:26 squareing Exp $ * @author spider <spider@steelsun.com> */ @@ -2308,6 +2308,26 @@ class LibertyContent extends LibertyBase { return TRUE; } + /** + * Delete liberty cache + * + * @param array $pContentId + * @access public + * @return TRUE on success, FALSE on failure + */ + function expungeCache() { + $ret = FALSE; + $cacheDir = LibertyContent::getCacheBasePath(); + // make sure that we're in the temp dir at least + if( strstr( $cacheDir, str_replace( '//', '/', TEMP_PKG_PATH ))) { + unlink_r( $cacheDir ); + // make sure we have a usable cache directory to work with + $ret = ( is_dir( $cacheDir ) || mkdir_p( $cacheDir )); + } + return $ret; + } + + // i think this function is not being used and will hopefully be removed soon - xing - Saturday Jul 07, 2007 19:54:02 CEST function getFilter( $pContentTypeGuid, &$pSql, &$pBindVars, $pHash = null) { global $gLibertySystem, $gBitSystem; foreach ($gLibertySystem->mContentTypes as $type) { |
