/usr/lib/surfraw/phpdoc is in surfraw 2.2.9-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 | #!/bin/sh
# elvis: phpdoc -- Search PHP documentation (php.net)
# Author: http://jonyamo.net
. surfraw || exit 1
w3_config_hook () {
def SURFRAW_php_language "$SURFRAW_lang"
def SURFRAW_php_search "functions"
}
w3_usage_hook () {
cat <<EOF
Usage: $w3_argv0 [options] [search-string]
Description:
Surfraw search PHP documentation (php.net)
Local options:
-l, -language= Two letter language code (resembles ISO country codes)
en | English (default)
pt | Brazilian Portuguese
zh | Chinese (Simplified)
fr | French
de | German
ja | Japanese
pl | Polish
ro | Romanian
fa | Persian
es | Spanish
tr | Turkish
Environment: SURFRAW_php_language, SURFRAW_lang
Default: en
-s, -search= Specialized search on topic
all | All php.net sites
functions | Function search
manual | Online documentation
bugs | Bug database
news | News archive
changelogs | Changelogs
pear | Just pear.php.net
pecl | Just pecl.php.net
talks | Just talks.php.net
maillist | General mailing list
devlist | Developer mailing list
phpdoc | Documentation mailing list
Environment: SURFRAW_php_search
Default: functions
-a, -all alias of -search=all
-f, -functions alias of -search=functions
-m, -manual alias of -search=manual
-b, -bugs alias of -search=bugs
-n, -news alias of -search=news
-c, -changelogs alias of -search=changelogs
-t, -talks alias of -search=talks
-maillist alias of -search=maillist
-devlist alias of -search=devlist
-phpdoc alias of -search=phpdoc
EOF
w3_global_usage
}
w3_parse_option_hook () {
opt="$1"
optarg="$2"
case "$opt" in
-language=*) setopt SURFRAW_php_language "$optarg" ;;
-l=*) setopt SURFRAW_php_language "$optarg" ;;
-search=*) setopt SURFRAW_php_search "$optarg" ;;
-s=*) setopt SURFRAW_php_search "$optarg" ;;
-a|-all) setopt SURFRAW_php_search "all" ;;
-f|-functions) setopt SURFRAW_php_search "functions" ;;
-m|-manual) setopt SURFRAW_php_search "manual" ;;
-b|-bugs) setopt SURFRAW_php_search "bugs" ;;
-n|-news) setopt SURFRAW_php_search "news" ;;
-c|-changelogs) setopt SURFRAW_php_search "changelogs" ;;
-t|-talks) setopt SURFRAW_php_search "talks" ;;
-maillist) setopt SURFRAW_php_search "maillist" ;;
-devlist) setopt SURFRAW_php_search "devlist" ;;
-phpdoc) setopt SURFRAW_php_search "phpdoc" ;;
*) return 1 ;;
esac
return 0
}
w3_config
w3_parse_args "$@"
# w3_args now contains a list of arguments
url="http://php.net/"
case "$SURFRAW_php_language" in
en) lang="en" ;;
pt) lang="pt_BR" ;;
zh) lang="zh" ;;
fr) lang="fr" ;;
de) lang="de" ;;
ja) lang="ja" ;;
pl) lang="pl" ;;
ro) lang="ro" ;;
fa) lang="fa" ;;
es) lang="es" ;;
tr) lang="tr" ;;
*) lang="en" ;;
esac
case "$SURFRAW_php_search" in
all) search="all" ;;
functions) search="quickref" ;;
manual) search="manual" ;;
bugs) search="bugdb" ;;
news) search="news_archive" ;;
changelogs) search="changelogs" ;;
pear) search="pear" ;;
pecl) search="pecl" ;;
talks) search="talks" ;;
maillist) search="maillist" ;;
devlist) search="devlist" ;;
phpdoc) search="phpdoc" ;;
*) search="functions" ;;
esac
if [ -n "$w3_args" ]; then
escaped_args=$(w3_url_of_arg $w3_args)
url="${url}search.php?lang=${lang}&show=${search}&pattern=${escaped_args}"
fi
w3_browse_url "$url"
|