public function afterFilter(Event $event) {
		if (Configure::read('Shim.monitorHeaders') && $this->name !== 'Error' && PHP_SAPI !== 'cli') {
			if (headers_sent($filename, $lineNumber)) {
				$message = sprintf('Headers already sent in %s on line %s', $filename, $lineNumber);
				if (Configure::read('debug')) {
					throw new Exception($message);
				}
				trigger_error($message);
			}
		}
	}
public function afterFilter(Event $event) {
		if (Configure::read('Shim.monitorHeaders') && $this->name !== 'Error' && PHP_SAPI !== 'cli') {
			if (headers_sent($filename, $lineNumber)) {
				$message = sprintf('Headers already sent in %s on line %s', $filename, $lineNumber);
				if (Configure::read('debug')) {
					throw new Exception($message);
				}
				trigger_error($message);
			}
		}
	}
public function afterFilter ( Event $ event ) { if ( Configure :: read ( 'Shim.monitorHeaders' ) && $ this -> name !== 'Error' && PHP_SAPI !== 'cli' ) { if ( headers_sent ( $ filename , $ lineNumber ) ) { $ message = sprintf ( 'Headers already sent in %s on line %s' , $ filename , $ lineNumber ) ; if ( Configure :: read ( 'debug' ) ) { throw new Exception ( $ message ) ; } trigger_error ( $ message ) ; } } }
Hook to monitor headers being sent.

This, if desired, adds a check if your controller actions are cleanly built and no headers
or output is being sent prior to the response class, which should be the only one doing this.

@param \Cake\Event\Event $event An Event instance
@throws \Exception
@return \Cake\Http\Response|null
Hook to monitor headers being sent .