I think it should be improved to support anonymous functions… :rolleyes:

Cause to make it work with sessions you really need to write ugly code with ternary operators …

maintenance task is a very basic, thus it should be more elegant and not like hacking :)

Could you provide some example what exactly you mean?

There is a built-in method called "missingAction".

This method will handle all HTTP request without defined action. You can write whatever you want inside function. How would you improve it?


catchAllRequest in yii if it is not set to null, catch all requests and do something…

this is useful for creating maintenance for example…

but it is not that flexible… and you can work with it only with ternary operators…

$_SERVER[‘MAINTENANCE’] ? … : null

… =

session_start() && isset($_SESSION[‘adminSession’]) ? null : site/maintenance