In these two examples
https://github.com/nette/examples/blob/master/CD-collection/app/bootstrap.php#L31
https://github.com/nette/examples/blob/master/Modules-Usage/app/bootstrap.php#L32
function apache_get_modules is used to detect mod_rewrite, but this is not reliable way, because this works only when PHP is installed as an Apache module. So it doesn't work with fastCGI, FPM or nginx configurations.