Commit 7abf5f42814511e4e34e31a9dbc979b720f61b27
1 parent
0fc66120
KTS-2808
"HouseKeeper plugin produces 'Class 'KTPlugin' not found' error" Fixed. Committed By: Conrad Vermeulen Reviewed By: Megan Watson git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@7877 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
17 additions
and
1 deletions
plugins/housekeeper/HouseKeeperPlugin.php
| @@ -35,6 +35,9 @@ | @@ -35,6 +35,9 @@ | ||
| 35 | * Contributor( s): ______________________________________ | 35 | * Contributor( s): ______________________________________ |
| 36 | */ | 36 | */ |
| 37 | 37 | ||
| 38 | +require_once(KT_LIB_DIR . '/plugins/plugin.inc.php'); | ||
| 39 | +require_once(KT_LIB_DIR . '/plugins/pluginregistry.inc.php'); | ||
| 40 | + | ||
| 38 | class HouseKeeperPlugin extends KTPlugin | 41 | class HouseKeeperPlugin extends KTPlugin |
| 39 | { | 42 | { |
| 40 | var $autoRegister = true; | 43 | var $autoRegister = true; |
| @@ -49,8 +52,16 @@ class HouseKeeperPlugin extends KTPlugin | @@ -49,8 +52,16 @@ class HouseKeeperPlugin extends KTPlugin | ||
| 49 | $this->sFriendlyName = _kt('Housekeeper'); | 52 | $this->sFriendlyName = _kt('Housekeeper'); |
| 50 | 53 | ||
| 51 | $config = KTConfig::getSingleton(); | 54 | $config = KTConfig::getSingleton(); |
| 52 | - $tempDir = $config->get('urls/tmpDirectory'); | ||
| 53 | $cacheDir = $config->get('cache/cacheDirectory'); | 55 | $cacheDir = $config->get('cache/cacheDirectory'); |
| 56 | + $cacheFile = $cacheDir . '/houseKeeper.folders'; | ||
| 57 | + | ||
| 58 | + if (is_file($cacheFile)) | ||
| 59 | + { | ||
| 60 | + $this->folders = unserialize(file_get_contents($cacheFile)); | ||
| 61 | + return; | ||
| 62 | + } | ||
| 63 | + | ||
| 64 | + $tempDir = $config->get('urls/tmpDirectory'); | ||
| 54 | $logDir = $config->get('urls/logDirectory'); | 65 | $logDir = $config->get('urls/logDirectory'); |
| 55 | $docsDir = $config->get('urls/documentRoot'); | 66 | $docsDir = $config->get('urls/documentRoot'); |
| 56 | 67 | ||
| @@ -107,8 +118,13 @@ class HouseKeeperPlugin extends KTPlugin | @@ -107,8 +118,13 @@ class HouseKeeperPlugin extends KTPlugin | ||
| 107 | 'pattern'=>'', | 118 | 'pattern'=>'', |
| 108 | 'canClean'=>false | 119 | 'canClean'=>false |
| 109 | ); | 120 | ); |
| 121 | + | ||
| 122 | + // lets only cache this once it has been resolved! | ||
| 123 | + file_put_contents($cacheFile, serialize($this->folders)); | ||
| 110 | } | 124 | } |
| 111 | 125 | ||
| 126 | + | ||
| 127 | + | ||
| 112 | } | 128 | } |
| 113 | 129 | ||
| 114 | function getDirectories() | 130 | function getDirectories() |