Zeile 6 | Zeile 6 |
---|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* $Id: class_datacache.php 5473 2011-06-23 11:12:10Z Tomm $
| * $Id$
|
*/
class datacache
| */
class datacache
|
Zeile 95 | Zeile 95 |
---|
function read($name, $hard=false) { global $db, $mybb;
|
function read($name, $hard=false) { global $db, $mybb;
|
|
|
// Already have this cache and we're not doing a hard refresh? Return cached copy if(isset($this->cache[$name]) && $hard == false) {
| // Already have this cache and we're not doing a hard refresh? Return cached copy if(isset($this->cache[$name]) && $hard == false) {
|
Zeile 106 | Zeile 106 |
---|
else if($hard == false && !is_object($this->handler)) { return false;
|
else if($hard == false && !is_object($this->handler)) { return false;
|
}
| }
|
if(is_object($this->handler)) { $data = $this->handler->fetch($name);
|
if(is_object($this->handler)) { $data = $this->handler->fetch($name);
|
|
|
// No data returned - cache gone bad? if($data === false) {
| // No data returned - cache gone bad? if($data === false) {
|
Zeile 119 | Zeile 119 |
---|
$query = $db->simple_select("datacache", "title,cache", "title='".$db->escape_string($name)."'"); $cache_data = $db->fetch_array($query); $data = @unserialize($cache_data['cache']);
|
$query = $db->simple_select("datacache", "title,cache", "title='".$db->escape_string($name)."'"); $cache_data = $db->fetch_array($query); $data = @unserialize($cache_data['cache']);
|
if($data == null) { $data = ''; }
|
|
// Update cache for handler $this->handler->put($name, $data); }
|
// Update cache for handler $this->handler->put($name, $data); }
|
}
| }
|
// Else, using internal database cache else { $query = $db->simple_select("datacache", "title,cache", "title='$name'"); $cache_data = $db->fetch_array($query);
|
// Else, using internal database cache else { $query = $db->simple_select("datacache", "title,cache", "title='$name'"); $cache_data = $db->fetch_array($query);
|
|
|
if(!$cache_data['title']) { $data = false;
| if(!$cache_data['title']) { $data = false;
|