(Bug 37957) Replace php_sapi_name() with PHP_SAPI

The PHP_SAPI constant has been available since PHP 4.2.0. It's more
concise to use the constant and has less overhead than a function call.

Furthermore, PHP_SAPI rhymes with "happy", whereas "php_sapi_name"
rhymes with "lame". QED, etc.

Change-Id: Ie8c121cb8fcef50536af8d3f66723b458f0bf9af