mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 09:05:55 +00:00
ENHANCEMENT: Removed unnecessary subsite caching for better static publishing operation. (from r81666)
This commit is contained in:
parent
c575a0c09c
commit
c17784761a
@ -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());
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user