Changeset 195
- Timestamp:
- 03/30/07 17:05:28 (15 years ago)
- Location:
- dev
- Files:
-
- 4 modified
Legend:
- Unmodified
- Added
- Removed
-
dev/common/admin/option_db.php
r190 r195 2 2 options::cat('Maintenance', 'Database', 'Table checks'); 3 3 options::fadd('This checks automatically your database', 'none', 'custom', array('admin_db', 'checkDatabase'), array('admin_db', 'none')); 4 options::fadd('Current SQL cache size', 'none', 'custom', array('admin_db', 'checkCache'), array('admin_db', 'killCache')); 4 5 5 6 class admin_db … … 31 32 // do nothing on submit 32 33 } 34 35 function checkCache() 36 { 37 $size = 0; 38 $dir = opendir(KB_CACHEDIR); 39 while ($line = readdir($dir)) 40 { 41 if (strstr($line, 'qcache_qry') !== false) 42 { 43 $size += filesize(KB_CACHEDIR.'/'.$line); 44 } 45 } 46 47 return round($size/1000, 2).' kB <input type="checkbox" name="option[sql_clearcache]">Clear cache ?'; 48 } 49 50 function killCache() 51 { 52 if ($_POST['option']['sql_clearcache'] != 'on') 53 { 54 return; 55 } 56 57 $dir = opendir(KB_CACHEDIR); 58 while ($line = readdir($dir)) 59 { 60 if (strstr($line, 'qcache_qry') !== false) 61 { 62 @unlink(KB_CACHEDIR.'/'.$line); 63 } 64 elseif (strstr($line, 'qcache_tbl') !== false) 65 { 66 @unlink(KB_CACHEDIR.'/'.$line); 67 } 68 } 69 } 33 70 } 34 71 ?> -
dev/common/includes/class.db.php
r190 r195 5 5 function DBConnection() 6 6 { 7 if (!$this->id_ = mysql_ pconnect(DB_HOST, DB_USER, DB_PASS))7 if (!$this->id_ = mysql_connect(DB_HOST, DB_USER, DB_PASS)) 8 8 die("Unable to connect to mysql database."); 9 9 -
dev/common/includes/class.db_cache.php
r190 r195 5 5 function DBConnection() 6 6 { 7 if (!$this->id_ = mysql_ pconnect(DB_HOST, DB_USER, DB_PASS))7 if (!$this->id_ = mysql_connect(DB_HOST, DB_USER, DB_PASS)) 8 8 die("Unable to connect to mysql database."); 9 9 -
dev/mods/.htaccess
r192 r195 1 <Files *.php> 1 2 deny from all 2 3 ErrorDocument 403 "Go away" 4 </Files>