ENHANCEMENT: Removed unnecessary subsite caching for better static publishing operation. (from r81666)

This commit is contained in:
Tom Rix 2010-03-01 02:53:28 +00:00
parent c575a0c09c
commit c17784761a

View File

@ -55,11 +55,6 @@ class Subsite extends DataObject implements PermissionProvider {
'IsPublic' => 'Active subsite',
);
/**
* @var Subsite $cached_subsite Internal cache used by {@link currentSubsite()}.
*/
protected static $cached_subsite = null;
/**
* @var array $allowed_themes Numeric array of all themes which are allowed to be selected for all subsites.
* Corresponds to subfolder names within the /themes folder. By default, all themes contained in this folder
@ -188,12 +183,11 @@ JS;
*
* @uses ControllerSubsites->controllerAugmentInit()
*
* @param boolean $cache
* @return Subsite
*/
static function currentSubsite($cache = true) {
if(!self::$cached_subsite || !$cache) self::$cached_subsite = DataObject::get_by_id('Subsite', self::currentSubsiteID());
return self::$cached_subsite;
static function currentSubsite() {
// get_by_id handles caching so we don't have to
return DataObject::get_by_id('Subsite', self::currentSubsiteID());
}
/**