/** * Executes the pre-filter action. * * This method applies the pre-filter actions to the passed response. It * executes any piped filters first. * * @param T_Response $response response object to apply filter to */ function preFilter(T_Response $response) { if ($this->filter) { $this->filter->preFilter($response); } $this->doPreFilter($response); $this->is_exe = true; }
/** * Append a filter to the end of the current filter chain. * * @param T_Response_Filter $filter filter to apply * @param mixed $key optional filter access key */ function appendFilter(T_Response_Filter $filter, $key = null) { if (!is_null($key) && !array_key_exists($key, $this->filter)) { $this->filter[$key] = $filter; } elseif (is_null($key)) { $this->filter[] = $filter; } else { throw new InvalidArgumentException("existing key {$key}"); } /* filter is stored BEFORE pre-filtering in case a redirect is thrown in the prefilter process. */ $filter->preFilter($this); }