Skip to content

Commit

Permalink
Small cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
flack committed Jan 31, 2019
1 parent 09cd7e2 commit b518160
Showing 1 changed file with 3 additions and 24 deletions.
27 changes: 3 additions & 24 deletions lib/midcom/services/cache/module/content.php
Expand Up @@ -47,13 +47,7 @@
* does neither invalidate the cache or drop the page that would have been delivered
* normally from the cache. If you change the content, you need to do that yourself.
*
* HTTP 304 Not Modified support is built into this module, and it will kill the
* output buffer and send a 304 reply if applicable.
*
* <b>Internal notes</b>
*
* This module's startup code will exit with _midcom_stop_request() in case of
* a cache hit, and it will enclose the entire request using PHP's output buffering.
* HTTP 304 Not Modified support is built into this module, and will send a 304 reply if applicable.
*
* <b>Module configuration (see also midcom_config)</b>
*
Expand Down Expand Up @@ -108,14 +102,6 @@ class midcom_services_cache_module_content extends midcom_services_cache_module
*/
private $_content_type = 'text/html';

/**
* This flag is true if the live mode has been activated. This prevents the
* cache processing at the end of the request.
*
* @var boolean
*/
private $_live_mode = false;

/**
* Set this to true if you want to inhibit storage of the generated pages in
* the cache database. All other headers will be created as usual though, so
Expand Down Expand Up @@ -546,22 +532,15 @@ public function content_type($type)

/**
* Put the cache into a "live mode". This will disable the
* cache during runtime, correctly flushing the output buffer and sending cache
* control headers. You will not be able to send any additional headers after
* executing this call therefore you should adjust the headers in advance.
* cache during runtime, correctly flushing the output buffer (if it's not empty)
* and sending cache control headers.
*
* The midcom-exec URL handler of the core will automatically enable live mode.
*
* @see midcom_application::_exec_file()
*/
public function enable_live_mode()
{
if ($this->_live_mode) {
debug_add('Cannot enter live mode twice, ignoring request.', MIDCOM_LOG_WARN);
return;
}

$this->_live_mode = true;
$this->no_cache();
Response::closeOutputBuffers(0, ob_get_length() > 0);
}
Expand Down

0 comments on commit b518160

Please sign in to comment.