mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +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(),
|
$this->getIncludeTests(),
|
||||||
$flush
|
$flush
|
||||||
);
|
);
|
||||||
|
|
||||||
// Flush config
|
// Flush config
|
||||||
if ($flush) {
|
if ($flush) {
|
||||||
$config = $this->getConfigLoader()->getManifest();
|
$config = $this->getConfigLoader()->getManifest();
|
||||||
@ -265,7 +265,7 @@ abstract class BaseKernel implements Kernel
|
|||||||
|
|
||||||
abstract public function boot($flush = false);
|
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
|
* 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
|
* Indicates whether the Kernel has been flushed on boot
|
||||||
* Uninitialised before boot
|
|
||||||
*
|
|
||||||
* @var bool
|
|
||||||
*/
|
*/
|
||||||
private $flush;
|
private ?bool $flush = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param false $flush
|
* @param false $flush
|
||||||
@ -217,12 +214,7 @@ class CoreKernel extends BaseKernel
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function isFlushed(): ?bool
|
||||||
* Returns whether the Kernel has been flushed on boot
|
|
||||||
*
|
|
||||||
* @return bool|null null if the kernel hasn't been booted yet
|
|
||||||
*/
|
|
||||||
public function isFlushed()
|
|
||||||
{
|
{
|
||||||
return $this->flush;
|
return $this->flush;
|
||||||
}
|
}
|
||||||
|
@ -16,11 +16,9 @@ class DatabaselessKernel extends BaseKernel
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Indicates whether the Kernel has been flushed on boot
|
* Indicates whether the Kernel has been flushed on boot
|
||||||
* Uninitialised before boot
|
* Null before boot
|
||||||
*
|
|
||||||
* @var bool
|
|
||||||
*/
|
*/
|
||||||
private $flush;
|
private ?bool $flush = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allows disabling of the configured error handling.
|
* Allows disabling of the configured error handling.
|
||||||
@ -53,10 +51,7 @@ class DatabaselessKernel extends BaseKernel
|
|||||||
$this->setBooted(true);
|
$this->setBooted(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function isFlushed(): ?bool
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
public function isFlushed()
|
|
||||||
{
|
{
|
||||||
return $this->flush;
|
return $this->flush;
|
||||||
}
|
}
|
||||||
|
@ -132,4 +132,11 @@ interface Kernel
|
|||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setEnvironment($environment);
|
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