hamedramzi / php-transmission-class

Automatically exported from code.google.com/p/php-transmission-class
0 stars 0 forks source link

Provide function to decode numeric status #2

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Attached is a diff to decode numeric status into a meaningful string.

Original issue reported on code.google.com by jo...@gormsby.com on 5 Jul 2010 at 10:13

Attachments:

GoogleCodeExporter commented 9 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.

Original comment by brycied...@gmail.com on 5 Jul 2010 at 10:33

GoogleCodeExporter commented 9 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.

Original comment by jo...@gormsby.com on 5 Jul 2010 at 10:54

GoogleCodeExporter commented 9 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.

Original comment by johan.ad...@gmail.com on 5 Jul 2010 at 11:06

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r9.

Original comment by brycied...@gmail.com on 5 Jul 2010 at 11:38

GoogleCodeExporter commented 9 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.

Original comment by brycied...@gmail.com on 5 Jul 2010 at 11:55

GoogleCodeExporter commented 9 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.

Original comment by jo...@gormsby.com on 6 Jul 2010 at 12:14

GoogleCodeExporter commented 9 years ago
Jolan, try r10.

Original comment by brycied...@gmail.com on 6 Jul 2010 at 12:22

GoogleCodeExporter commented 9 years ago
It should be public not protected; otherwise works ok, thx.

Original comment by jo...@gormsby.com on 6 Jul 2010 at 12:25

GoogleCodeExporter commented 9 years ago
Spoke too soon.  You need to add self:: to the constant checks.

Original comment by jo...@gormsby.com on 6 Jul 2010 at 12:36

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

Original comment by brycied...@gmail.com on 6 Jul 2010 at 4:03

GoogleCodeExporter commented 9 years ago
Looks good, matches what I have locally 100%.

Original comment by jo...@gormsby.com on 6 Jul 2010 at 4:07