diff options
author | Thomas Lange <code@nerdmind.de> | 2021-10-24 15:54:43 +0200 |
---|---|---|
committer | Thomas Lange <code@nerdmind.de> | 2021-10-24 15:54:43 +0200 |
commit | cbe7e31f68d4ca2bfcd53dffdb130f1f84be3343 (patch) | |
tree | 4e285e9a92116c11c2d72245e71af4422b65a961 /include/classes/BigPipe/Pagelet.php | |
parent | 6d69bab4d07cd502d78b565ee9eba3b1e9296931 (diff) | |
download | bigpipe-cbe7e31f68d4ca2bfcd53dffdb130f1f84be3343.tar.gz bigpipe-cbe7e31f68d4ca2bfcd53dffdb130f1f84be3343.tar.xz bigpipe-cbe7e31f68d4ca2bfcd53dffdb130f1f84be3343.zip |
Split up BigPipe "enabled" method into two methods
Split up the "enabled" method of the BigPipe class into two methods, one
to check if the pipelining mode is currently enabled ("isEnabled") and
another one to enable/disable the pipelining mode ("setEnabled").
This change prevents that a single method has two different jobs, which
can be confusing for programmers who didn't wrote the code but only use
them. Now there are two clearly named methods for exactly one job.
Diffstat (limited to 'include/classes/BigPipe/Pagelet.php')
-rw-r--r-- | include/classes/BigPipe/Pagelet.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/classes/BigPipe/Pagelet.php b/include/classes/BigPipe/Pagelet.php index 0358df6..bd50c4b 100644 --- a/include/classes/BigPipe/Pagelet.php +++ b/include/classes/BigPipe/Pagelet.php @@ -150,7 +150,7 @@ class Pagelet extends Item { # Flush pagelet immediately #=============================================================================== public function flush() { - if(BigPipe::enabled()) { + if(BigPipe::isEnabled()) { $pageletHTML = str_replace(["\r", "\n", "\t"], '', $this->getHTML()); $pageletHTML = str_replace('--', '--', $pageletHTML); @@ -169,7 +169,7 @@ class Pagelet extends Item { #=============================================================================== public function __toString() { $pageletHTML = "<{$this->tagName} id=\"{$this->getID()}\">"; - $pageletHTML .= !BigPipe::enabled() ? $this->getHTML() : $this->tagHTML; + $pageletHTML .= !BigPipe::isEnabled() ? $this->getHTML() : $this->tagHTML; $pageletHTML .= "</{$this->tagName}>"; return $pageletHTML; |