Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/julianhille/kohana-real-post-process
This is a little module, which allows to write caches / write loggings / image processings (or what ever you want to do) after the user got his content.
https://github.com/julianhille/kohana-real-post-process
Last synced: about 1 month ago
JSON representation
This is a little module, which allows to write caches / write loggings / image processings (or what ever you want to do) after the user got his content.
- Host: GitHub
- URL: https://github.com/julianhille/kohana-real-post-process
- Owner: julianhille
- License: other
- Created: 2011-09-28T15:00:04.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2011-09-29T18:03:38.000Z (about 13 years ago)
- Last Synced: 2024-05-01T12:34:14.847Z (8 months ago)
- Language: PHP
- Homepage:
- Size: 97.7 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: license.txt
Awesome Lists containing this project
README
# Kohana-Real post process integration
This module allows to write caches, logs or anything else to be processed after user got the content.
This is a very early version but works so far as expected.
You can have destruct functions in classes which gets called after the output of the content.
This means you can easily process data after content flushing.A little workaround is needed in the controller, because of Request::factory()->execute()… in the index.php.
This function calls your controller by the php reflection api, which means that at the end of the script
the controller gets destructed. You can "overwrite" this behaviour. For further instructions
read the usage part.## Requirements
* Dont use any exits in the middle of your scripts, just return nothing otherwise it wont work.
* Dont use htacces nor apache to deflate / gzip the output. Otherwise the apache process is waiting till the end of the php process to set the content.length and so you would have no benefit at all.## Usage
The module extends the Kohana_Request controller for outputing content.
It cleans all output buffers and prepends it to the body.
Then it gets the user headers for compression and compresses the data, calculate its length and
set the specified header data. In the end it flushes everything out.
Controller:
The controller got extended and you can now set a variable $this->post_process to true and the before function does everything for you.
If you dont know, if your controller needs to process something in the destruct function, then you can also
add it by your own in any function by calling: $this->post_process();## Installation
As always in koahana you need to check this module out to "realpostprocess" and add to your bootstrap at the modules part:
'realpostprocess'=>MODPATH.'realpostprocess'. Thats it!Any enhancements are welcome.