[ticket/10614] Check if cache exists before destroying it

PHPBB3-10614
This commit is contained in:
Igor Wiedler 2012-02-09 01:39:45 +01:00
parent 68e4c667fa
commit 78de29b7ce

View file

@ -167,7 +167,10 @@ class phpbb_extension_manager
$this->db->sql_query($sql); $this->db->sql_query($sql);
} }
$this->cache->destroy($this->cache_name); if ($this->cache)
{
$this->cache->destroy($this->cache_name);
}
return !$active; return !$active;
} }
@ -221,7 +224,10 @@ class phpbb_extension_manager
WHERE ext_name = '" . $this->db->sql_escape($name) . "'"; WHERE ext_name = '" . $this->db->sql_escape($name) . "'";
$this->db->sql_query($sql); $this->db->sql_query($sql);
$this->cache->destroy($this->cache_name); if ($this->cache)
{
$this->cache->destroy($this->cache_name);
}
return true; return true;
} }
@ -238,7 +244,10 @@ class phpbb_extension_manager
WHERE ext_name = '" . $this->db->sql_escape($name) . "'"; WHERE ext_name = '" . $this->db->sql_escape($name) . "'";
$this->db->sql_query($sql); $this->db->sql_query($sql);
$this->cache->destroy($this->cache_name); if ($this->cache)
{
$this->cache->destroy($this->cache_name);
}
return false; return false;
} }
@ -298,7 +307,10 @@ class phpbb_extension_manager
WHERE ext_name = '" . $this->db->sql_escape($name) . "'"; WHERE ext_name = '" . $this->db->sql_escape($name) . "'";
$this->db->sql_query($sql); $this->db->sql_query($sql);
$this->cache->destroy($this->cache_name); if ($this->cache)
{
$this->cache->destroy($this->cache_name);
}
return true; return true;
} }
@ -309,7 +321,10 @@ class phpbb_extension_manager
WHERE ext_name = '" . $this->db->sql_escape($name) . "'"; WHERE ext_name = '" . $this->db->sql_escape($name) . "'";
$this->db->sql_query($sql); $this->db->sql_query($sql);
$this->cache->destroy($this->cache_name); if ($this->cache)
{
$this->cache->destroy($this->cache_name);
}
return false; return false;
} }