File tree Expand file tree Collapse file tree 3 files changed +27
-3
lines changed
Expand file tree Collapse file tree 3 files changed +27
-3
lines changed Original file line number Diff line number Diff line change 33namespace VaasExamples ;
44
55use VaasSdk \Authentication \ClientCredentialsGrantAuthenticator ;
6+ use VaasSdk \Options \VaasOptions ;
67use VaasSdk \Vaas ;
78
89include_once ("./vendor/autoload.php " );
1415 tokenUrl: getenv ("TOKEN_URL " )
1516);
1617
18+ $ options = new VaasOptions (
19+ useHashLookup: true ,
20+ useCache: true ,
21+ vaasUrl: getenv ("VAAS_URL " ),
22+ timeout: 300
23+ );
24+
1725$ vaas = Vaas::builder ()
1826 ->withAuthenticator ($ authenticator )
27+ ->withOptions ($ options )
1928 ->build ();
2029
21-
2230$ scanPath = getenv ("SCAN_PATH " );
2331$ vaasVerdict = $ vaas ->forFileAsync ($ scanPath )->await ();
2432
Original file line number Diff line number Diff line change 33namespace VaasExamples ;
44
55use VaasSdk \Authentication \ClientCredentialsGrantAuthenticator ;
6+ use VaasSdk \Options \VaasOptions ;
67use VaasSdk \Sha256 ;
78use VaasSdk \Vaas ;
89
1516 tokenUrl: getenv ("TOKEN_URL " )
1617);
1718
19+ $ options = new VaasOptions (
20+ useHashLookup: true ,
21+ useCache: true ,
22+ vaasUrl: getenv ("VAAS_URL " ),
23+ timeout: 300
24+ );
25+
1826$ vaas = Vaas::builder ()
1927 ->withAuthenticator ($ authenticator )
28+ ->withOptions ($ options )
2029 ->build ();
2130
22-
2331// Malicious hash
2432$ vaasVerdict = $ vaas ->forSha256Async (Sha256::TryFromString ("000005c43196142f01d615a67b7da8a53cb0172f8e9317a2ec9a0a39a1da6fe8 " )->await ())->await ();
2533fwrite (STDOUT , "Verdict for $ vaasVerdict ->sha256 is " . $ vaasVerdict ->verdict ->value . " \n" );
Original file line number Diff line number Diff line change 33namespace VaasExamples ;
44
55use VaasSdk \Authentication \ClientCredentialsGrantAuthenticator ;
6+ use VaasSdk \Options \VaasOptions ;
67use VaasSdk \Vaas ;
78
89include_once ("./vendor/autoload.php " );
1415 tokenUrl: getenv ("TOKEN_URL " )
1516);
1617
18+ $ options = new VaasOptions (
19+ useHashLookup: true ,
20+ useCache: true ,
21+ vaasUrl: getenv ("VAAS_URL " ),
22+ timeout: 300
23+ );
24+
1725$ vaas = Vaas::builder ()
1826 ->withAuthenticator ($ authenticator )
27+ ->withOptions ($ options )
1928 ->build ();
2029
21-
2230// EICAR
2331$ vaasVerdict = $ vaas ->forUrlAsync ("https://secure.eicar.org/eicar.com " )->await ();
2432fwrite (STDOUT , "Verdict for $ vaasVerdict ->sha256 is " . $ vaasVerdict ->verdict ->value . " \n" );
You can’t perform that action at this time.
0 commit comments