Use drupal_is_cli instead of php_sapi_name.
Merge pull request #13 from Ozmodiar/11-cli

Use drupal_is_cli instead of php_sapi_name.