<?php
include "sapb1.phar"; 
use SAPb1\SAPClient;

try {
    $sap = Null;
    function Login() {
 

        $config = [
            "https" => true,
            "host" => "192.168.1.77",
            "port" => 50000,
            "sslOptions" => [
                //"cafile" => "C:\Program Files\SAP\SAP Business One ServerTools\ServiceLayer\Conf\server.crt",                                               
                "verify_peer" => false,
                "verify_peer_name" => false,
            ],
            "version" => 1
        ];
        
        $sap = SAPClient::createSession($config, "manager", "bpsmaroc", "TEST_DB_CM");
        return $sap;
    }


} catch (Exception $e) {
    echo $e->getMessage();    
}