brycied00d / PHP-Transmission-Class

PHP Class for the Transmission Daemon RPC interface
http://code.google.com/p/php-transmission-class/
GNU General Public License v3.0
104 stars 47 forks source link

Provide function to decode numeric status #2

Closed brycied00d closed 12 years ago

brycied00d commented 12 years ago

Attached is a diff to decode numeric status into a meaningful string.

Google Code Info: Issue #: 2 Author: jo...@gormsby.com Created On: 2010-07-05T22:13:19.000Z Closed On: 2010-07-05T23:38:00.000Z

brycied00d commented 12 years ago

I'll tentatively add this in, but I think we should consider whether class TransmissionRPC is a pass-through interface that leaves interpretation of the responses to the application.

Google Code Info: Author: brycied...@gmail.com Created On: 2010-07-05T22:33:51.000Z

brycied00d commented 12 years ago

Understood, I had the same question in my mind before submitting the diff.

Let me know what direction you decide to go in. I also have some functions to humanize the values of haveValid/totalSize and rateDownload a la transmission-remote.

Google Code Info: Author: jo...@gormsby.com Created On: 2010-07-05T22:54:23.000Z

brycied00d commented 12 years ago

I agree, maybe we should add a toobox class to handle these things. Or a small class with constants describing the status codes.

Google Code Info: Author: johan.ad...@gmail.com Created On: 2010-07-05T23:06:49.000Z

brycied00d commented 12 years ago

This issue was closed by revision r9.

Google Code Info: Author: brycied...@gmail.com Created On: 2010-07-05T23:38:00.000Z

brycied00d commented 12 years ago

Jolan, As you can see, I tossed it in for now along with defining the states as const's (I borrowed the names from transmission.h)

Johan, I'm thinking a class Transmission() that extends TransmissionRPC(). I'll take up this discussion in a wiki page.

Google Code Info: Author: brycied...@gmail.com Created On: 2010-07-05T23:55:05.000Z

brycied00d commented 12 years ago

I'm getting a parse error w/r9 using php v5.2.13 fcgi:

Parse error: syntax error, unexpected '(' in /fr/www/TransmissionRPC.class.php on line 108

I don't see any obvious reason for the error.

Google Code Info: Author: jo...@gormsby.com Created On: 2010-07-06T00:14:44.000Z

brycied00d commented 12 years ago

Jolan, try r10.

Google Code Info: Author: brycied...@gmail.com Created On: 2010-07-06T00:22:36.000Z

brycied00d commented 12 years ago

It should be public not protected; otherwise works ok, thx.

Google Code Info: Author: jo...@gormsby.com Created On: 2010-07-06T00:25:22.000Z

brycied00d commented 12 years ago

Spoke too soon. You need to add self:: to the constant checks.

Google Code Info: Author: jo...@gormsby.com Created On: 2010-07-06T00:36:45.000Z

brycied00d commented 12 years ago

Jolan, check out the latest revision (r11 I think), fixed the self:: references and public/protected.

Google Code Info: Author: brycied...@gmail.com Created On: 2010-07-06T04:03:46.000Z

brycied00d commented 12 years ago

Looks good, matches what I have locally 100%.

Google Code Info: Author: jo...@gormsby.com Created On: 2010-07-06T04:07:15.000Z