mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-01 07:17:48 +02:00
Merge pull request #10700 from silverstripeltd/pulls/kernel-is-flushed
5-beta: Add isFlushed() to Kernel interface
This commit is contained in:
commit
981e20e298
@ -188,7 +188,7 @@ abstract class BaseKernel implements Kernel
|
||||
$this->getIncludeTests(),
|
||||
$flush
|
||||
);
|
||||
|
||||
|
||||
// Flush config
|
||||
if ($flush) {
|
||||
$config = $this->getConfigLoader()->getManifest();
|
||||
@ -265,7 +265,7 @@ abstract class BaseKernel implements Kernel
|
||||
|
||||
abstract public function boot($flush = false);
|
||||
|
||||
abstract public function isFlushed();
|
||||
abstract public function isFlushed(): ?bool;
|
||||
|
||||
/**
|
||||
* Check if there's a legacy _ss_environment.php file
|
||||
|
@ -15,11 +15,8 @@ class CoreKernel extends BaseKernel
|
||||
|
||||
/**
|
||||
* Indicates whether the Kernel has been flushed on boot
|
||||
* Uninitialised before boot
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
private $flush;
|
||||
private ?bool $flush = null;
|
||||
|
||||
/**
|
||||
* @param false $flush
|
||||
@ -217,12 +214,7 @@ class CoreKernel extends BaseKernel
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the Kernel has been flushed on boot
|
||||
*
|
||||
* @return bool|null null if the kernel hasn't been booted yet
|
||||
*/
|
||||
public function isFlushed()
|
||||
public function isFlushed(): ?bool
|
||||
{
|
||||
return $this->flush;
|
||||
}
|
||||
|
@ -16,11 +16,9 @@ class DatabaselessKernel extends BaseKernel
|
||||
{
|
||||
/**
|
||||
* Indicates whether the Kernel has been flushed on boot
|
||||
* Uninitialised before boot
|
||||
*
|
||||
* @var bool
|
||||
* Null before boot
|
||||
*/
|
||||
private $flush;
|
||||
private ?bool $flush = null;
|
||||
|
||||
/**
|
||||
* Allows disabling of the configured error handling.
|
||||
@ -53,10 +51,7 @@ class DatabaselessKernel extends BaseKernel
|
||||
$this->setBooted(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isFlushed()
|
||||
public function isFlushed(): ?bool
|
||||
{
|
||||
return $this->flush;
|
||||
}
|
||||
|
@ -132,4 +132,11 @@ interface Kernel
|
||||
* @return $this
|
||||
*/
|
||||
public function setEnvironment($environment);
|
||||
|
||||
/**
|
||||
* Returns whether the Kernel has been flushed on boot
|
||||
*
|
||||
* @return bool|null null if the kernel hasn't been booted yet
|
||||
*/
|
||||
public function isFlushed(): ?bool;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user