LScli :: handle_args() : check CLI context

This commit is contained in:
Benjamin Renard 2020-05-06 18:01:16 +02:00
parent 4bed3e6c17
commit 9028414568

View file

@ -113,6 +113,10 @@ class LScli {
* @retval void * @retval void
**/ **/
public static function handle_args() { public static function handle_args() {
if (php_sapi_name() != "cli") {
LSlog :: fatal('Try to use LScli :: handle_args() in non-CLI context.');
return;
}
global $argv; global $argv;
$log_level = 'INFO'; $log_level = 'INFO';
$ldap_server_id = false; $ldap_server_id = false;