Source for file dict.php
Documentation is available at dict.php
require 'Console/Getopt.php';
$longOptions = array ('help', 'match=', 'databases', 'strategies',
'info=', 'server', 'status');
$con = new Console_Getopt;
$args = $con->readPHPArgv ();
$options = $con->getopt($args, '', $longOptions);
if (PEAR ::isError ($options)) {
die ($options->getMessage ());
Usage: dict [OPTIONS] keyword
--help Prints this help screen
--matches=word Show DB matches for word
--strategies Show Strategy list
--info=DATABASE Show Info on DB
--server Show Server Info
if ('--help' == $options[0 ][0 ][0 ] or ( empty ($options[0 ][0 ][0 ]) and empty ($options[1 ][0 ]) ) ) help();
if (PEAR ::isError ($conn)) {
die ($conn->getMessage ());
if (!empty ($options[1 ][0 ])) {
foreach ($options[1 ] as $keyword) {
if (PEAR ::isError ($defs)) {
die ($defs->getMessage ());
foreach ($defs as $def) {
switch ($options[0 ][0 ][0 ]) {
foreach($d->match ($options[0 ][0 ][1 ]) as $matches)
echo $matches['database'] . ' : ' . $matches['word'] . "\n";
foreach ($d->showDatabases () as $db)
echo $db['database'] . ' : ' . $db['description']. "\n";
foreach ($d->showStrategies () as $strat)
echo $strat['strategy'] . ' : ' . $strat['description'] . "\n";
$info = $d->showInfo ($options[0 ][0 ][1 ]);
if (PEAR ::isError ($info))
die ($info->getMessage ());
$server = $d->showServer ();
if (PEAR ::isError ($server))
die ($server->getMessage ());
Documentation generated on Mon, 11 Mar 2019 15:41:17 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|