Ticket #822 (closed enhancement: wontfix)
Shutdown Functions in QCubed.
| Reported by: | vaibhav | Owned by: | |
|---|---|---|---|
| Priority: | important | Milestone: | 2.1.1 |
| Component: | Framework | Version: | 2.1.0 Stable |
| Keywords: | shutdown script. | Cc: |
Description
PHP Offers us to create shutdown functions. QApplication does not seem to do anything about it. I think we can create a constant in configuration.inc.php which will contain the address of a file which would be 'included' during the script shutdown procedure. This will help users write code more easily. I think something like this:
in configuration.inc.php, user defines the path to the file:
define('__SHUTDOWN_PROCEDURE_FILE__', __APP_INCLUDES__ . '/function/shutdown.inc.php');
Then in QApplicationBase::Initialize():
register_shutdown_function('QApplicationBase::Shutdown');
And create a public static function in QApplicationBase as:
public static function Shutdown() {
include(__SHUTDOWN_PROCEDURE_FILE__);
}
This way any one can write custom shutdown code with QCubed anywhere he wants to without fearing that on an upgrade things will change. Also, all the shutdown code management would not be responsibility of user. This would be a fair addition to functionality!
Regards,
Vaibhav
