Nmap\Nmap::__construct PHP Метод

__construct() публичный Метод

public __construct ( ProcessExecutor $executor = null, string $outputFile = null, string $executable = 'nmap' )
$executor Nmap\Util\ProcessExecutor
$outputFile string
$executable string
    public function __construct(ProcessExecutor $executor = null, $outputFile = null, $executable = 'nmap')
    {
        $this->executor = $executor ?: new ProcessExecutor();
        $this->outputFile = $outputFile ?: sys_get_temp_dir() . '/output.xml';
        $this->executable = $executable;
        // If executor returns anything else than 0 (success exit code), throw an exeption since $executable is not executable.
        if ($this->executor->execute($this->executable . ' -h') !== 0) {
            throw new \InvalidArgumentException(sprintf('`%s` is not executable.', $this->executable));
        }
    }