Recommend this page to a friend! |
Download .zip |
Info | View files (2) | Download .zip | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2011-05-02 (5 years ago) | Not enough user ratings | Total: 233 | All time: 7,543 This week: 993 |
Version | License | PHP version | Categories | |||
mvc-shutdown-manager 1.0 | MIT/X Consortium ... | 5 | PHP 5, Language |
Description | Author | ||||||||||||||
This class can manage multiple PHP script shutdown functions. |
|
shutdownManager will assist you managing your shutdown handlers. The main purpose of this class it to allow you to priorize your shutdown handlers without matter about the order you registered them in your code. The other benefits versus traditional register_shutdown_function is the possibility to remove a previously registered handlers or even avoid all of them at once. Here's some example of what you can do. #- registering a new handler: $callableCallback = 'myShutdownHandler'; // see php doc of call_user_func for info about valid callable callbacks $priority = 0; // optional priority of your callback default to 0 higher values means later call $handlerId = smvcShutdownManager::register($callableCallback,$priority); #- to check if an handler is registered: smvcShutdownManager::isRegistered($handlerId); or smvcShutdownManager::isRegistered($callableCallback); #- get all registered handlers: $registeredHandlers = smvcShutdownManager::isRegistered(); #- remove handler: smvcShutdownManager::unregister($handlerId); or smvcShutdownManager::unregister($callableCallback); #- remmoving all handlers at once: smvcShutdownManager::unregister(null); #- exit script bypassing registered handlers all at once: $exitStatut=0; // this value will be passed to exit function so see exit doc for more info on what you can pass here $bypassCallbacks = true; // setting second parameter to true will simply ignore any previously registered handlers. smvcShutdownManager::shutdown($exitStatut,$bypassCallbacks); |
Files |
File | Role | Description |
---|---|---|
README | Doc. | simple documentation |
shutdownManager.php | Class | main class source |
mvc-shutdown-manager-2011-05-02.zip 2KB | |
mvc-shutdown-manager-2011-05-02.tar.gz 2KB | |
Install with Composer |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
0% |
|
|
Applications that use this package |
simpleMVC.net the simpleMVC framework |
If you know an application of this package, send a message to the author to add a link here.