Community discussions

MikroTik App
 
User avatar
skot
Long time Member
Long time Member
Topic Author
Posts: 584
Joined: Wed Nov 30, 2011 3:05 am

PHP API - documentation suggestion

Wed Jan 14, 2015 9:10 am

boen_robot,

I recently enjoyed using your PHP client for a project. Initially the documentation seemed a bit confusing, so I have a couple suggestions.

I went for the quickest setup method, which was using the .phar file, but the wiki left me scratching my head as including the phar file did not make my code work.
require_once 'PEAR2_Net_RouterOS-1.0.0b5.phar';
After some hunting around, I finally figured out I had to include the following line also:
use PEAR2\Net\RouterOS;
...which I now realize was what it was talking about in the phar section of the wiki, but being a PHP novice, I didn't know what that meant :) It would be helpful if that was explicitly stated.


On another note, the usage examples initially confused me as they did not include a password during the connection. It would be helpful to show the password too:
$client = new \PEAR2\Net\RouterOS\Client('example.com', 'admin', 'password');
Thanks!
 
User avatar
boen_robot
Forum Guru
Forum Guru
Posts: 2400
Joined: Thu Aug 31, 2006 4:43 pm
Location: europe://Bulgaria/Plovdiv

Re: PHP API - documentation suggestion

Wed Jan 14, 2015 1:26 pm

Thank you for the suggestions.

I'll see what I can do... I've been meaning to redo a lot of that section, but I always find myself writing things like the "use" part twice or more times, which I'd think is ultimately insulting to most readers ("OK, ok... a use statement... got you the first time! Stop repeating yourself man!" :lol: ).
 
User avatar
skot
Long time Member
Long time Member
Topic Author
Posts: 584
Joined: Wed Nov 30, 2011 3:05 am

Re: PHP API - documentation suggestion

Wed Jan 14, 2015 6:23 pm

The updates you made look good. Thanks :D