pmill / php-plesk

A PHP client for the Plesk RPC API.
38 stars 37 forks source link

Add support for get_traffic #37

Closed nahanil closed 8 years ago

nahanil commented 8 years ago

Heya, have hacked this together. Forgive me if I've done it 'the wrong way' but it seems to work. Docs I referenced are at http://download1.parallels.com/Plesk/PP12/12.0/Doc/fr-FR/online/plesk-api-rpc/index.htm?fileName=33929.htm

Pass it one of ['name', 'owner-id', 'owner-login', 'guid', 'id'] And optionally either or both of since_date/to_date. You can see what I mean in examples/get_traffic.php

"Dates" are simple strings, YYYY-MM-DD. Not sure if it should accept/return this and/or a DateTime object instead.

Also not sure if the GetTraffic class should override BaseRequest's checkResponse method to check error_code/error_text in the response... Doesn't look like any of the other classes do this...

Lemme know your thoughts :)