gslist is an executable so the only thing you need is launching it.
php supports some ways to execute commands like
http://it2.php.net/system so after the execution of gslist then it's only needd to parse the file created with the -o option of the tool