initial commit

This commit is contained in:
kristuff 2020-05-14 21:23:51 +02:00
commit eff0ac03cb
3 changed files with 11 additions and 4 deletions

View file

@ -4,6 +4,8 @@
see [kristuff/abuseipdb-cli](https://github.com/kristuff/abuseipdb-cli) for the CLI version see [kristuff/abuseipdb-cli](https://github.com/kristuff/abuseipdb-cli) for the CLI version
***under construction, for now, just check part is implemented***
Requirements Requirements
------------ ------------
- PHP >= 7.1 - PHP >= 7.1

View file

@ -87,7 +87,7 @@ abstract class ApiDefintion
'hack' => ['15', 'Hacking', false], 'hack' => ['15', 'Hacking', false],
// Attempts at SQL injection. // Attempts at SQL injection.
'sql' => ['16', 'SQL Injection'], true, 'sql' => ['16', 'SQL Injection', true],
// Email sender spoofing. // Email sender spoofing.
'spoof' => ['17', 'Spoofing', true], 'spoof' => ['17', 'Spoofing', true],

View file

@ -79,7 +79,9 @@ class ApiManager extends ApiDefintion
return array( return array(
'userId' => $this->aipdbUserId, 'userId' => $this->aipdbUserId,
'apiKey' => $this->aipdbApiKey, 'apiKey' => $this->aipdbApiKey,
'selfIps' => $this->selfIps,
// TODO 'selfIps' => $this->selfIps,
// TODO default report cat
); );
} }
@ -92,11 +94,14 @@ class ApiManager extends ApiDefintion
* *
* @return \Kristuff\AbuseIPDB\ApiManager * @return \Kristuff\AbuseIPDB\ApiManager
*/ */
public static function fromConfigstring(string $configPath) public static function fromConfigFile(string $configPath)
{ {
//todo check file exist //todo check file exist
$config = self::loadJsonFile($configPath); $config = self::loadJsonFile($configPath);
return new ApiManager($config->api_key, $config->user_id, $config->self_ips);
// TODO $config->self_ips
// TODO other options
return new ApiManager($config->api_key, $config->user_id);
} }
/** /**