Instantiate SignedFileStorage object only once per config object.

8.0.x
sun 2012-02-13 23:34:54 +01:00 committed by Greg Dunlap
parent 251697b6a3
commit b068ec4031
1 changed files with 14 additions and 4 deletions

View File

@ -10,6 +10,13 @@ use Drupal\Core\Config\SignedFileStorage;
*/
abstract class DrupalConfigVerifiedStorage implements DrupalConfigVerifiedStorageInterface {
/**
* The local signed file object to read from and write to.
*
* @var SignedFileStorage
*/
protected $signedFile;
/**
* 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
* @todo
* @return SignedFileStorage
* The signed file object for this configuration object.
*/
protected function signedFileStorage() {
return new SignedFileStorage($this->name);
if (!isset($this->signedFile)) {
$this->signedFile = new SignedFileStorage($this->name);
}
return $this->signedFile;
}
/**