Instantiate SignedFileStorage object only once per config object.
parent
251697b6a3
commit
b068ec4031
|
@ -10,6 +10,13 @@ use Drupal\Core\Config\SignedFileStorage;
|
||||||
*/
|
*/
|
||||||
abstract class DrupalConfigVerifiedStorage implements DrupalConfigVerifiedStorageInterface {
|
abstract class DrupalConfigVerifiedStorage implements DrupalConfigVerifiedStorageInterface {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The local signed file object to read from and write to.
|
||||||
|
*
|
||||||
|
* @var SignedFileStorage
|
||||||
|
*/
|
||||||
|
protected $signedFile;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implements DrupalConfigVerifiedStorageInterface::__construct().
|
* Implements DrupalConfigVerifiedStorageInterface::__construct().
|
||||||
*/
|
*/
|
||||||
|
@ -18,13 +25,16 @@ abstract class DrupalConfigVerifiedStorage implements DrupalConfigVerifiedStorag
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @todo
|
* Instantiates a new signed file object or returns the existing one.
|
||||||
*
|
*
|
||||||
* @return
|
* @return SignedFileStorage
|
||||||
* @todo
|
* The signed file object for this configuration object.
|
||||||
*/
|
*/
|
||||||
protected function signedFileStorage() {
|
protected function signedFileStorage() {
|
||||||
return new SignedFileStorage($this->name);
|
if (!isset($this->signedFile)) {
|
||||||
|
$this->signedFile = new SignedFileStorage($this->name);
|
||||||
|
}
|
||||||
|
return $this->signedFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue