Menu

Diff of /trunk/php-mode-src/php-mode.el [r8] .. [r9]  Maximize  Restore

Switch to unified view

a/trunk/php-mode-src/php-mode.el b/trunk/php-mode-src/php-mode.el
...
...
3
;; Copyright (C) 1999-2004 Turadg Aleahmad
3
;; Copyright (C) 1999-2004 Turadg Aleahmad
4
4
5
;; Maintainer: Turadg Aleahmad <turadg at users.sourceforge.net>
5
;; Maintainer: Turadg Aleahmad <turadg at users.sourceforge.net>
6
;; Keywords: php languages oop
6
;; Keywords: php languages oop
7
;; Created: 1999-05-17
7
;; Created: 1999-05-17
8
;; Modified: 2004-01-24
8
;; Modified: 2005-07-27
9
;; X-URL:   http://php-mode.sourceforge.net/
9
;; X-URL:   http://php-mode.sourceforge.net/
10
10
11
(defconst php-version "1.1.0"
11
(defconst php-version "1.2.0"
12
  "PHP Mode version number.")
12
  "PHP Mode version number.")
13
13
14
;;; License
14
;;; License
15
15
16
;; This program is free software; you can redistribute it and/or
16
;; This program is free software; you can redistribute it and/or
17
;; modify it under the terms of the GNU General Public License
17
;; modify it under the terms of the GNU General Public License
18
;; as published by the Free Software Foundation; either version 2
18
;; as published by the Free Software Foundation; either version 2
19
;; of the License, or (at your option) any later version.
19
;; of the License, or (at your option) any later version.
20
20
21
;; This program is distributed in the hope that it will be useful,
21
;; This program is distributed in the hope that it will be useful,
22
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
22
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
23
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24
;; GNU General Public License for more details.
24
;; GNU General Public License for more details.
25
25
26
;; You should have received a copy of the GNU General Public License
26
;; You should have received a copy of the GNU General Public License
27
;; along with this program; if not, write to the Free Software
27
;; along with this program; if not, write to the Free Software
28
;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
28
;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
29
29
30
;;; Usage
30
;;; Usage
31
31
32
;; Rename this file to php-mode.el if it isn't already then place it in
32
;; Rename this file to php-mode.el if it isn't already then place it in
33
;; your Emacs lisp path (eg. site-lisp) and add to your .emacs file:
33
;; your Emacs lisp path (eg. site-lisp) and add to your .emacs file:
34
;;   (require 'php-mode)
34
;;   (require 'php-mode)
35
35
36
;; If you want colorization, turn on global-font-lock or
36
;; If you want colorization, turn on global-font-lock or
37
;; add this to your .emacs:
37
;; add this to your .emacs:
38
;;   (add-hook 'php-mode-user-hook 'turn-on-font-lock)
38
;;   (add-hook 'php-mode-user-hook 'turn-on-font-lock)
39
39
40
;; To use abbrev-mode, add lines like this:
40
;; To use abbrev-mode, add lines like this:
41
;;   (add-hook 'php-mode-user-hook
41
;;   (add-hook 'php-mode-user-hook
42
;;     '(lambda () (define-abbrev php-mode-abbrev-table "ex" "extends")))
42
;;     '(lambda () (define-abbrev php-mode-abbrev-table "ex" "extends")))
43
43
44
;; To make php-mode compatible with html-mode, see http://php-mode.sf.net
44
;; To make php-mode compatible with html-mode, see http://php-mode.sf.net
45
45
46
;; Many options available under Help:Customize
46
;; Many options available under Help:Customize
47
;; Options specific to php-mode are in
47
;; Options specific to php-mode are in
48
;;  Programming/Languages/Php
48
;;  Programming/Languages/Php
49
;; Since it inherits much functionality from c-mode, look there too
49
;; Since it inherits much functionality from c-mode, look there too
50
;;  Programming/Languages/C
50
;;  Programming/Languages/C
51
51
52
;;; Commentary:
52
;;; Commentary:
53
53
54
;; PHP mode is a major mode for editing PHP 3 and 4 source code.  It's
54
;; PHP mode is a major mode for editing PHP 3 and 4 source code.  It's
55
;; an extension of C mode; thus it inherits all C mode's navigation
55
;; an extension of C mode; thus it inherits all C mode's navigation
56
;; functionality.  But it colors according to the PHP grammar and indents
56
;; functionality.  But it colors according to the PHP grammar and indents
57
;; according to the PEAR coding guidelines.  It also includes a couple
57
;; according to the PEAR coding guidelines.  It also includes a couple
58
;; handy IDE-type features such as documentation search and a source
58
;; handy IDE-type features such as documentation search and a source
59
;; and class browser.
59
;; and class browser.
60
60
61
61
62
;;; Contributors: (in chronological order)
62
;;; Contributors: (in chronological order)
63
63
64
;; Juanjo, Torsten Martinsen, Vinai Kopp, Sean Champ, Doug Marcey,
64
;; Juanjo, Torsten Martinsen, Vinai Kopp, Sean Champ, Doug Marcey,
65
;; Kevin Blake, Rex McMaster, Mathias Meyer, Boris Folgmann, Roland
65
;; Kevin Blake, Rex McMaster, Mathias Meyer, Boris Folgmann, Roland
66
;; Rosenfeld, Fred Yankowski, Craig Andrews, John Keller, Ryan
66
;; Rosenfeld, Fred Yankowski, Craig Andrews, John Keller, Ryan
67
;; Sammartino, ppercot, Valentin Funk, Stig Bakken, Gregory Stark,
67
;; Sammartino, ppercot, Valentin Funk, Stig Bakken, Gregory Stark,
68
;; Chris Morris, Nils Rennebarth, Gerrit Riessen, Eric Mc Sween,
68
;; Chris Morris, Nils Rennebarth, Gerrit Riessen, Eric Mc Sween,
69
;; Ville Skytta, Giacomo Tesio
69
;; Ville Skytta, Giacomo Tesio
70
70
71
;;; Changelog:
71
;;; Changelog:
72
72
73
;; 1.1
73
;; 1.2
74
;;   Added PHP5 support (Giacomo Tesio)
74
;;   Implemented php-show-arglist, C-. (Engelke Eschner)
75
;;     known problem: doesn't highlight after first 'implements'
75
;;   Implemented php-complete-function, M-tab (Engelke Eschner)
76
;;   Better XEmacs compatibility (imenu, regexp, and comments!) (Ville Skytta)
76
;;   Re-enabled # comment detection in GNU Emacs (Urban Müller)
77
;;   Improvement to php-conditional-key regexp (Eric Mc Sween)
77
;;   Fixed some keybindings and default settings (Engelke Eschner)
78
78
79
;; 1.05
79
;; 1.1
80
;;   Incorporated speedbar defs by Gerrit Riessen
80
;;   Added PHP5 support (Giacomo Tesio)
81
;;   Add "foreach" to conditional introducing keywords (Nils Rennebarth)
81
;;     known problem: doesn't highlight after first 'implements'
82
;;   Cleared the Changelog
82
;;   Better XEmacs compatibility (imenu, regexp, and comments!) (Ville Skytta)
83
;;   Moved contribution credits into comments above
83
;;   Improvement to php-conditional-key regexp (Eric Mc Sween)
84
84
85
85
;; 1.05
86
;;; Code:
86
;;   Incorporated speedbar defs by Gerrit Riessen
87
87
;;   Add "foreach" to conditional introducing keywords (Nils Rennebarth)
88
(require 'speedbar)
88
;;   Cleared the Changelog
89
(require 'font-lock)
89
;;   Moved contribution credits into comments above
90
(require 'cc-mode)
90
91
(require 'custom)
91
92
(eval-when-compile
92
;;; Code:
93
  (require 'regexp-opt))
93
94
94
(require 'speedbar)
95
;; Local variables
95
(require 'font-lock)
96
(defgroup php nil
96
(require 'cc-mode)
97
  "Major mode for editing PHP code."
97
(require 'custom)
98
  :prefix "php-"
98
(require 'etags)
99
  :group 'languages)
99
(eval-when-compile
100
100
  (require 'regexp-opt))
101
(defcustom php-speedbar-config t
101
102
  "*When set to true automatically configures Speedbar to observe PHP files.\
102
;; Local variables
103
Ignores php-file patterns option; fixed to expression \"\\.\\(inc\\|php[s34]?\\)\""
103
(defgroup php nil
104
  :type 'boolean
104
  "Major mode for editing PHP code."
105
  :group 'php)
105
  :prefix "php-"
106
106
  :group 'languages)
107
(defcustom php-mode-speedbar-open nil
107
108
  "Normally php-mode starts with the speedbar closed.\
108
(defcustom php-speedbar-config t
109
Turning this on will open it whenever php-mode is loaded."
109
  "*When set to true automatically configures Speedbar to observe PHP files.\
110
  :type 'boolean
110
Ignores php-file patterns option; fixed to expression \"\\.\\(inc\\|php[s34]?\\)\""
111
  :group 'php)
111
  :type 'boolean
112
112
  :group 'php)
113
(defcustom php-manual-url "http://www.php.net/manual/en/manual.php"
113
114
  "*URL at which to find PHP manual.\
114
(defcustom php-mode-speedbar-open nil
115
You can replace \"en\" with your ISO language code."
115
  "Normally php-mode starts with the speedbar closed.\
116
  :type 'string
116
Turning this on will open it whenever php-mode is loaded."
117
  :group 'php)
117
  :type 'boolean
118
118
  :group 'php)
119
(defcustom php-search-url "http://www.php.net/"
119
120
  "*URL at which to search for documentation on a word"
120
(defcustom php-manual-url "http://www.php.net/manual/en/"
121
  :type 'string
121
  "*URL at which to find PHP manual.\
122
  :group 'php)
122
You can replace \"en\" with your ISO language code."
123
123
  :type 'string
124
;;;###autoload
124
  :group 'php)
125
(defcustom php-file-patterns (list "\\.php[s34]?\\'" "\\.phtml\\'" "\\.inc\\'")
125
126
  "*List of file patterns for which to automatically invoke php-mode."
126
(defcustom php-search-url "http://www.php.net/"
127
  :type '(repeat (regexp :tag "Pattern"))
127
  "*URL at which to search for documentation on a word"
128
  :group 'php)
128
  :type 'string
129
129
  :group 'php)
130
(defcustom php-mode-user-hook nil
130
131
  "List of functions to be executed on entry to php-mode"
131
(defcustom php-completion-file ""
132
  :type 'hook
132
  "*Path to the file which contains the function names known to PHP"
133
  :group 'php)
133
  :type 'string
134
134
  :group 'php)
135
(defcustom php-mode-force-pear nil
135
136
  "Normally PEAR coding rules are enforced only when the filename contains \"PEAR\"\
136
(defcustom php-manual-path ""
137
Turning this on will force PEAR rules on all PHP files."
137
  "*Path to the directory which contains the PHP manual"
138
  :type 'boolean
138
  :type 'string
139
  :group 'php)
139
  :group 'php)
140
140
141
;; Note whether we're in XEmacs
141
;;;###autoload
142
(defconst xemacsp (string-match "Lucid\\|XEmacs" emacs-version)
142
(defcustom php-file-patterns (list "\\.php[s34]?\\'" "\\.phtml\\'" "\\.inc\\'")
143
  "Non nil if using XEmacs.")
143
  "*List of file patterns for which to automatically invoke php-mode."
144
144
  :type '(repeat (regexp :tag "Pattern"))
145
;;;###autoload
145
  :group 'php)
146
(define-derived-mode php-mode c-mode "PHP"
146
147
  "Major mode for editing PHP code.\n\n\\{php-mode-map}"
147
(defcustom php-mode-user-hook nil
148
  
148
  "List of functions to be executed on entry to php-mode"
149
  (setq comment-start "// "
149
  :type 'hook
150
    comment-end   ""
150
  :group 'php)
151
    comment-start-skip "// *")
151
152
  
152
(defcustom php-mode-force-pear nil
153
  (setq c-class-key php-class-key)
153
  "Normally PEAR coding rules are enforced only when the filename contains \"PEAR\"\
154
  (setq c-conditional-key php-conditional-key)
154
Turning this on will force PEAR rules on all PHP files."
155
155
  :type 'boolean
156
  (defvar php-mode-syntax-table php-mode-syntax-table)
156
  :group 'php)
157
  ;; this line makes $ into punctuation instead of a word constituent
157
158
  ;; it used to be active, but it killed indenting of case lines that
158
(defvar php-completion-table nil
159
  ;; begin with '$' (many do).  If anyone has a solution to this
159
  "Obarray of tag names defined in current tags table and functions know to PHP.")
160
  ;; problem, please let me know.  Of course, you're welcome to
160
161
  ;; uncomment this line in your installation.
161
;; Note whether we're in XEmacs
162
;  (modify-syntax-entry ?$ "." php-mode-syntax-table)
162
(defconst xemacsp (string-match "Lucid\\|XEmacs" emacs-version)
163
  
163
  "Non nil if using XEmacs.")
164
  ;; The above causes XEmacs to handle shell-style comments correctly,
164
165
  ;; but fails to work in GNU Emacs which fails to interpret \n as the
165
;;;###autoload
166
  ;; end of the comment.
166
(define-derived-mode php-mode c-mode "PHP"
167
  (if xemacsp (progn
167
  "Major mode for editing PHP code.\n\n\\{php-mode-map}"
168
        (modify-syntax-entry ?# "< b" php-mode-syntax-table)
168
169
        (modify-syntax-entry ?\n "> b" php-mode-syntax-table)
169
  (setq comment-start "// "
170
        ))
170
    comment-end   ""
171
  
171
    comment-start-skip "// *")
172
  (make-local-variable 'font-lock-defaults)
172
173
  (setq font-lock-defaults
173
  (setq c-class-key php-class-key)
174
    '((php-font-lock-keywords-1
174
  (setq c-conditional-key php-conditional-key)
175
       php-font-lock-keywords-2
175
176
       ;; Comment-out the next line if the font-coloring is too
176
  (defvar php-mode-syntax-table php-mode-syntax-table)
177
       ;; extreme/ugly for you.
177
  ;; this line makes $ into punctuation instead of a word constituent
178
       php-font-lock-keywords-3
178
  ;; it used to be active, but it killed indenting of case lines that
179
       )
179
  ;; begin with '$' (many do).  If anyone has a solution to this
180
      nil               ; KEYWORDS-ONLY
180
  ;; problem, please let me know.  Of course, you're welcome to
181
      T             ; CASE-FOLD
181
  ;; uncomment this line in your installation.
182
      nil               ; SYNTAX-ALIST
182
;  (modify-syntax-entry ?$ "." php-mode-syntax-table)
183
      nil               ; SYNTAX-BEGIN
183
184
      (font-lock-syntactic-keywords . php-font-lock-syntactic-keywords)))
184
  ;; The above causes XEmacs to handle shell-style comments correctly,
185
  
185
  ;; but fails to work in GNU Emacs which fails to interpret \n as the
186
  (setq font-lock-maximum-decoration t
186
  ;; end of the comment.
187
    case-fold-search t      ; PHP vars are case-sensitive
187
  (if xemacsp (progn
188
    imenu-generic-expression php-imenu-generic-expression)
188
                (modify-syntax-entry ?# "< b" php-mode-syntax-table)
189
  
189
                (modify-syntax-entry ?\n "> b" php-mode-syntax-table)))
190
  ;; Do not force newline at end of file.  Such newlines can cause
190
191
  ;; trouble if the PHP file is included in another file before calls
191
  (make-local-variable 'font-lock-defaults)
192
  ;; to header() or cookie().
192
  (setq font-lock-defaults
193
  (set (make-local-variable 'require-final-newline) nil)
193
        '((php-font-lock-keywords-1
194
  (set (make-local-variable 'next-line-add-newlines) nil)
194
           php-font-lock-keywords-2
195
  
195
           ;; Comment-out the next line if the font-coloring is too
196
  ;; PEAR coding standards
196
           ;; extreme/ugly for you.
197
  (make-local-hook 'php-mode-pear-hook)
197
           php-font-lock-keywords-3)
198
  (add-hook 'php-mode-pear-hook
198
          nil                               ; KEYWORDS-ONLY
199
        (lambda nil (set (make-local-variable 'tab-width) 4)) nil t)
199
          T                                 ; CASE-FOLD
200
  (add-hook 'php-mode-pear-hook
200
          nil                               ; SYNTAX-ALIST
201
        (lambda nil (set (make-local-variable 'c-basic-offset) 4)) nil t)
201
          nil                               ; SYNTAX-BEGIN
202
  (add-hook 'php-mode-pear-hook
202
          (font-lock-syntactic-keywords . php-font-lock-syntactic-keywords)))
203
        (lambda nil (set (make-local-variable 'c-hanging-comment-ender-p) nil)) nil t)
203
204
  (add-hook 'php-mode-pear-hook
204
  (setq font-lock-maximum-decoration t
205
        (lambda nil (set (make-local-variable 'indent-tabs-mode) nil)) nil t)
205
        case-fold-search t              ; PHP vars are case-sensitive
206
  (add-hook 'php-mode-pear-hook
206
        imenu-generic-expression php-imenu-generic-expression)
207
        (lambda nil (c-set-offset 'block-open' - )) nil t)
207
208
  (add-hook 'php-mode-pear-hook
208
  ;; Do not force newline at end of file.  Such newlines can cause
209
        (lambda nil (c-set-offset 'block-close' 0 )) nil t)
209
  ;; trouble if the PHP file is included in another file before calls
210
210
  ;; to header() or cookie().
211
  (if (or php-mode-force-pear
211
  (set (make-local-variable 'require-final-newline) nil)
212
      (and (stringp buffer-file-name)
212
  (set (make-local-variable 'next-line-add-newlines) nil)
213
           (string-match "PEAR\\|pear"
213
214
                 (buffer-file-name))
214
  ;; PEAR coding standards
215
           (string-match "\\.php$" (buffer-file-name))))
215
  (make-local-hook 'php-mode-pear-hook)
216
      (run-hooks 'php-mode-pear-hook))
216
  (add-hook 'php-mode-pear-hook
217
  
217
        (lambda nil (set (make-local-variable 'tab-width) 4)) nil t)
218
  (run-hooks 'php-mode-user-hook)
218
  (add-hook 'php-mode-pear-hook
219
  )
219
        (lambda nil (set (make-local-variable 'c-basic-offset) 4)) nil t)
220
220
  (add-hook 'php-mode-pear-hook
221
;; Make php-mode the default mode for PHP source code buffers.
221
        (lambda nil (set (make-local-variable 'c-hanging-comment-ender-p) nil)) nil t)
222
;;;###autoload
222
  (add-hook 'php-mode-pear-hook
223
(let ((php-file-patterns-temp php-file-patterns))
223
        (lambda nil (set (make-local-variable 'indent-tabs-mode) nil)) nil t)
224
  (while php-file-patterns-temp
224
  (add-hook 'php-mode-pear-hook
225
    (add-to-list 'auto-mode-alist
225
        (lambda nil (c-set-offset 'block-open' - )) nil t)
226
          (cons (car php-file-patterns-temp) 'php-mode))
226
  (add-hook 'php-mode-pear-hook
227
    (setq php-file-patterns-temp (cdr php-file-patterns-temp))))
227
        (lambda nil (c-set-offset 'block-close' 0 )) nil t)
228
228
229
;; Handle Speedbar
229
  (if (or php-mode-force-pear
230
(if php-mode-speedbar-open
230
          (and (stringp buffer-file-name)
231
    (speedbar 1))
231
               (string-match "PEAR\\|pear"
232
(if (and php-speedbar-config (symbolp 'speedbar))
232
                             (buffer-file-name))
233
    (speedbar-add-supported-extension "\\.\\(inc\\|php[s34]?\\)"))
233
               (string-match "\\.php$" (buffer-file-name))))
234
234
      (run-hooks 'php-mode-pear-hook))
235
;; Make a menu keymap (with a prompt string)
235
  
236
;; and make it the menu bar item's definition.
236
  (run-hooks 'php-mode-user-hook))
237
(define-key php-mode-map [menu-bar] (make-sparse-keymap))
237
238
(define-key php-mode-map [menu-bar php]
238
;; Make php-mode the default mode for PHP source code buffers.
239
  (cons "PHP" (make-sparse-keymap "PHP")))
239
;;;###autoload
240
240
(let ((php-file-patterns-temp php-file-patterns))
241
;; Define specific subcommands in this menu.
241
  (while php-file-patterns-temp
242
(define-key php-mode-map [menu-bar php complete-function]
242
    (add-to-list 'auto-mode-alist
243
  '("Complete function name" . php-complete-function))
243
          (cons (car php-file-patterns-temp) 'php-mode))
244
(define-key php-mode-map
244
    (setq php-file-patterns-temp (cdr php-file-patterns-temp))))
245
  [menu-bar php browse-manual]
245
246
  '("Browse manual" . php-browse-manual))
246
;; Handle Speedbar
247
(define-key php-mode-map
247
(if php-mode-speedbar-open
248
  [menu-bar php search-documentation]
248
    (speedbar 1))
249
  '("Search documentation" . php-search-documentation))
249
(if (and php-speedbar-config (symbolp 'speedbar))
250
250
    (speedbar-add-supported-extension "\\.\\(inc\\|php[s34]?\\)"))
251
;; Define function name completion function
251
252
(defun php-complete-function ()
252
;; Make a menu keymap (with a prompt string)
253
  "Complete the function name at the point from known PHP functions."
253
;; and make it the menu bar item's definition.
254
  (interactive)
254
(define-key php-mode-map [menu-bar] (make-sparse-keymap))
255
  (message "php-complete-function not implemented yet")
255
(define-key php-mode-map [menu-bar php]
256
  ;; how to read the list of functions from a separate file?
256
  (cons "PHP" (make-sparse-keymap "PHP")))
257
  )
257
258
258
;; Define specific subcommands in this menu.
259
;; Define function documentation function
259
(define-key php-mode-map [menu-bar php complete-function]
260
(defun php-search-documentation ()
260
  '("Complete function name" . php-complete-function))
261
  "Search PHP documentation for the word at the point."
261
(define-key php-mode-map
262
  (interactive)
262
  [menu-bar php browse-manual]
263
  (browse-url (concat php-search-url (current-word t)))
263
  '("Browse manual" . php-browse-manual))
264
  )
264
(define-key php-mode-map
265
265
  [menu-bar php search-documentation]
266
;; Define function for browsing manual
266
  '("Search documentation" . php-search-documentation))
267
(defun php-browse-manual ()
267
268
  "Bring up manual for PHP."
268
;; Define function name completion function
269
  (interactive)
269
(defun php-complete-function ()
270
  (browse-url php-manual-url)
270
  "Perform function completion on the text around point.
271
  )
271
Completes to the set of names listed in the current tags table
272
272
and the standard php functions.
273
;; Define shortcut
273
The string to complete is chosen in the same way as the default
274
(define-key php-mode-map
274
for \\[find-tag] (which see)."
275
  "\C-c\C-f"
275
  (interactive)
276
  'php-search-documentation)
276
  (let ((pattern (php-get-pattern))
277
277
        beg
278
;; Define shortcut
278
        completion
279
(define-key php-mode-map
279
        (php-functions (php-completion-table)))
280
  "\C-c\C-m"
280
    (if (not pattern) (message "Nothing to complete")
281
  'php-browse-manual)
281
        (search-backward pattern)
282
282
        (setq beg (point))
283
(defconst php-constants
283
        (forward-char (length pattern))
284
  (eval-when-compile
284
        (setq completion (try-completion pattern php-functions nil))
285
    (regexp-opt
285
        (cond ((eq completion t))
286
     '(;; core constants
286
              ((null completion)
287
       "__LINE__" "__FILE__"
287
               (message "Can't find completion for \"%s\"" pattern)
288
       "PHP_OS" "PHP_VERSION" 
288
               (ding))
289
       "TRUE" "FALSE" "NULL"
289
              ((not (string= pattern completion))
290
       "E_ERROR" "E_NOTICE" "E_PARSE" "E_WARNING" "E_ALL"
290
               (delete-region beg (point))
291
       "E_USER_ERROR" "E_USER_WARNING" "E_USER_NOTICE"
291
               (insert completion))
292
       "DEFAULT_INCLUDE_PATH" "PEAR_INSTALL_DIR" "PEAR_EXTENSION_DIR"
292
              (t
293
       "PHP_BINDIR" "PHP_LIBDIR" "PHP_DATADIR" "PHP_SYSCONFDIR"
293
               (message "Making completion list...")
294
       "PHP_LOCALSTATEDIR" "PHP_CONFIG_FILE_PATH"
294
               (with-output-to-temp-buffer "*Completions*"
295
295
                 (display-completion-list
296
       ;; from ext/standard:
296
                  (all-completions pattern php-functions)))
297
       "EXTR_OVERWRITE" "EXTR_SKIP" "EXTR_PREFIX_SAME"
297
               (message "Making completion list...%s" "done"))))))
298
       "EXTR_PREFIX_ALL" "EXTR_PREFIX_INVALID" "SORT_ASC" "SORT_DESC"
298
299
       "SORT_REGULAR" "SORT_NUMERIC" "SORT_STRING" "ASSERT_ACTIVE"
299
;; Build php-completion-table on demand.  The table includes the
300
       "ASSERT_CALLBACK" "ASSERT_BAIL" "ASSERT_WARNING"
300
;; PHP functions and the tags from the current tags-file-name
301
       "ASSERT_QUIET_EVAL" "CONNECTION_ABORTED" "CONNECTION_NORMAL"
301
(defun php-completion-table ()
302
       "CONNECTION_TIMEOUT" "M_E" "M_LOG2E" "M_LOG10E" "M_LN2"
302
  (or (and tags-file-name
303
       "M_LN10" "M_PI" "M_PI_2" "M_PI_4" "M_1_PI" "M_2_PI"
303
           (save-excursion (tags-verify-table tags-file-name))
304
       "M_2_SQRTPI" "M_SQRT2" "M_SQRT1_2" "CRYPT_SALT_LENGTH"
304
           php-completion-table)
305
       "CRYPT_STD_DES" "CRYPT_EXT_DES" "CRYPT_MD5" "CRYPT_BLOWFISH"
305
      (let ((tags-table
306
       "DIRECTORY_SEPARATOR" "SEEK_SET" "SEEK_CUR" "SEEK_END"
306
             (if (and tags-file-name
307
       "LOCK_SH" "LOCK_EX" "LOCK_UN" "LOCK_NB" "HTML_SPECIALCHARS"
307
                      (functionp 'etags-tags-completion-table))
308
       "HTML_ENTITIES" "ENT_COMPAT" "ENT_QUOTES" "ENT_NOQUOTES"
308
                 (with-current-buffer (get-file-buffer tags-file-name)
309
       "INFO_GENERAL" "INFO_CREDITS" "INFO_CONFIGURATION"
309
                   (etags-tags-completion-table))
310
       "INFO_ENVIRONMENT" "INFO_VARIABLES" "INFO_LICENSE" "INFO_ALL"
310
               nil))
311
       "CREDITS_GROUP" "CREDITS_GENERAL" "CREDITS_SAPI"
311
            (php-table
312
       "CREDITS_MODULES" "CREDITS_DOCS" "CREDITS_FULLPAGE"
312
             (cond ((and (not (string= "" php-completion-file))
313
       "CREDITS_QA" "CREDITS_ALL" "PHP_OUTPUT_HANDLER_START"
313
                         (file-readable-p php-completion-file))
314
       "PHP_OUTPUT_HANDLER_CONT" "PHP_OUTPUT_HANDLER_END"
314
                    (php-build-table-from-file php-completion-file))
315
       "STR_PAD_LEFT" "STR_PAD_RIGHT" "STR_PAD_BOTH"
315
                   (php-manual-path
316
       "PATHINFO_DIRNAME" "PATHINFO_BASENAME" "PATHINFO_EXTENSION"
316
                    (php-build-table-from-path php-manual-path))
317
       "CHAR_MAX" "LC_CTYPE" "LC_NUMERIC" "LC_TIME" "LC_COLLATE"
317
                   (t nil))))
318
       "LC_MONETARY" "LC_ALL" "LC_MESSAGES" "LOG_EMERG" "LOG_ALERT"
318
        (unless (or php-table tags-table)
319
       "LOG_CRIT" "LOG_ERR" "LOG_WARNING" "LOG_NOTICE" "LOG_INFO"
319
          (error
320
       "LOG_DEBUG" "LOG_KERN" "LOG_USER" "LOG_MAIL" "LOG_DAEMON"
320
           (concat "No TAGS file active nor are "
321
       "LOG_AUTH" "LOG_SYSLOG" "LOG_LPR" "LOG_NEWS" "LOG_UUCP"
321
                   "`php-completion-file' or `php-manual-path' set")))
322
       "LOG_CRON" "LOG_AUTHPRIV" "LOG_LOCAL0" "LOG_LOCAL1"
322
        (when tags-table
323
       "LOG_LOCAL2" "LOG_LOCAL3" "LOG_LOCAL4" "LOG_LOCAL5"
323
          ;; Combine the tables.
324
       "LOG_LOCAL6" "LOG_LOCAL7" "LOG_PID" "LOG_CONS" "LOG_ODELAY"
324
          (mapatoms (lambda (sym) (intern (symbol-name sym) php-table))
325
       "LOG_NDELAY" "LOG_NOWAIT" "LOG_PERROR"
325
                    tags-table))
326
       
326
        (setq php-completion-table php-table))))
327
       ;; Disabled by default because they slow buffer loading
327
328
       ;; If you have use for them, decomment the strings 
328
(defun php-build-table-from-file (filename)
329
       ;; that you want colored.
329
  (let ((table (make-vector 1022 0))
330
       ;; To compile, you may have to increase 'max-specpdl-size'
330
        (buf (find-file-noselect filename)))
331
331
    (save-excursion
332
       ;; from other bundled extensions:
332
      (set-buffer buf)
333
;        "CAL_EASTER_TO_xxx" "VT_NULL" "VT_EMPTY" "VT_UI1" "VT_I2"
333
      (goto-char (point-min))
334
;        "VT_I4" "VT_R4" "VT_R8" "VT_BOOL" "VT_ERROR" "VT_CY" "VT_DATE"
334
      (while (re-search-forward
335
;        "VT_BSTR" "VT_DECIMAL" "VT_UNKNOWN" "VT_DISPATCH" "VT_VARIANT"
335
              "^\\([-a-zA-Z0-9_.]+\\)\n"
336
;        "VT_I1" "VT_UI2" "VT_UI4" "VT_INT" "VT_UINT" "VT_ARRAY"
336
              nil t)
337
;        "VT_BYREF" "CP_ACP" "CP_MACCP" "CP_OEMCP" "CP_SYMBOL"
337
        (intern (buffer-substring (match-beginning 1) (match-end 1))
338
;        "CP_THREAD_ACP" "CP_UTF7" "CP_UTF8" "CPDF_PM_NONE"
338
                table)))
339
;        "CPDF_PM_OUTLINES" "CPDF_PM_THUMBS" "CPDF_PM_FULLSCREEN"
339
    (kill-buffer buf)
340
;        "CPDF_PL_SINGLE" "CPDF_PL_1COLUMN" "CPDF_PL_2LCOLUMN"
340
    table))
341
;        "CPDF_PL_2RCOLUMN" "CURLOPT_PORT" "CURLOPT_FILE"
341
342
;        "CURLOPT_INFILE" "CURLOPT_INFILESIZE" "CURLOPT_URL"
342
(defun php-build-table-from-path (path)
343
;        "CURLOPT_PROXY" "CURLOPT_VERBOSE" "CURLOPT_HEADER"
343
  (let ((table (make-vector 1022 0))
344
;        "CURLOPT_HTTPHEADER" "CURLOPT_NOPROGRESS" "CURLOPT_NOBODY"
344
        (files (directory-files
345
;        "CURLOPT_FAILONERROR" "CURLOPT_UPLOAD" "CURLOPT_POST"
345
                path
346
;        "CURLOPT_FTPLISTONLY" "CURLOPT_FTPAPPEND" "CURLOPT_NETRC"
346
                nil
347
;        "CURLOPT_FOLLOWLOCATION" "CURLOPT_FTPASCII" "CURLOPT_PUT"
347
                "^function\\..+\\.html$")))
348
;        "CURLOPT_MUTE" "CURLOPT_USERPWD" "CURLOPT_PROXYUSERPWD"
348
    (mapc (lambda (file)
349
;        "CURLOPT_RANGE" "CURLOPT_TIMEOUT" "CURLOPT_POSTFIELDS"
349
            (string-match "\\.\\([-a-zA-Z_0-9]+\\)\\.html$" file)
350
;        "CURLOPT_REFERER" "CURLOPT_USERAGENT" "CURLOPT_FTPPORT"
350
            (intern
351
;        "CURLOPT_LOW_SPEED_LIMIT" "CURLOPT_LOW_SPEED_TIME"
351
             (replace-regexp-in-string
352
;        "CURLOPT_RESUME_FROM" "CURLOPT_COOKIE" "CURLOPT_SSLCERT"
352
              "-" "_" (substring file (match-beginning 1) (match-end 1)) t)
353
;        "CURLOPT_SSLCERTPASSWD" "CURLOPT_WRITEHEADER"
353
             table))
354
;        "CURLOPT_COOKIEFILE" "CURLOPT_SSLVERSION"
354
          files)
355
;        "CURLOPT_TIMECONDITION" "CURLOPT_TIMEVALUE"
355
    table))
356
;        "CURLOPT_CUSTOMREQUEST" "CURLOPT_STDERR" "CURLOPT_TRANSFERTEXT"
356
357
;        "CURLOPT_RETURNTRANSFER" "CURLOPT_QUOTE" "CURLOPT_POSTQUOTE"
357
;; Find the pattern we want to complete
358
;        "CURLOPT_INTERFACE" "CURLOPT_KRB4LEVEL"
358
;; find-tag-default from GNU Emacs etags.el
359
;        "CURLOPT_HTTPPROXYTUNNEL" "CURLOPT_FILETIME"
359
(defun php-get-pattern ()
360
;        "CURLOPT_WRITEFUNCTION" "CURLOPT_READFUNCTION"
360
  (save-excursion
361
;        "CURLOPT_PASSWDFUNCTION" "CURLOPT_HEADERFUNCTION"
361
    (while (looking-at "\\sw\\|\\s_")
362
;        "CURLOPT_MAXREDIRS" "CURLOPT_MAXCONNECTS" "CURLOPT_CLOSEPOLICY"
362
      (forward-char 1))
363
;        "CURLOPT_FRESH_CONNECT" "CURLOPT_FORBID_REUSE"
363
    (if (or (re-search-backward "\\sw\\|\\s_"
364
;        "CURLOPT_RANDOM_FILE" "CURLOPT_EGDSOCKET"
364
                (save-excursion (beginning-of-line) (point))
365
;        "CURLOPT_CONNECTTIMEOUT" "CURLOPT_SSL_VERIFYPEER"
365
                t)
366
;        "CURLOPT_CAINFO" "CURLOPT_BINARYTRANSER"
366
        (re-search-forward "\\(\\sw\\|\\s_\\)+"
367
;        "CURLCLOSEPOLICY_LEAST_RECENTLY_USED" "CURLCLOSEPOLICY_OLDEST"
367
                   (save-excursion (end-of-line) (point))
368
;        "CURLINFO_EFFECTIVE_URL" "CURLINFO_HTTP_CODE"
368
                   t))
369
;        "CURLINFO_HEADER_SIZE" "CURLINFO_REQUEST_SIZE"
369
    (progn (goto-char (match-end 0))
370
;        "CURLINFO_TOTAL_TIME" "CURLINFO_NAMELOOKUP_TIME"
370
           (buffer-substring-no-properties
371
;        "CURLINFO_CONNECT_TIME" "CURLINFO_PRETRANSFER_TIME"
371
                (point)
372
;        "CURLINFO_SIZE_UPLOAD" "CURLINFO_SIZE_DOWNLOAD"
372
                (progn (forward-sexp -1)
373
;        "CURLINFO_SPEED_DOWNLOAD" "CURLINFO_SPEED_UPLOAD"
373
                       (while (looking-at "\\s'")
374
;        "CURLINFO_FILETIME" "CURLE_OK" "CURLE_UNSUPPORTED_PROTOCOL"
374
                         (forward-char 1))
375
;        "CURLE_FAILED_INIT" "CURLE_URL_MALFORMAT"
375
                       (point))))
376
;        "CURLE_URL_MALFORMAT_USER" "CURLE_COULDNT_RESOLVE_PROXY"
376
      nil)))
377
;        "CURLE_COULDNT_RESOLVE_HOST" "CURLE_COULDNT_CONNECT"
377
378
;        "CURLE_FTP_WEIRD_SERVER_REPLY" "CURLE_FTP_ACCESS_DENIED"
378
379
;        "CURLE_FTP_USER_PASSWORD_INCORRECT"
379
(defun php-show-arglist ()
380
;        "CURLE_FTP_WEIRD_PASS_REPLY" "CURLE_FTP_WEIRD_USER_REPLY"
380
  (interactive)
381
;        "CURLE_FTP_WEIRD_PASV_REPLY" "CURLE_FTP_WEIRD_227_FORMAT"
381
  (let* ((tagname (php-get-pattern))
382
;        "CURLE_FTP_CANT_GET_HOST" "CURLE_FTP_CANT_RECONNECT"
382
         (buf (find-tag-noselect tagname nil nil))
383
;        "CURLE_FTP_COULDNT_SET_BINARY" "CURLE_PARTIAL_FILE"
383
         arglist)
384
;        "CURLE_FTP_COULDNT_RETR_FILE" "CURLE_FTP_WRITE_ERROR"
384
    (save-excursion
385
;        "CURLE_FTP_QUOTE_ERROR" "CURLE_HTTP_NOT_FOUND"
385
      (set-buffer buf)
386
;        "CURLE_WRITE_ERROR" "CURLE_MALFORMAT_USER"
386
      (goto-char (point-min))
387
;        "CURLE_FTP_COULDNT_STOR_FILE" "CURLE_READ_ERROR"
387
      (when (re-search-forward
388
;        "CURLE_OUT_OF_MEMORY" "CURLE_OPERATION_TIMEOUTED"
388
             (format "function[ \t]+%s[ \t]*(\\([^{]*\\))" tagname)
389
;        "CURLE_FTP_COULDNT_SET_ASCII" "CURLE_FTP_PORT_FAILED"
389
             nil t)
390
;        "CURLE_FTP_COULDNT_USE_REST" "CURLE_FTP_COULDNT_GET_SIZE"
390
        (setq arglist (buffer-substring-no-properties
391
;        "CURLE_HTTP_RANGE_ERROR" "CURLE_HTTP_POST_ERROR"
391
                       (match-beginning 1) (match-end 1)))))
392
;        "CURLE_SSL_CONNECT_ERROR" "CURLE_FTP_BAD_DOWNLOAD_RESUME"
392
    (if arglist
393
;        "CURLE_FILE_COULDNT_READ_FILE" "CURLE_LDAP_CANNOT_BIND"
393
        (message "Arglist for %s: %s" tagname arglist)
394
;        "CURLE_LDAP_SEARCH_FAILED" "CURLE_LIBRARY_NOT_FOUND"
394
        (message "unknown function: %s" tagname))))
395
;        "CURLE_FUNCTION_NOT_FOUND" "CURLE_ABORTED_BY_CALLBACK"
395
396
;        "CURLE_BAD_FUNCTION_ARGUMENT" "CURLE_BAD_CALLING_ORDER"
396
;; Define function documentation function
397
;        "CURLE_HTTP_PORT_FAILED" "CURLE_BAD_PASSWORD_ENTERED"
397
(defun php-search-documentation ()
398
;        "CURLE_TOO_MANY_REDIRECTS" "CURLE_UNKOWN_TELNET_OPTION"
398
  "Search PHP documentation for the word at the point."
399
;        "CURLE_TELNET_OPTION_SYNTAX" "CURLE_ALREADY_COMPLETE"
399
  (interactive)
400
;        "DBX_MYSQL" "DBX_ODBC" "DBX_PGSQL" "DBX_MSSQL" "DBX_PERSISTENT"
400
  (browse-url (concat php-search-url (current-word t))))
401
;        "DBX_RESULT_INFO" "DBX_RESULT_INDEX" "DBX_RESULT_ASSOC"
401
402
;        "DBX_CMP_TEXT" "DBX_CMP_NUMBER" "XML_ELEMENT_NODE"
402
;; Define function for browsing manual
403
;        "XML_ATTRIBUTE_NODE" "XML_TEXT_NODE" "XML_CDATA_SECTION_NODE"
403
(defun php-browse-manual ()
404
;        "XML_ENTITY_REF_NODE" "XML_ENTITY_NODE" "XML_PI_NODE"
404
  "Bring up manual for PHP."
405
;        "XML_COMMENT_NODE" "XML_DOCUMENT_NODE" "XML_DOCUMENT_TYPE_NODE"
405
  (interactive)
406
;        "XML_DOCUMENT_FRAG_NODE" "XML_NOTATION_NODE"
406
  (browse-url php-manual-url))
407
;        "XML_HTML_DOCUMENT_NODE" "XML_DTD_NODE" "XML_ELEMENT_DECL_NODE"
407
408
;        "XML_ATTRIBUTE_DECL_NODE" "XML_ENTITY_DECL_NODE"
408
;; Define shortcut
409
;        "XML_NAMESPACE_DECL_NODE" "XML_GLOBAL_NAMESPACE"
409
(define-key php-mode-map
410
;        "XML_LOCAL_NAMESPACE" "XML_ATTRIBUTE_CDATA" "XML_ATTRIBUTE_ID"
410
  "\C-c\C-f"
411
;        "XML_ATTRIBUTE_IDREF" "XML_ATTRIBUTE_IDREFS"
411
  'php-search-documentation)
412
;        "XML_ATTRIBUTE_ENTITY" "XML_ATTRIBUTE_NMTOKEN"
412
413
;        "XML_ATTRIBUTE_NMTOKENS" "XML_ATTRIBUTE_ENUMERATION"
413
;; Define shortcut
414
;        "XML_ATTRIBUTE_NOTATION" "XPATH_UNDEFINED" "XPATH_NODESET"
414
(define-key php-mode-map
415
;        "XPATH_BOOLEAN" "XPATH_NUMBER" "XPATH_STRING" "XPATH_POINT"
415
  [(meta tab)]
416
;        "XPATH_RANGE" "XPATH_LOCATIONSET" "XPATH_USERS" "FBSQL_ASSOC"
416
  'php-complete-function)
417
;        "FBSQL_NUM" "FBSQL_BOTH" "FDFValue" "FDFStatus" "FDFFile"
417
418
;        "FDFID" "FDFFf" "FDFSetFf" "FDFClearFf" "FDFFlags" "FDFSetF"
418
;; Define shortcut
419
;        "FDFClrF" "FDFAP" "FDFAS" "FDFAction" "FDFAA" "FDFAPRef"
419
(define-key php-mode-map
420
;        "FDFIF" "FDFEnter" "FDFExit" "FDFDown" "FDFUp" "FDFFormat"
420
  "\C-c\C-m"
421
;        "FDFValidate" "FDFKeystroke" "FDFCalculate"
421
  'php-browse-manual)
422
;        "FRIBIDI_CHARSET_UTF8" "FRIBIDI_CHARSET_8859_6"
422
423
;        "FRIBIDI_CHARSET_8859_8" "FRIBIDI_CHARSET_CP1255"
423
;; Define shortcut
424
;        "FRIBIDI_CHARSET_CP1256" "FRIBIDI_CHARSET_ISIRI_3342"
424
(define-key php-mode-map
425
;        "FTP_ASCII" "FTP_BINARY" "FTP_IMAGE" "FTP_TEXT" "IMG_GIF"
425
  '[(control .)]
426
;        "IMG_JPG" "IMG_JPEG" "IMG_PNG" "IMG_WBMP" "IMG_COLOR_TILED"
426
  'php-show-arglist)
427
;        "IMG_COLOR_STYLED" "IMG_COLOR_BRUSHED"
427
428
;        "IMG_COLOR_STYLEDBRUSHED" "IMG_COLOR_TRANSPARENT"
428
(defconst php-constants
429
;        "IMG_ARC_ROUNDED" "IMG_ARC_PIE" "IMG_ARC_CHORD"
429
  (eval-when-compile
430
;        "IMG_ARC_NOFILL" "IMG_ARC_EDGED" "GMP_ROUND_ZERO"
430
    (regexp-opt
431
;        "GMP_ROUND_PLUSINF" "GMP_ROUND_MINUSINF" "HW_ATTR_LANG"
431
     '(;; core constants
432
;        "HW_ATTR_NR" "HW_ATTR_NONE" "IIS_READ" "IIS_WRITE"
432
       "__LINE__" "__FILE__"
433
;        "IIS_EXECUTE" "IIS_SCRIPT" "IIS_ANONYMOUS" "IIS_BASIC"
433
       "PHP_OS" "PHP_VERSION"
434
;        "IIS_NTLM" "NIL" "OP_DEBUG" "OP_READONLY" "OP_ANONYMOUS"
434
       "TRUE" "FALSE" "NULL"
435
;        "OP_SHORTCACHE" "OP_SILENT" "OP_PROTOTYPE" "OP_HALFOPEN"
435
       "E_ERROR" "E_NOTICE" "E_PARSE" "E_WARNING" "E_ALL"
436
;        "OP_EXPUNGE" "OP_SECURE" "CL_EXPUNGE" "FT_UID" "FT_PEEK"
436
       "E_USER_ERROR" "E_USER_WARNING" "E_USER_NOTICE"
437
;        "FT_NOT" "FT_INTERNAL" "FT_PREFETCHTEXT" "ST_UID" "ST_SILENT"
437
       "DEFAULT_INCLUDE_PATH" "PEAR_INSTALL_DIR" "PEAR_EXTENSION_DIR"
438
;        "ST_SET" "CP_UID" "CP_MOVE" "SE_UID" "SE_FREE" "SE_NOPREFETCH"
438
       "PHP_BINDIR" "PHP_LIBDIR" "PHP_DATADIR" "PHP_SYSCONFDIR"
439
;        "SO_FREE" "SO_NOSERVER" "SA_MESSAGES" "SA_RECENT" "SA_UNSEEN"
439
       "PHP_LOCALSTATEDIR" "PHP_CONFIG_FILE_PATH"
440
;        "SA_UIDNEXT" "SA_UIDVALIDITY" "SA_ALL" "LATT_NOINFERIORS"
440
441
;        "LATT_NOSELECT" "LATT_MARKED" "LATT_UNMARKED" "SORTDATE"
441
       ;; from ext/standard:
442
;        "SORTARRIVAL" "SORTFROM" "SORTSUBJECT" "SORTTO" "SORTCC"
442
       "EXTR_OVERWRITE" "EXTR_SKIP" "EXTR_PREFIX_SAME"
443
;        "SORTSIZE" "TYPETEXT" "TYPEMULTIPART" "TYPEMESSAGE"
443
       "EXTR_PREFIX_ALL" "EXTR_PREFIX_INVALID" "SORT_ASC" "SORT_DESC"
444
;        "TYPEAPPLICATION" "TYPEAUDIO" "TYPEIMAGE" "TYPEVIDEO"
444
       "SORT_REGULAR" "SORT_NUMERIC" "SORT_STRING" "ASSERT_ACTIVE"
445
;        "TYPEOTHER" "ENC7BIT" "ENC8BIT" "ENCBINARY" "ENCBASE64"
445
       "ASSERT_CALLBACK" "ASSERT_BAIL" "ASSERT_WARNING"
446
;        "ENCQUOTEDPRINTABLE" "ENCOTHER" "INGRES_ASSOC" "INGRES_NUM"
446
       "ASSERT_QUIET_EVAL" "CONNECTION_ABORTED" "CONNECTION_NORMAL"
447
;        "INGRES_BOTH" "IBASE_DEFAULT" "IBASE_TEXT" "IBASE_UNIXTIME"
447
       "CONNECTION_TIMEOUT" "M_E" "M_LOG2E" "M_LOG10E" "M_LN2"
448
;        "IBASE_READ" "IBASE_COMMITTED" "IBASE_CONSISTENCY"
448
       "M_LN10" "M_PI" "M_PI_2" "M_PI_4" "M_1_PI" "M_2_PI"
449
;        "IBASE_NOWAIT" "IBASE_TIMESTAMP" "IBASE_DATE" "IBASE_TIME"
449
       "M_2_SQRTPI" "M_SQRT2" "M_SQRT1_2" "CRYPT_SALT_LENGTH"
450
;        "LDAP_DEREF_NEVER" "LDAP_DEREF_SEARCHING" "LDAP_DEREF_FINDING"
450
       "CRYPT_STD_DES" "CRYPT_EXT_DES" "CRYPT_MD5" "CRYPT_BLOWFISH"
451
;        "LDAP_DEREF_ALWAYS" "LDAP_OPT_DEREF" "LDAP_OPT_SIZELIMIT"
451
       "DIRECTORY_SEPARATOR" "SEEK_SET" "SEEK_CUR" "SEEK_END"
452
;        "LDAP_OPT_TIMELIMIT" "LDAP_OPT_PROTOCOL_VERSION"
452
       "LOCK_SH" "LOCK_EX" "LOCK_UN" "LOCK_NB" "HTML_SPECIALCHARS"
453
;        "LDAP_OPT_ERROR_NUMBER" "LDAP_OPT_REFERRALS" "LDAP_OPT_RESTART"
453
       "HTML_ENTITIES" "ENT_COMPAT" "ENT_QUOTES" "ENT_NOQUOTES"
454
;        "LDAP_OPT_HOST_NAME" "LDAP_OPT_ERROR_STRING"
454
       "INFO_GENERAL" "INFO_CREDITS" "INFO_CONFIGURATION"
455
;        "LDAP_OPT_MATCHED_DN" "LDAP_OPT_SERVER_CONTROLS"
455
       "INFO_ENVIRONMENT" "INFO_VARIABLES" "INFO_LICENSE" "INFO_ALL"
456
;        "LDAP_OPT_CLIENT_CONTROLS" "GSLC_SSL_NO_AUTH"
456
       "CREDITS_GROUP" "CREDITS_GENERAL" "CREDITS_SAPI"
457
;        "GSLC_SSL_ONEWAY_AUTH" "GSLC_SSL_TWOWAY_AUTH" "MCAL_SUNDAY"
457
       "CREDITS_MODULES" "CREDITS_DOCS" "CREDITS_FULLPAGE"
458
;        "MCAL_MONDAY" "MCAL_TUESDAY" "MCAL_WEDNESDAY" "MCAL_THURSDAY"
458
       "CREDITS_QA" "CREDITS_ALL" "PHP_OUTPUT_HANDLER_START"
459
;        "MCAL_FRIDAY" "MCAL_SATURDAY" "MCAL_JANUARY" "MCAL_FEBRUARY"
459
       "PHP_OUTPUT_HANDLER_CONT" "PHP_OUTPUT_HANDLER_END"
460
;        "MCAL_MARCH" "MCAL_APRIL" "MCAL_MAY" "MCAL_JUNE" "MCAL_JULY"
460
       "STR_PAD_LEFT" "STR_PAD_RIGHT" "STR_PAD_BOTH"
461
;        "MCAL_AUGUST" "MCAL_SEPTEMBER" "MCAL_OCTOBER" "MCAL_NOVEMBER"
461
       "PATHINFO_DIRNAME" "PATHINFO_BASENAME" "PATHINFO_EXTENSION"
462
;        "MCAL_RECUR_NONE" "MCAL_RECUR_DAILY" "MCAL_RECUR_WEEKLY"
462
       "CHAR_MAX" "LC_CTYPE" "LC_NUMERIC" "LC_TIME" "LC_COLLATE"
463
;        "MCAL_RECUR_MONTHLY_MDAY" "MCAL_RECUR_MONTHLY_WDAY"
463
       "LC_MONETARY" "LC_ALL" "LC_MESSAGES" "LOG_EMERG" "LOG_ALERT"
464
;        "MCAL_RECUR_YEARLY" "MCAL_M_SUNDAY" "MCAL_M_MONDAY"
464
       "LOG_CRIT" "LOG_ERR" "LOG_WARNING" "LOG_NOTICE" "LOG_INFO"
465
;        "MCAL_M_TUESDAY" "MCAL_M_WEDNESDAY" "MCAL_M_THURSDAY"
465
       "LOG_DEBUG" "LOG_KERN" "LOG_USER" "LOG_MAIL" "LOG_DAEMON"
466
;        "MCAL_M_FRIDAY" "MCAL_M_SATURDAY" "MCAL_M_WEEKDAYS"
466
       "LOG_AUTH" "LOG_SYSLOG" "LOG_LPR" "LOG_NEWS" "LOG_UUCP"
467
;        "MCAL_M_WEEKEND" "MCAL_M_ALLDAYS" "MCRYPT_" "MCRYPT_"
467
       "LOG_CRON" "LOG_AUTHPRIV" "LOG_LOCAL0" "LOG_LOCAL1"
468
;        "MCRYPT_ENCRYPT" "MCRYPT_DECRYPT" "MCRYPT_DEV_RANDOM"
468
       "LOG_LOCAL2" "LOG_LOCAL3" "LOG_LOCAL4" "LOG_LOCAL5"
469
;        "MCRYPT_DEV_URANDOM" "MCRYPT_RAND" "SWFBUTTON_HIT"
469
       "LOG_LOCAL6" "LOG_LOCAL7" "LOG_PID" "LOG_CONS" "LOG_ODELAY"
470
;        "SWFBUTTON_DOWN" "SWFBUTTON_OVER" "SWFBUTTON_UP"
470
       "LOG_NDELAY" "LOG_NOWAIT" "LOG_PERROR"
471
;        "SWFBUTTON_MOUSEUPOUTSIDE" "SWFBUTTON_DRAGOVER"
471
472
;        "SWFBUTTON_DRAGOUT" "SWFBUTTON_MOUSEUP" "SWFBUTTON_MOUSEDOWN"
472
       ;; Disabled by default because they slow buffer loading
473
;        "SWFBUTTON_MOUSEOUT" "SWFBUTTON_MOUSEOVER"
473
       ;; If you have use for them, decomment the strings
474
;        "SWFFILL_RADIAL_GRADIENT" "SWFFILL_LINEAR_GRADIENT"
474
       ;; that you want colored.
475
;        "SWFFILL_TILED_BITMAP" "SWFFILL_CLIPPED_BITMAP"
475
       ;; To compile, you may have to increase 'max-specpdl-size'
476
;        "SWFTEXTFIELD_HASLENGTH" "SWFTEXTFIELD_NOEDIT"
476
477
;        "SWFTEXTFIELD_PASSWORD" "SWFTEXTFIELD_MULTILINE"
477
       ;; from other bundled extensions:
478
;        "SWFTEXTFIELD_WORDWRAP" "SWFTEXTFIELD_DRAWBOX"
478
;        "CAL_EASTER_TO_xxx" "VT_NULL" "VT_EMPTY" "VT_UI1" "VT_I2"
479
;        "SWFTEXTFIELD_NOSELECT" "SWFTEXTFIELD_HTML"
479
;        "VT_I4" "VT_R4" "VT_R8" "VT_BOOL" "VT_ERROR" "VT_CY" "VT_DATE"
480
;        "SWFTEXTFIELD_ALIGN_LEFT" "SWFTEXTFIELD_ALIGN_RIGHT"
480
;        "VT_BSTR" "VT_DECIMAL" "VT_UNKNOWN" "VT_DISPATCH" "VT_VARIANT"
481
;        "SWFTEXTFIELD_ALIGN_CENTER" "SWFTEXTFIELD_ALIGN_JUSTIFY"
481
;        "VT_I1" "VT_UI2" "VT_UI4" "VT_INT" "VT_UINT" "VT_ARRAY"
482
;        "UDM_FIELD_URLID" "UDM_FIELD_URL" "UDM_FIELD_CONTENT"
482
;        "VT_BYREF" "CP_ACP" "CP_MACCP" "CP_OEMCP" "CP_SYMBOL"
483
;        "UDM_FIELD_TITLE" "UDM_FIELD_KEYWORDS" "UDM_FIELD_DESC"
483
;        "CP_THREAD_ACP" "CP_UTF7" "CP_UTF8" "CPDF_PM_NONE"
484
;        "UDM_FIELD_DESCRIPTION" "UDM_FIELD_TEXT" "UDM_FIELD_SIZE"
484
;        "CPDF_PM_OUTLINES" "CPDF_PM_THUMBS" "CPDF_PM_FULLSCREEN"
485
;        "UDM_FIELD_RATING" "UDM_FIELD_SCORE" "UDM_FIELD_MODIFIED"
485
;        "CPDF_PL_SINGLE" "CPDF_PL_1COLUMN" "CPDF_PL_2LCOLUMN"
486
;        "UDM_FIELD_ORDER" "UDM_FIELD_CRC" "UDM_FIELD_CATEGORY"
486
;        "CPDF_PL_2RCOLUMN" "CURLOPT_PORT" "CURLOPT_FILE"
487
;        "UDM_PARAM_PAGE_SIZE" "UDM_PARAM_PAGE_NUM"
487
;        "CURLOPT_INFILE" "CURLOPT_INFILESIZE" "CURLOPT_URL"
488
;        "UDM_PARAM_SEARCH_MODE" "UDM_PARAM_CACHE_MODE"
488
;        "CURLOPT_PROXY" "CURLOPT_VERBOSE" "CURLOPT_HEADER"
489
;        "UDM_PARAM_TRACK_MODE" "UDM_PARAM_PHRASE_MODE"
489
;        "CURLOPT_HTTPHEADER" "CURLOPT_NOPROGRESS" "CURLOPT_NOBODY"
490
;        "UDM_PARAM_CHARSET" "UDM_PARAM_STOPTABLE"
490
;        "CURLOPT_FAILONERROR" "CURLOPT_UPLOAD" "CURLOPT_POST"
491
;        "UDM_PARAM_STOP_TABLE" "UDM_PARAM_STOPFILE"
491
;        "CURLOPT_FTPLISTONLY" "CURLOPT_FTPAPPEND" "CURLOPT_NETRC"
492
;        "UDM_PARAM_STOP_FILE" "UDM_PARAM_WEIGHT_FACTOR"
492
;        "CURLOPT_FOLLOWLOCATION" "CURLOPT_FTPASCII" "CURLOPT_PUT"
493
;        "UDM_PARAM_WORD_MATCH" "UDM_PARAM_MAX_WORD_LEN"
493
;        "CURLOPT_MUTE" "CURLOPT_USERPWD" "CURLOPT_PROXYUSERPWD"
494
;        "UDM_PARAM_MAX_WORDLEN" "UDM_PARAM_MIN_WORD_LEN"
494
;        "CURLOPT_RANGE" "CURLOPT_TIMEOUT" "CURLOPT_POSTFIELDS"
495
;        "UDM_PARAM_MIN_WORDLEN" "UDM_PARAM_ISPELL_PREFIXES"
495
;        "CURLOPT_REFERER" "CURLOPT_USERAGENT" "CURLOPT_FTPPORT"
496
;        "UDM_PARAM_ISPELL_PREFIX" "UDM_PARAM_PREFIXES"
496
;        "CURLOPT_LOW_SPEED_LIMIT" "CURLOPT_LOW_SPEED_TIME"
497
;        "UDM_PARAM_PREFIX" "UDM_PARAM_CROSS_WORDS"
497
;        "CURLOPT_RESUME_FROM" "CURLOPT_COOKIE" "CURLOPT_SSLCERT"
498
;        "UDM_PARAM_CROSSWORDS" "UDM_LIMIT_CAT" "UDM_LIMIT_URL"
498
;        "CURLOPT_SSLCERTPASSWD" "CURLOPT_WRITEHEADER"
499
;        "UDM_LIMIT_TAG" "UDM_LIMIT_LANG" "UDM_LIMIT_DATE"
499
;        "CURLOPT_COOKIEFILE" "CURLOPT_SSLVERSION"
500
;        "UDM_PARAM_FOUND" "UDM_PARAM_NUM_ROWS" "UDM_PARAM_WORDINFO"
500
;        "CURLOPT_TIMECONDITION" "CURLOPT_TIMEVALUE"
501
;        "UDM_PARAM_WORD_INFO" "UDM_PARAM_SEARCHTIME"
501
;        "CURLOPT_CUSTOMREQUEST" "CURLOPT_STDERR" "CURLOPT_TRANSFERTEXT"
502
;        "UDM_PARAM_SEARCH_TIME" "UDM_PARAM_FIRST_DOC"
502
;        "CURLOPT_RETURNTRANSFER" "CURLOPT_QUOTE" "CURLOPT_POSTQUOTE"
503
;        "UDM_PARAM_LAST_DOC" "UDM_MODE_ALL" "UDM_MODE_ANY"
503
;        "CURLOPT_INTERFACE" "CURLOPT_KRB4LEVEL"
504
;        "UDM_MODE_BOOL" "UDM_MODE_PHRASE" "UDM_CACHE_ENABLED"
504
;        "CURLOPT_HTTPPROXYTUNNEL" "CURLOPT_FILETIME"
505
;        "UDM_CACHE_DISABLED" "UDM_TRACK_ENABLED" "UDM_TRACK_DISABLED"
505
;        "CURLOPT_WRITEFUNCTION" "CURLOPT_READFUNCTION"
506
;        "UDM_PHRASE_ENABLED" "UDM_PHRASE_DISABLED"
506
;        "CURLOPT_PASSWDFUNCTION" "CURLOPT_HEADERFUNCTION"
507
;        "UDM_CROSS_WORDS_ENABLED" "UDM_CROSSWORDS_ENABLED"
507
;        "CURLOPT_MAXREDIRS" "CURLOPT_MAXCONNECTS" "CURLOPT_CLOSEPOLICY"
508
;        "UDM_CROSS_WORDS_DISABLED" "UDM_CROSSWORDS_DISABLED"
508
;        "CURLOPT_FRESH_CONNECT" "CURLOPT_FORBID_REUSE"
509
;        "UDM_PREFIXES_ENABLED" "UDM_PREFIX_ENABLED"
509
;        "CURLOPT_RANDOM_FILE" "CURLOPT_EGDSOCKET"
510
;        "UDM_ISPELL_PREFIXES_ENABLED" "UDM_ISPELL_PREFIX_ENABLED"
510
;        "CURLOPT_CONNECTTIMEOUT" "CURLOPT_SSL_VERIFYPEER"
511
;        "UDM_PREFIXES_DISABLED" "UDM_PREFIX_DISABLED"
511
;        "CURLOPT_CAINFO" "CURLOPT_BINARYTRANSER"
512
;        "UDM_ISPELL_PREFIXES_DISABLED" "UDM_ISPELL_PREFIX_DISABLED"
512
;        "CURLCLOSEPOLICY_LEAST_RECENTLY_USED" "CURLCLOSEPOLICY_OLDEST"
513
;        "UDM_ISPELL_TYPE_AFFIX" "UDM_ISPELL_TYPE_SPELL"
513
;        "CURLINFO_EFFECTIVE_URL" "CURLINFO_HTTP_CODE"
514
;        "UDM_ISPELL_TYPE_DB" "UDM_ISPELL_TYPE_SERVER" "UDM_MATCH_WORD"
514
;        "CURLINFO_HEADER_SIZE" "CURLINFO_REQUEST_SIZE"
515
;        "UDM_MATCH_BEGIN" "UDM_MATCH_SUBSTR" "UDM_MATCH_END"
515
;        "CURLINFO_TOTAL_TIME" "CURLINFO_NAMELOOKUP_TIME"
516
;        "MSQL_ASSOC" "MSQL_NUM" "MSQL_BOTH" "MYSQL_ASSOC" "MYSQL_NUM"
516
;        "CURLINFO_CONNECT_TIME" "CURLINFO_PRETRANSFER_TIME"
517
;        "MYSQL_BOTH" "MYSQL_USE_RESULT" "MYSQL_STORE_RESULT"
517
;        "CURLINFO_SIZE_UPLOAD" "CURLINFO_SIZE_DOWNLOAD"
518
;        "OCI_DEFAULT" "OCI_DESCRIBE_ONLY" "OCI_COMMIT_ON_SUCCESS"
518
;        "CURLINFO_SPEED_DOWNLOAD" "CURLINFO_SPEED_UPLOAD"
519
;        "OCI_EXACT_FETCH" "SQLT_BFILEE" "SQLT_CFILEE" "SQLT_CLOB"
519
;        "CURLINFO_FILETIME" "CURLE_OK" "CURLE_UNSUPPORTED_PROTOCOL"
520
;        "SQLT_BLOB" "SQLT_RDD" "OCI_B_SQLT_NTY" "OCI_SYSDATE"
520
;        "CURLE_FAILED_INIT" "CURLE_URL_MALFORMAT"
521
;        "OCI_B_BFILE" "OCI_B_CFILEE" "OCI_B_CLOB" "OCI_B_BLOB"
521
;        "CURLE_URL_MALFORMAT_USER" "CURLE_COULDNT_RESOLVE_PROXY"
522
;        "OCI_B_ROWID" "OCI_B_CURSOR" "OCI_B_BIN" "OCI_ASSOC" "OCI_NUM"
522
;        "CURLE_COULDNT_RESOLVE_HOST" "CURLE_COULDNT_CONNECT"
523
;        "OCI_BOTH" "OCI_RETURN_NULLS" "OCI_RETURN_LOBS"
523
;        "CURLE_FTP_WEIRD_SERVER_REPLY" "CURLE_FTP_ACCESS_DENIED"
524
;        "OCI_DTYPE_FILE" "OCI_DTYPE_LOB" "OCI_DTYPE_ROWID" "OCI_D_FILE"
524
;        "CURLE_FTP_USER_PASSWORD_INCORRECT"
525
;        "OCI_D_LOB" "OCI_D_ROWID" "ODBC_TYPE" "ODBC_BINMODE_PASSTHRU"
525
;        "CURLE_FTP_WEIRD_PASS_REPLY" "CURLE_FTP_WEIRD_USER_REPLY"
526
;        "ODBC_BINMODE_RETURN" "ODBC_BINMODE_CONVERT" "SQL_ODBC_CURSORS"
526
;        "CURLE_FTP_WEIRD_PASV_REPLY" "CURLE_FTP_WEIRD_227_FORMAT"
527
;        "SQL_CUR_USE_DRIVER" "SQL_CUR_USE_IF_NEEDED" "SQL_CUR_USE_ODBC"
527
;        "CURLE_FTP_CANT_GET_HOST" "CURLE_FTP_CANT_RECONNECT"
528
;        "SQL_CONCURRENCY" "SQL_CONCUR_READ_ONLY" "SQL_CONCUR_LOCK"
528
;        "CURLE_FTP_COULDNT_SET_BINARY" "CURLE_PARTIAL_FILE"
529
;        "SQL_CONCUR_ROWVER" "SQL_CONCUR_VALUES" "SQL_CURSOR_TYPE"
529
;        "CURLE_FTP_COULDNT_RETR_FILE" "CURLE_FTP_WRITE_ERROR"
530
;        "SQL_CURSOR_FORWARD_ONLY" "SQL_CURSOR_KEYSET_DRIVEN"
530
;        "CURLE_FTP_QUOTE_ERROR" "CURLE_HTTP_NOT_FOUND"
531
;        "SQL_CURSOR_DYNAMIC" "SQL_CURSOR_STATIC" "SQL_KEYSET_SIZE"
531
;        "CURLE_WRITE_ERROR" "CURLE_MALFORMAT_USER"
532
;        "SQL_CHAR" "SQL_VARCHAR" "SQL_LONGVARCHAR" "SQL_DECIMAL"
532
;        "CURLE_FTP_COULDNT_STOR_FILE" "CURLE_READ_ERROR"
533
;        "SQL_NUMERIC" "SQL_BIT" "SQL_TINYINT" "SQL_SMALLINT"
533
;        "CURLE_OUT_OF_MEMORY" "CURLE_OPERATION_TIMEOUTED"
534
;        "SQL_INTEGER" "SQL_BIGINT" "SQL_REAL" "SQL_FLOAT" "SQL_DOUBLE"
534
;        "CURLE_FTP_COULDNT_SET_ASCII" "CURLE_FTP_PORT_FAILED"
535
;        "SQL_BINARY" "SQL_VARBINARY" "SQL_LONGVARBINARY" "SQL_DATE"
535
;        "CURLE_FTP_COULDNT_USE_REST" "CURLE_FTP_COULDNT_GET_SIZE"
536
;        "SQL_TIME" "SQL_TIMESTAMP" "SQL_TYPE_DATE" "SQL_TYPE_TIME"
536
;        "CURLE_HTTP_RANGE_ERROR" "CURLE_HTTP_POST_ERROR"
537
;        "SQL_TYPE_TIMESTAMP" "SQL_BEST_ROWID" "SQL_ROWVER"
537
;        "CURLE_SSL_CONNECT_ERROR" "CURLE_FTP_BAD_DOWNLOAD_RESUME"
538
;        "SQL_SCOPE_CURROW" "SQL_SCOPE_TRANSACTION" "SQL_SCOPE_SESSION"
538
;        "CURLE_FILE_COULDNT_READ_FILE" "CURLE_LDAP_CANNOT_BIND"
539
;        "SQL_NO_NULLS" "SQL_NULLABLE" "SQL_INDEX_UNIQUE"
539
;        "CURLE_LDAP_SEARCH_FAILED" "CURLE_LIBRARY_NOT_FOUND"
540
;        "SQL_INDEX_ALL" "SQL_ENSURE" "SQL_QUICK"
540
;        "CURLE_FUNCTION_NOT_FOUND" "CURLE_ABORTED_BY_CALLBACK"
541
;        "X509_PURPOSE_SSL_CLIENT" "X509_PURPOSE_SSL_SERVER"
541
;        "CURLE_BAD_FUNCTION_ARGUMENT" "CURLE_BAD_CALLING_ORDER"
542
;        "X509_PURPOSE_NS_SSL_SERVER" "X509_PURPOSE_SMIME_SIGN"
542
;        "CURLE_HTTP_PORT_FAILED" "CURLE_BAD_PASSWORD_ENTERED"
543
;        "X509_PURPOSE_SMIME_ENCRYPT" "X509_PURPOSE_CRL_SIGN"
543
;        "CURLE_TOO_MANY_REDIRECTS" "CURLE_UNKOWN_TELNET_OPTION"
544
;        "X509_PURPOSE_ANY" "PKCS7_DETACHED" "PKCS7_TEXT"
544
;        "CURLE_TELNET_OPTION_SYNTAX" "CURLE_ALREADY_COMPLETE"
545
;        "PKCS7_NOINTERN" "PKCS7_NOVERIFY" "PKCS7_NOCHAIN"
545
;        "DBX_MYSQL" "DBX_ODBC" "DBX_PGSQL" "DBX_MSSQL" "DBX_PERSISTENT"
546
;        "PKCS7_NOCERTS" "PKCS7_NOATTR" "PKCS7_BINARY" "PKCS7_NOSIGS"
546
;        "DBX_RESULT_INFO" "DBX_RESULT_INDEX" "DBX_RESULT_ASSOC"
547
;        "OPENSSL_PKCS1_PADDING" "OPENSSL_SSLV23_PADDING"
547
;        "DBX_CMP_TEXT" "DBX_CMP_NUMBER" "XML_ELEMENT_NODE"
548
;        "OPENSSL_NO_PADDING" "OPENSSL_PKCS1_OAEP_PADDING"
548
;        "XML_ATTRIBUTE_NODE" "XML_TEXT_NODE" "XML_CDATA_SECTION_NODE"
549
;        "ORA_BIND_INOUT" "ORA_BIND_IN" "ORA_BIND_OUT"
549
;        "XML_ENTITY_REF_NODE" "XML_ENTITY_NODE" "XML_PI_NODE"
550
;        "ORA_FETCHINTO_ASSOC" "ORA_FETCHINTO_NULLS"
550
;        "XML_COMMENT_NODE" "XML_DOCUMENT_NODE" "XML_DOCUMENT_TYPE_NODE"
551
;        "PREG_PATTERN_ORDER" "PREG_SET_ORDER" "PREG_SPLIT_NO_EMPTY"
551
;        "XML_DOCUMENT_FRAG_NODE" "XML_NOTATION_NODE"
552
;        "PREG_SPLIT_DELIM_CAPTURE" "PGSQL_ASSOC" "PGSQL_NUM"
552
;        "XML_HTML_DOCUMENT_NODE" "XML_DTD_NODE" "XML_ELEMENT_DECL_NODE"
553
;        "PGSQL_BOTH" "PRINTER_COPIES" "PRINTER_MODE" "PRINTER_TITLE"
553
;        "XML_ATTRIBUTE_DECL_NODE" "XML_ENTITY_DECL_NODE"
554
;        "PRINTER_DEVICENAME" "PRINTER_DRIVERVERSION"
554
;        "XML_NAMESPACE_DECL_NODE" "XML_GLOBAL_NAMESPACE"
555
;        "PRINTER_RESOLUTION_Y" "PRINTER_RESOLUTION_X" "PRINTER_SCALE"
555
;        "XML_LOCAL_NAMESPACE" "XML_ATTRIBUTE_CDATA" "XML_ATTRIBUTE_ID"
556
;        "PRINTER_BACKGROUND_COLOR" "PRINTER_PAPER_LENGTH"
556
;        "XML_ATTRIBUTE_IDREF" "XML_ATTRIBUTE_IDREFS"
557
;        "PRINTER_PAPER_WIDTH" "PRINTER_PAPER_FORMAT"
557
;        "XML_ATTRIBUTE_ENTITY" "XML_ATTRIBUTE_NMTOKEN"
558
;        "PRINTER_FORMAT_CUSTOM" "PRINTER_FORMAT_LETTER"
558
;        "XML_ATTRIBUTE_NMTOKENS" "XML_ATTRIBUTE_ENUMERATION"
559
;        "PRINTER_FORMAT_LEGAL" "PRINTER_FORMAT_A3" "PRINTER_FORMAT_A4"
559
;        "XML_ATTRIBUTE_NOTATION" "XPATH_UNDEFINED" "XPATH_NODESET"
560
;        "PRINTER_FORMAT_A5" "PRINTER_FORMAT_B4" "PRINTER_FORMAT_B5"
560
;        "XPATH_BOOLEAN" "XPATH_NUMBER" "XPATH_STRING" "XPATH_POINT"
561
;        "PRINTER_FORMAT_FOLIO" "PRINTER_ORIENTATION"
561
;        "XPATH_RANGE" "XPATH_LOCATIONSET" "XPATH_USERS" "FBSQL_ASSOC"
562
;        "PRINTER_ORIENTATION_PORTRAIT" "PRINTER_ORIENTATION_LANDSCAPE"
562
;        "FBSQL_NUM" "FBSQL_BOTH" "FDFValue" "FDFStatus" "FDFFile"
563
;        "PRINTER_TEXT_COLOR" "PRINTER_TEXT_ALIGN" "PRINTER_TA_BASELINE"
563
;        "FDFID" "FDFFf" "FDFSetFf" "FDFClearFf" "FDFFlags" "FDFSetF"
564
;        "PRINTER_TA_BOTTOM" "PRINTER_TA_TOP" "PRINTER_TA_CENTER"
564
;        "FDFClrF" "FDFAP" "FDFAS" "FDFAction" "FDFAA" "FDFAPRef"
565
;        "PRINTER_TA_LEFT" "PRINTER_TA_RIGHT" "PRINTER_PEN_SOLID"
565
;        "FDFIF" "FDFEnter" "FDFExit" "FDFDown" "FDFUp" "FDFFormat"
566
;        "PRINTER_PEN_DASH" "PRINTER_PEN_DOT" "PRINTER_PEN_DASHDOT"
566
;        "FDFValidate" "FDFKeystroke" "FDFCalculate"
567
;        "PRINTER_PEN_DASHDOTDOT" "PRINTER_PEN_INVISIBLE"
567
;        "FRIBIDI_CHARSET_UTF8" "FRIBIDI_CHARSET_8859_6"
568
;        "PRINTER_BRUSH_SOLID" "PRINTER_BRUSH_CUSTOM"
568
;        "FRIBIDI_CHARSET_8859_8" "FRIBIDI_CHARSET_CP1255"
569
;        "PRINTER_BRUSH_DIAGONAL" "PRINTER_BRUSH_CROSS"
569
;        "FRIBIDI_CHARSET_CP1256" "FRIBIDI_CHARSET_ISIRI_3342"
570
;        "PRINTER_BRUSH_DIAGCROSS" "PRINTER_BRUSH_FDIAGONAL"
570
;        "FTP_ASCII" "FTP_BINARY" "FTP_IMAGE" "FTP_TEXT" "IMG_GIF"
571
;        "PRINTER_BRUSH_HORIZONTAL" "PRINTER_BRUSH_VERTICAL"
571
;        "IMG_JPG" "IMG_JPEG" "IMG_PNG" "IMG_WBMP" "IMG_COLOR_TILED"
572
;        "PRINTER_FW_THIN" "PRINTER_FW_ULTRALIGHT" "PRINTER_FW_LIGHT"
572
;        "IMG_COLOR_STYLED" "IMG_COLOR_BRUSHED"
573
;        "PRINTER_FW_NORMAL" "PRINTER_FW_MEDIUM" "PRINTER_FW_BOLD"
573
;        "IMG_COLOR_STYLEDBRUSHED" "IMG_COLOR_TRANSPARENT"
574
;        "PRINTER_FW_ULTRABOLD" "PRINTER_FW_HEAVY" "PRINTER_ENUM_LOCAL"
574
;        "IMG_ARC_ROUNDED" "IMG_ARC_PIE" "IMG_ARC_CHORD"
575
;        "PRINTER_ENUM_NAME" "PRINTER_ENUM_SHARED"
575
;        "IMG_ARC_NOFILL" "IMG_ARC_EDGED" "GMP_ROUND_ZERO"
576
;        "PRINTER_ENUM_DEFAULT" "PRINTER_ENUM_CONNECTIONS"
576
;        "GMP_ROUND_PLUSINF" "GMP_ROUND_MINUSINF" "HW_ATTR_LANG"
577
;        "PRINTER_ENUM_NETWORK" "PRINTER_ENUM_REMOTE" "PSPELL_FAST"
577
;        "HW_ATTR_NR" "HW_ATTR_NONE" "IIS_READ" "IIS_WRITE"
578
;        "PSPELL_NORMAL" "PSPELL_BAD_SPELLERS" "PSPELL_RUN_TOGETHER"
578
;        "IIS_EXECUTE" "IIS_SCRIPT" "IIS_ANONYMOUS" "IIS_BASIC"
579
;        "SID" "SID" "AF_UNIX" "AF_INET" "SOCK_STREAM" "SOCK_DGRAM"
579
;        "IIS_NTLM" "NIL" "OP_DEBUG" "OP_READONLY" "OP_ANONYMOUS"
580
;        "SOCK_RAW" "SOCK_SEQPACKET" "SOCK_RDM" "MSG_OOB" "MSG_WAITALL"
580
;        "OP_SHORTCACHE" "OP_SILENT" "OP_PROTOTYPE" "OP_HALFOPEN"
581
;        "MSG_PEEK" "MSG_DONTROUTE" "SO_DEBUG" "SO_REUSEADDR"
581
;        "OP_EXPUNGE" "OP_SECURE" "CL_EXPUNGE" "FT_UID" "FT_PEEK"
582
;        "SO_KEEPALIVE" "SO_DONTROUTE" "SO_LINGER" "SO_BROADCAST"
582
;        "FT_NOT" "FT_INTERNAL" "FT_PREFETCHTEXT" "ST_UID" "ST_SILENT"
583
;        "SO_OOBINLINE" "SO_SNDBUF" "SO_RCVBUF" "SO_SNDLOWAT"
583
;        "ST_SET" "CP_UID" "CP_MOVE" "SE_UID" "SE_FREE" "SE_NOPREFETCH"
584
;        "SO_RCVLOWAT" "SO_SNDTIMEO" "SO_RCVTIMEO" "SO_TYPE" "SO_ERROR"
584
;        "SO_FREE" "SO_NOSERVER" "SA_MESSAGES" "SA_RECENT" "SA_UNSEEN"
585
;        "SOL_SOCKET" "PHP_NORMAL_READ" "PHP_BINARY_READ"
585
;        "SA_UIDNEXT" "SA_UIDVALIDITY" "SA_ALL" "LATT_NOINFERIORS"
586
;        "PHP_SYSTEM_READ" "SOL_TCP" "SOL_UDP" "MOD_COLOR" "MOD_MATRIX"
586
;        "LATT_NOSELECT" "LATT_MARKED" "LATT_UNMARKED" "SORTDATE"
587
;        "TYPE_PUSHBUTTON" "TYPE_MENUBUTTON" "BSHitTest" "BSDown"
587
;        "SORTARRIVAL" "SORTFROM" "SORTSUBJECT" "SORTTO" "SORTCC"
588
;        "BSOver" "BSUp" "OverDowntoIdle" "IdletoOverDown"
588
;        "SORTSIZE" "TYPETEXT" "TYPEMULTIPART" "TYPEMESSAGE"
589
;        "OutDowntoIdle" "OutDowntoOverDown" "OverDowntoOutDown"
589
;        "TYPEAPPLICATION" "TYPEAUDIO" "TYPEIMAGE" "TYPEVIDEO"
590
;        "OverUptoOverDown" "OverUptoIdle" "IdletoOverUp" "ButtonEnter"
590
;        "TYPEOTHER" "ENC7BIT" "ENC8BIT" "ENCBINARY" "ENCBASE64"
591
;        "ButtonExit" "MenuEnter" "MenuExit" "XML_ERROR_NONE"
591
;        "ENCQUOTEDPRINTABLE" "ENCOTHER" "INGRES_ASSOC" "INGRES_NUM"
592
;        "XML_ERROR_NO_MEMORY" "XML_ERROR_SYNTAX"
592
;        "INGRES_BOTH" "IBASE_DEFAULT" "IBASE_TEXT" "IBASE_UNIXTIME"
593
;        "XML_ERROR_NO_ELEMENTS" "XML_ERROR_INVALID_TOKEN"
593
;        "IBASE_READ" "IBASE_COMMITTED" "IBASE_CONSISTENCY"
594
;        "XML_ERROR_UNCLOSED_TOKEN" "XML_ERROR_PARTIAL_CHAR"
594
;        "IBASE_NOWAIT" "IBASE_TIMESTAMP" "IBASE_DATE" "IBASE_TIME"
595
;        "XML_ERROR_TAG_MISMATCH" "XML_ERROR_DUPLICATE_ATTRIBUTE"
595
;        "LDAP_DEREF_NEVER" "LDAP_DEREF_SEARCHING" "LDAP_DEREF_FINDING"
596
;        "XML_ERROR_JUNK_AFTER_DOC_ELEMENT" "XML_ERROR_PARAM_ENTITY_REF"
596
;        "LDAP_DEREF_ALWAYS" "LDAP_OPT_DEREF" "LDAP_OPT_SIZELIMIT"
597
;        "XML_ERROR_UNDEFINED_ENTITY" "XML_ERROR_RECURSIVE_ENTITY_REF"
597
;        "LDAP_OPT_TIMELIMIT" "LDAP_OPT_PROTOCOL_VERSION"
598
;        "XML_ERROR_ASYNC_ENTITY" "XML_ERROR_BAD_CHAR_REF"
598
;        "LDAP_OPT_ERROR_NUMBER" "LDAP_OPT_REFERRALS" "LDAP_OPT_RESTART"
599
;        "XML_ERROR_BINARY_ENTITY_REF"
599
;        "LDAP_OPT_HOST_NAME" "LDAP_OPT_ERROR_STRING"
600
;        "XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF"
600
;        "LDAP_OPT_MATCHED_DN" "LDAP_OPT_SERVER_CONTROLS"
601
;        "XML_ERROR_MISPLACED_XML_PI" "XML_ERROR_UNKNOWN_ENCODING"
601
;        "LDAP_OPT_CLIENT_CONTROLS" "GSLC_SSL_NO_AUTH"
602
;        "XML_ERROR_INCORRECT_ENCODING"
602
;        "GSLC_SSL_ONEWAY_AUTH" "GSLC_SSL_TWOWAY_AUTH" "MCAL_SUNDAY"
603
;        "XML_ERROR_UNCLOSED_CDATA_SECTION"
603
;        "MCAL_MONDAY" "MCAL_TUESDAY" "MCAL_WEDNESDAY" "MCAL_THURSDAY"
604
;        "XML_ERROR_EXTERNAL_ENTITY_HANDLING" "XML_OPTION_CASE_FOLDING"
604
;        "MCAL_FRIDAY" "MCAL_SATURDAY" "MCAL_JANUARY" "MCAL_FEBRUARY"
605
;        "XML_OPTION_TARGET_ENCODING" "XML_OPTION_SKIP_TAGSTART"
605
;        "MCAL_MARCH" "MCAL_APRIL" "MCAL_MAY" "MCAL_JUNE" "MCAL_JULY"
606
;        "XML_OPTION_SKIP_WHITE" "YPERR_BADARGS" "YPERR_BADDB"
606
;        "MCAL_AUGUST" "MCAL_SEPTEMBER" "MCAL_OCTOBER" "MCAL_NOVEMBER"
607
;        "YPERR_BUSY" "YPERR_DOMAIN" "YPERR_KEY" "YPERR_MAP"
607
;        "MCAL_RECUR_NONE" "MCAL_RECUR_DAILY" "MCAL_RECUR_WEEKLY"
608
;        "YPERR_NODOM" "YPERR_NOMORE" "YPERR_PMAP" "YPERR_RESRC"
608
;        "MCAL_RECUR_MONTHLY_MDAY" "MCAL_RECUR_MONTHLY_WDAY"
609
;        "YPERR_RPC" "YPERR_YPBIND" "YPERR_YPERR" "YPERR_YPSERV"
609
;        "MCAL_RECUR_YEARLY" "MCAL_M_SUNDAY" "MCAL_M_MONDAY"
610
;        "YPERR_VERS" "FORCE_GZIP" "FORCE_DEFLATE"
610
;        "MCAL_M_TUESDAY" "MCAL_M_WEDNESDAY" "MCAL_M_THURSDAY"
611
611
;        "MCAL_M_FRIDAY" "MCAL_M_SATURDAY" "MCAL_M_WEEKDAYS"
612
       ;; PEAR constants
612
;        "MCAL_M_WEEKEND" "MCAL_M_ALLDAYS" "MCRYPT_" "MCRYPT_"
613
;        "PEAR_ERROR_RETURN" "PEAR_ERROR_PRINT" "PEAR_ERROR_TRIGGER"
613
;        "MCRYPT_ENCRYPT" "MCRYPT_DECRYPT" "MCRYPT_DEV_RANDOM"
614
;        "PEAR_ERROR_DIE" "PEAR_ERROR_CALLBACK" "OS_WINDOWS" "OS_UNIX"
614
;        "MCRYPT_DEV_URANDOM" "MCRYPT_RAND" "SWFBUTTON_HIT"
615
;        "PEAR_OS" "DB_OK" "DB_ERROR" "DB_ERROR_SYNTAX"
615
;        "SWFBUTTON_DOWN" "SWFBUTTON_OVER" "SWFBUTTON_UP"
616
;        "DB_ERROR_CONSTRAINT" "DB_ERROR_NOT_FOUND"
616
;        "SWFBUTTON_MOUSEUPOUTSIDE" "SWFBUTTON_DRAGOVER"
617
;        "DB_ERROR_ALREADY_EXISTS" "DB_ERROR_UNSUPPORTED"
617
;        "SWFBUTTON_DRAGOUT" "SWFBUTTON_MOUSEUP" "SWFBUTTON_MOUSEDOWN"
618
;        "DB_ERROR_MISMATCH" "DB_ERROR_INVALID" "DB_ERROR_NOT_CAPABLE"
618
;        "SWFBUTTON_MOUSEOUT" "SWFBUTTON_MOUSEOVER"
619
;        "DB_ERROR_TRUNCATED" "DB_ERROR_INVALID_NUMBER"
619
;        "SWFFILL_RADIAL_GRADIENT" "SWFFILL_LINEAR_GRADIENT"
620
;        "DB_ERROR_INVALID_DATE" "DB_ERROR_DIVZERO"
620
;        "SWFFILL_TILED_BITMAP" "SWFFILL_CLIPPED_BITMAP"
621
;        "DB_ERROR_NODBSELECTED" "DB_ERROR_CANNOT_CREATE"
621
;        "SWFTEXTFIELD_HASLENGTH" "SWFTEXTFIELD_NOEDIT"
622
;        "DB_ERROR_CANNOT_DELETE" "DB_ERROR_CANNOT_DROP"
622
;        "SWFTEXTFIELD_PASSWORD" "SWFTEXTFIELD_MULTILINE"
623
;        "DB_ERROR_NOSUCHTABLE" "DB_ERROR_NOSUCHFIELD"
623
;        "SWFTEXTFIELD_WORDWRAP" "SWFTEXTFIELD_DRAWBOX"
624
;        "DB_ERROR_NEED_MORE_DATA" "DB_ERROR_NOT_LOCKED"
624
;        "SWFTEXTFIELD_NOSELECT" "SWFTEXTFIELD_HTML"
625
;        "DB_ERROR_VALUE_COUNT_ON_ROW" "DB_ERROR_INVALID_DSN"
625
;        "SWFTEXTFIELD_ALIGN_LEFT" "SWFTEXTFIELD_ALIGN_RIGHT"
626
;        "DB_ERROR_CONNECT_FAILED" "DB_WARNING" "DB_WARNING_READ_ONLY"
626
;        "SWFTEXTFIELD_ALIGN_CENTER" "SWFTEXTFIELD_ALIGN_JUSTIFY"
627
;        "DB_PARAM_SCALAR" "DB_PARAM_OPAQUE" "DB_BINMODE_PASSTHRU"
627
;        "UDM_FIELD_URLID" "UDM_FIELD_URL" "UDM_FIELD_CONTENT"
628
;        "DB_BINMODE_RETURN" "DB_BINMODE_CONVERT" "DB_FETCHMODE_DEFAULT"
628
;        "UDM_FIELD_TITLE" "UDM_FIELD_KEYWORDS" "UDM_FIELD_DESC"
629
;        "DB_FETCHMODE_ORDERED" "DB_FETCHMODE_ASSOC"
629
;        "UDM_FIELD_DESCRIPTION" "UDM_FIELD_TEXT" "UDM_FIELD_SIZE"
630
;        "DB_FETCHMODE_FLIPPED" "DB_GETMODE_ORDERED" "DB_GETMODE_ASSOC"
630
;        "UDM_FIELD_RATING" "UDM_FIELD_SCORE" "UDM_FIELD_MODIFIED"
631
;        "DB_GETMODE_FLIPPED" "DB_TABLEINFO_ORDER"
631
;        "UDM_FIELD_ORDER" "UDM_FIELD_CRC" "UDM_FIELD_CATEGORY"
632
;        "DB_TABLEINFO_ORDERTABLE" "DB_TABLEINFO_FULL"
632
;        "UDM_PARAM_PAGE_SIZE" "UDM_PARAM_PAGE_NUM"
633
       
633
;        "UDM_PARAM_SEARCH_MODE" "UDM_PARAM_CACHE_MODE"
634
       )))
634
;        "UDM_PARAM_TRACK_MODE" "UDM_PARAM_PHRASE_MODE"
635
  "PHP constants.")
635
;        "UDM_PARAM_CHARSET" "UDM_PARAM_STOPTABLE"
636
636
;        "UDM_PARAM_STOP_TABLE" "UDM_PARAM_STOPFILE"
637
(defconst php-keywords
637
;        "UDM_PARAM_STOP_FILE" "UDM_PARAM_WEIGHT_FACTOR"
638
  (eval-when-compile
638
;        "UDM_PARAM_WORD_MATCH" "UDM_PARAM_MAX_WORD_LEN"
639
    (regexp-opt
639
;        "UDM_PARAM_MAX_WORDLEN" "UDM_PARAM_MIN_WORD_LEN"
640
     ;; "class", "new" and "extends" get special treatment
640
;        "UDM_PARAM_MIN_WORDLEN" "UDM_PARAM_ISPELL_PREFIXES"
641
     ;; "case" and  "default" get special treatment elsewhere
641
;        "UDM_PARAM_ISPELL_PREFIX" "UDM_PARAM_PREFIXES"
642
     '("and" "as" "break" "continue" "declare" "do" "echo" "else" "elseif"
642
;        "UDM_PARAM_PREFIX" "UDM_PARAM_CROSS_WORDS"
643
       "endfor" "endforeach" "endif" "endswitch" "endwhile" "exit"
643
;        "UDM_PARAM_CROSSWORDS" "UDM_LIMIT_CAT" "UDM_LIMIT_URL"
644
       "extends" "for" "foreach" "global" "if" "include" "include_once"
644
;        "UDM_LIMIT_TAG" "UDM_LIMIT_LANG" "UDM_LIMIT_DATE"
645
       "next" "or" "require" "require_once" "return" "static" "switch"
645
;        "UDM_PARAM_FOUND" "UDM_PARAM_NUM_ROWS" "UDM_PARAM_WORDINFO"
646
       "then" "var" "while" "xor" "private" "throw" "catch" "try" 
646
;        "UDM_PARAM_WORD_INFO" "UDM_PARAM_SEARCHTIME"
647
       "instanceof" "catch all" "finally")))
647
;        "UDM_PARAM_SEARCH_TIME" "UDM_PARAM_FIRST_DOC"
648
  "PHP keywords.")
648
;        "UDM_PARAM_LAST_DOC" "UDM_MODE_ALL" "UDM_MODE_ANY"
649
649
;        "UDM_MODE_BOOL" "UDM_MODE_PHRASE" "UDM_CACHE_ENABLED"
650
(defconst php-identifier
650
;        "UDM_CACHE_DISABLED" "UDM_TRACK_ENABLED" "UDM_TRACK_DISABLED"
651
  (eval-when-compile
651
;        "UDM_PHRASE_ENABLED" "UDM_PHRASE_DISABLED"
652
    '"[a-zA-Z\_\x7f-\xff][a-zA-Z0-9\_\x7f-\xff]*")
652
;        "UDM_CROSS_WORDS_ENABLED" "UDM_CROSSWORDS_ENABLED"
653
  "Characters in a PHP identifier.")
653
;        "UDM_CROSS_WORDS_DISABLED" "UDM_CROSSWORDS_DISABLED"
654
654
;        "UDM_PREFIXES_ENABLED" "UDM_PREFIX_ENABLED"
655
(defconst php-types
655
;        "UDM_ISPELL_PREFIXES_ENABLED" "UDM_ISPELL_PREFIX_ENABLED"
656
  (eval-when-compile
656
;        "UDM_PREFIXES_DISABLED" "UDM_PREFIX_DISABLED"
657
    (regexp-opt '("array" "bool" "boolean" "char" "const" "double" "float"
657
;        "UDM_ISPELL_PREFIXES_DISABLED" "UDM_ISPELL_PREFIX_DISABLED"
658
          "int" "integer" "long" "mixed" "object" "real" 
658
;        "UDM_ISPELL_TYPE_AFFIX" "UDM_ISPELL_TYPE_SPELL"
659
          "string")))
659
;        "UDM_ISPELL_TYPE_DB" "UDM_ISPELL_TYPE_SERVER" "UDM_MATCH_WORD"
660
  "PHP types.")
660
;        "UDM_MATCH_BEGIN" "UDM_MATCH_SUBSTR" "UDM_MATCH_END"
661
661
;        "MSQL_ASSOC" "MSQL_NUM" "MSQL_BOTH" "MYSQL_ASSOC" "MYSQL_NUM"
662
(defconst php-superglobals
662
;        "MYSQL_BOTH" "MYSQL_USE_RESULT" "MYSQL_STORE_RESULT"
663
  (eval-when-compile
663
;        "OCI_DEFAULT" "OCI_DESCRIBE_ONLY" "OCI_COMMIT_ON_SUCCESS"
664
    (regexp-opt '("_GET" "_POST" "_COOKIE" "_SESSION" "_ENV" "GLOBALS"
664
;        "OCI_EXACT_FETCH" "SQLT_BFILEE" "SQLT_CFILEE" "SQLT_CLOB"
665
          "_SERVER" "_FILES" "_REQUEST")))
665
;        "SQLT_BLOB" "SQLT_RDD" "OCI_B_SQLT_NTY" "OCI_SYSDATE"
666
  "PHP superglobal variables.")
666
;        "OCI_B_BFILE" "OCI_B_CFILEE" "OCI_B_CLOB" "OCI_B_BLOB"
667
667
;        "OCI_B_ROWID" "OCI_B_CURSOR" "OCI_B_BIN" "OCI_ASSOC" "OCI_NUM"
668
;; Set up font locking
668
;        "OCI_BOTH" "OCI_RETURN_NULLS" "OCI_RETURN_LOBS"
669
(defconst php-font-lock-keywords-1
669
;        "OCI_DTYPE_FILE" "OCI_DTYPE_LOB" "OCI_DTYPE_ROWID" "OCI_D_FILE"
670
  (list
670
;        "OCI_D_LOB" "OCI_D_ROWID" "ODBC_TYPE" "ODBC_BINMODE_PASSTHRU"
671
   ;; Fontify constants
671
;        "ODBC_BINMODE_RETURN" "ODBC_BINMODE_CONVERT" "SQL_ODBC_CURSORS"
672
   (cons
672
;        "SQL_CUR_USE_DRIVER" "SQL_CUR_USE_IF_NEEDED" "SQL_CUR_USE_ODBC"
673
    (concat "\\<\\(" php-constants "\\)\\>")
673
;        "SQL_CONCURRENCY" "SQL_CONCUR_READ_ONLY" "SQL_CONCUR_LOCK"
674
    'font-lock-constant-face)
674
;        "SQL_CONCUR_ROWVER" "SQL_CONCUR_VALUES" "SQL_CURSOR_TYPE"
675
   
675
;        "SQL_CURSOR_FORWARD_ONLY" "SQL_CURSOR_KEYSET_DRIVEN"
676
   ;; Fontify keywords
676
;        "SQL_CURSOR_DYNAMIC" "SQL_CURSOR_STATIC" "SQL_KEYSET_SIZE"
677
   (cons
677
;        "SQL_CHAR" "SQL_VARCHAR" "SQL_LONGVARCHAR" "SQL_DECIMAL"
678
    (concat "\\<\\(" php-keywords "\\)\\>")
678
;        "SQL_NUMERIC" "SQL_BIT" "SQL_TINYINT" "SQL_SMALLINT"
679
    'font-lock-keyword-face)
679
;        "SQL_INTEGER" "SQL_BIGINT" "SQL_REAL" "SQL_FLOAT" "SQL_DOUBLE"
680
   
680
;        "SQL_BINARY" "SQL_VARBINARY" "SQL_LONGVARBINARY" "SQL_DATE"
681
   ;; Fontify keywords and targets, and case default tags.
681
;        "SQL_TIME" "SQL_TIMESTAMP" "SQL_TYPE_DATE" "SQL_TYPE_TIME"
682
   (list "\\<\\(break\\|case\\|continue\\)\\>[ \t]*\\(-?\\(?:\\sw\\|\\s_\\)+\\)?"
682
;        "SQL_TYPE_TIMESTAMP" "SQL_BEST_ROWID" "SQL_ROWVER"
683
     '(1 font-lock-keyword-face) '(2 font-lock-constant-face t t))
683
;        "SQL_SCOPE_CURROW" "SQL_SCOPE_TRANSACTION" "SQL_SCOPE_SESSION"
684
   ;; This must come after the one for keywords and targets.
684
;        "SQL_NO_NULLS" "SQL_NULLABLE" "SQL_INDEX_UNIQUE"
685
   '(":" ("^[ \t]*\\(\\(?:\\sw\\|\\s_\\)+\\)[ \t]*:[ \t]*$"
685
;        "SQL_INDEX_ALL" "SQL_ENSURE" "SQL_QUICK"
686
      (beginning-of-line) (end-of-line)
686
;        "X509_PURPOSE_SSL_CLIENT" "X509_PURPOSE_SSL_SERVER"
687
      (1 font-lock-constant-face)))
687
;        "X509_PURPOSE_NS_SSL_SERVER" "X509_PURPOSE_SMIME_SIGN"
688
   
688
;        "X509_PURPOSE_SMIME_ENCRYPT" "X509_PURPOSE_CRL_SIGN"
689
   ;; treat 'print' as keyword only when not used like a function name
689
;        "X509_PURPOSE_ANY" "PKCS7_DETACHED" "PKCS7_TEXT"
690
   '("\\<print\\s-*(" . default)
690
;        "PKCS7_NOINTERN" "PKCS7_NOVERIFY" "PKCS7_NOCHAIN"
691
   '("\\<print\\>" . font-lock-keyword-face)
691
;        "PKCS7_NOCERTS" "PKCS7_NOATTR" "PKCS7_BINARY" "PKCS7_NOSIGS"
692
   
692
;        "OPENSSL_PKCS1_PADDING" "OPENSSL_SSLV23_PADDING"
693
   ;; Fontify PHP tag
693
;        "OPENSSL_NO_PADDING" "OPENSSL_PKCS1_OAEP_PADDING"
694
   '("<\\?\\(php\\)?" . font-lock-constant-face)
694
;        "ORA_BIND_INOUT" "ORA_BIND_IN" "ORA_BIND_OUT"
695
   '("\\?>" . font-lock-constant-face)
695
;        "ORA_FETCHINTO_ASSOC" "ORA_FETCHINTO_NULLS"
696
   
696
;        "PREG_PATTERN_ORDER" "PREG_SET_ORDER" "PREG_SPLIT_NO_EMPTY"
697
   ;; Fontify ASP-style tag
697
;        "PREG_SPLIT_DELIM_CAPTURE" "PGSQL_ASSOC" "PGSQL_NUM"
698
   '("<\\%\\(=\\)?" . font-lock-constant-face)
698
;        "PGSQL_BOTH" "PRINTER_COPIES" "PRINTER_MODE" "PRINTER_TITLE"
699
   '("\\%>" . font-lock-constant-face)
699
;        "PRINTER_DEVICENAME" "PRINTER_DRIVERVERSION"
700
700
;        "PRINTER_RESOLUTION_Y" "PRINTER_RESOLUTION_X" "PRINTER_SCALE"
701
   )
701
;        "PRINTER_BACKGROUND_COLOR" "PRINTER_PAPER_LENGTH"
702
  "Subdued level highlighting for PHP mode.")
702
;        "PRINTER_PAPER_WIDTH" "PRINTER_PAPER_FORMAT"
703
703
;        "PRINTER_FORMAT_CUSTOM" "PRINTER_FORMAT_LETTER"
704
(defconst php-font-lock-keywords-2
704
;        "PRINTER_FORMAT_LEGAL" "PRINTER_FORMAT_A3" "PRINTER_FORMAT_A4"
705
  (append
705
;        "PRINTER_FORMAT_A5" "PRINTER_FORMAT_B4" "PRINTER_FORMAT_B5"
706
   php-font-lock-keywords-1
706
;        "PRINTER_FORMAT_FOLIO" "PRINTER_ORIENTATION"
707
   (list
707
;        "PRINTER_ORIENTATION_PORTRAIT" "PRINTER_ORIENTATION_LANDSCAPE"
708
    
708
;        "PRINTER_TEXT_COLOR" "PRINTER_TEXT_ALIGN" "PRINTER_TA_BASELINE"
709
    ;; class declaration
709
;        "PRINTER_TA_BOTTOM" "PRINTER_TA_TOP" "PRINTER_TA_CENTER"
710
    '("\\<\\(class\\|interface\\)[ \t]*\\(\\(?:\\sw\\|\\s_\\)+\\)?"
710
;        "PRINTER_TA_LEFT" "PRINTER_TA_RIGHT" "PRINTER_PEN_SOLID"
711
      (1 font-lock-keyword-face) (2 font-lock-type-face nil t))
711
;        "PRINTER_PEN_DASH" "PRINTER_PEN_DOT" "PRINTER_PEN_DASHDOT"
712
    ;; handle several words specially, to include following word,
712
;        "PRINTER_PEN_DASHDOTDOT" "PRINTER_PEN_INVISIBLE"
713
    ;; thereby excluding it from unknown-symbol checks later
713
;        "PRINTER_BRUSH_SOLID" "PRINTER_BRUSH_CUSTOM"
714
    ;; FIX to handle implementing multiple
714
;        "PRINTER_BRUSH_DIAGONAL" "PRINTER_BRUSH_CROSS"
715
    ;; currently breaks on "class Foo implements Bar, Baz"
715
;        "PRINTER_BRUSH_DIAGCROSS" "PRINTER_BRUSH_FDIAGONAL"
716
    '("\\<\\(new\\|extends\\|implements\\)\\s-+\\$?\\(\\(?:\\sw\\|\\s_\\)+\\)"
716
;        "PRINTER_BRUSH_HORIZONTAL" "PRINTER_BRUSH_VERTICAL"
717
      (1 font-lock-keyword-face) (2 font-lock-type-face))
717
;        "PRINTER_FW_THIN" "PRINTER_FW_ULTRALIGHT" "PRINTER_FW_LIGHT"
718
718
;        "PRINTER_FW_NORMAL" "PRINTER_FW_MEDIUM" "PRINTER_FW_BOLD"
719
    ;; function declaration
719
;        "PRINTER_FW_ULTRABOLD" "PRINTER_FW_HEAVY" "PRINTER_ENUM_LOCAL"
720
    '("\\<\\(function\\)\\s-+&?\\(\\(?:\\sw\\|\\s_\\)+\\)\\s-*("
720
;        "PRINTER_ENUM_NAME" "PRINTER_ENUM_SHARED"
721
      (1 font-lock-keyword-face)
721
;        "PRINTER_ENUM_DEFAULT" "PRINTER_ENUM_CONNECTIONS"
722
      (2 font-lock-function-name-face nil t))
722
;        "PRINTER_ENUM_NETWORK" "PRINTER_ENUM_REMOTE" "PSPELL_FAST"
723
    
723
;        "PSPELL_NORMAL" "PSPELL_BAD_SPELLERS" "PSPELL_RUN_TOGETHER"
724
    ;; class hierarchy
724
;        "SID" "SID" "AF_UNIX" "AF_INET" "SOCK_STREAM" "SOCK_DGRAM"
725
    '("\\(self\\|parent\\)\\W" (1 font-lock-constant-face nil nil))
725
;        "SOCK_RAW" "SOCK_SEQPACKET" "SOCK_RDM" "MSG_OOB" "MSG_WAITALL"
726
726
;        "MSG_PEEK" "MSG_DONTROUTE" "SO_DEBUG" "SO_REUSEADDR"
727
    ;; method and variable features
727
;        "SO_KEEPALIVE" "SO_DONTROUTE" "SO_LINGER" "SO_BROADCAST"
728
    '("\\<\\(private\\|protected\\|public\\)\\s-+\\$?\\(?:\\sw\\|\\s_\\)+"
728
;        "SO_OOBINLINE" "SO_SNDBUF" "SO_RCVBUF" "SO_SNDLOWAT"
729
      (1 font-lock-keyword-face))
729
;        "SO_RCVLOWAT" "SO_SNDTIMEO" "SO_RCVTIMEO" "SO_TYPE" "SO_ERROR"
730
730
;        "SOL_SOCKET" "PHP_NORMAL_READ" "PHP_BINARY_READ"
731
    ;; method features
731
;        "PHP_SYSTEM_READ" "SOL_TCP" "SOL_UDP" "MOD_COLOR" "MOD_MATRIX"
732
    '("^[ \t]*\\(abstract\\|static\\|final\\)\\s-+\\$?\\(?:\\sw\\|\\s_\\)+"
732
;        "TYPE_PUSHBUTTON" "TYPE_MENUBUTTON" "BSHitTest" "BSDown"
733
      (1 font-lock-keyword-face))
733
;        "BSOver" "BSUp" "OverDowntoIdle" "IdletoOverDown"
734
734
;        "OutDowntoIdle" "OutDowntoOverDown" "OverDowntoOutDown"
735
    ;; variable features
735
;        "OverUptoOverDown" "OverUptoIdle" "IdletoOverUp" "ButtonEnter"
736
    '("^[ \t]*\\(static\\|const\\)\\s-+\\$?\\(?:\\sw\\|\\s_\\)+"
736
;        "ButtonExit" "MenuEnter" "MenuExit" "XML_ERROR_NONE"
737
      (1 font-lock-keyword-face))
737
;        "XML_ERROR_NO_MEMORY" "XML_ERROR_SYNTAX"
738
    ))
738
;        "XML_ERROR_NO_ELEMENTS" "XML_ERROR_INVALID_TOKEN"
739
  "Medium level highlighting for PHP mode.")
739
;        "XML_ERROR_UNCLOSED_TOKEN" "XML_ERROR_PARTIAL_CHAR"
740
740
;        "XML_ERROR_TAG_MISMATCH" "XML_ERROR_DUPLICATE_ATTRIBUTE"
741
(defconst php-font-lock-keywords-3
741
;        "XML_ERROR_JUNK_AFTER_DOC_ELEMENT" "XML_ERROR_PARAM_ENTITY_REF"
742
  (append
742
;        "XML_ERROR_UNDEFINED_ENTITY" "XML_ERROR_RECURSIVE_ENTITY_REF"
743
   php-font-lock-keywords-2
743
;        "XML_ERROR_ASYNC_ENTITY" "XML_ERROR_BAD_CHAR_REF"
744
   (list
744
;        "XML_ERROR_BINARY_ENTITY_REF"
745
    
745
;        "XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF"
746
    ;; <word> or </word> for HTML
746
;        "XML_ERROR_MISPLACED_XML_PI" "XML_ERROR_UNKNOWN_ENCODING"
747
    '("</?\\sw+[^>]*>" . font-lock-constant-face)
747
;        "XML_ERROR_INCORRECT_ENCODING"
748
748
;        "XML_ERROR_UNCLOSED_CDATA_SECTION"
749
    ;; HTML entities
749
;        "XML_ERROR_EXTERNAL_ENTITY_HANDLING" "XML_OPTION_CASE_FOLDING"
750
    '("&\\w+;" . font-lock-variable-name-face)
750
;        "XML_OPTION_TARGET_ENCODING" "XML_OPTION_SKIP_TAGSTART"
751
751
;        "XML_OPTION_SKIP_WHITE" "YPERR_BADARGS" "YPERR_BADDB"
752
    ;; warn about '$' immediately after ->
752
;        "YPERR_BUSY" "YPERR_DOMAIN" "YPERR_KEY" "YPERR_MAP"
753
    '("\\$\\(?:\\sw\\|\\s_\\)+->\\s-*\\(\\$\\)\\(\\(?:\\sw\\|\\s_\\)+\\)"
753
;        "YPERR_NODOM" "YPERR_NOMORE" "YPERR_PMAP" "YPERR_RESRC"
754
      (1 font-lock-warning-face) (2 default))
754
;        "YPERR_RPC" "YPERR_YPBIND" "YPERR_YPERR" "YPERR_YPSERV"
755
    
755
;        "YPERR_VERS" "FORCE_GZIP" "FORCE_DEFLATE"
756
    ;; warn about $word.word -- it could be a valid concatenation,
756
757
    ;; but without any spaces we'll assume $word->word was meant.
757
       ;; PEAR constants
758
    '("\\$\\(?:\\sw\\|\\s_\\)+\\(\\.\\)\\sw"
758
;        "PEAR_ERROR_RETURN" "PEAR_ERROR_PRINT" "PEAR_ERROR_TRIGGER"
759
      1 font-lock-warning-face)
759
;        "PEAR_ERROR_DIE" "PEAR_ERROR_CALLBACK" "OS_WINDOWS" "OS_UNIX"
760
    
760
;        "PEAR_OS" "DB_OK" "DB_ERROR" "DB_ERROR_SYNTAX"
761
    ;; Warn about ==> instead of =>
761
;        "DB_ERROR_CONSTRAINT" "DB_ERROR_NOT_FOUND"
762
    '("==+>" . font-lock-warning-face)
762
;        "DB_ERROR_ALREADY_EXISTS" "DB_ERROR_UNSUPPORTED"
763
    
763
;        "DB_ERROR_MISMATCH" "DB_ERROR_INVALID" "DB_ERROR_NOT_CAPABLE"
764
    ;; exclude casts from bare-word treatment (may contain spaces)
764
;        "DB_ERROR_TRUNCATED" "DB_ERROR_INVALID_NUMBER"
765
    `(,(concat "(\\s-*\\(" php-types "\\)\\s-*)")
765
;        "DB_ERROR_INVALID_DATE" "DB_ERROR_DIVZERO"
766
      1 font-lock-type-face)
766
;        "DB_ERROR_NODBSELECTED" "DB_ERROR_CANNOT_CREATE"
767
    
767
;        "DB_ERROR_CANNOT_DELETE" "DB_ERROR_CANNOT_DROP"
768
    ;; PHP5: function declarations may contain classes as parameters type
768
;        "DB_ERROR_NOSUCHTABLE" "DB_ERROR_NOSUCHFIELD"
769
    `(,(concat "[(,]\\s-*\\(\\(?:\\sw\\|\\s_\\)+\\)\\s-+\\$\\(?:\\sw\\|\\s_\\)+\\>")
769
;        "DB_ERROR_NEED_MORE_DATA" "DB_ERROR_NOT_LOCKED"
770
      1 font-lock-type-face)
770
;        "DB_ERROR_VALUE_COUNT_ON_ROW" "DB_ERROR_INVALID_DSN"
771
    
771
;        "DB_ERROR_CONNECT_FAILED" "DB_WARNING" "DB_WARNING_READ_ONLY"
772
;        "DB_PARAM_SCALAR" "DB_PARAM_OPAQUE" "DB_BINMODE_PASSTHRU"
773
;        "DB_BINMODE_RETURN" "DB_BINMODE_CONVERT" "DB_FETCHMODE_DEFAULT"
774
;        "DB_FETCHMODE_ORDERED" "DB_FETCHMODE_ASSOC"
775
;        "DB_FETCHMODE_FLIPPED" "DB_GETMODE_ORDERED" "DB_GETMODE_ASSOC"
776
;        "DB_GETMODE_FLIPPED" "DB_TABLEINFO_ORDER"
777
;        "DB_TABLEINFO_ORDERTABLE" "DB_TABLEINFO_FULL"
778
779
       )))
780
  "PHP constants.")
781
782
(defconst php-keywords
783
  (eval-when-compile
784
    (regexp-opt
785
     ;; "class", "new" and "extends" get special treatment
786
     ;; "case" and  "default" get special treatment elsewhere
787
     '("and" "as" "break" "continue" "declare" "do" "echo" "else" "elseif"
788
       "endfor" "endforeach" "endif" "endswitch" "endwhile" "exit"
789
       "extends" "for" "foreach" "global" "if" "include" "include_once"
790
       "next" "or" "require" "require_once" "return" "static" "switch"
791
       "then" "var" "while" "xor" "private" "throw" "catch" "try"
792
       "instanceof" "catch all" "finally")))
793
  "PHP keywords.")
794
795
(defconst php-identifier
796
  (eval-when-compile
797
    '"[a-zA-Z\_\x7f-\xff][a-zA-Z0-9\_\x7f-\xff]*")
798
  "Characters in a PHP identifier.")
799
800
(defconst php-types
801
  (eval-when-compile
802
    (regexp-opt '("array" "bool" "boolean" "char" "const" "double" "float"
803
          "int" "integer" "long" "mixed" "object" "real"
804
          "string")))
805
  "PHP types.")
806
807
(defconst php-superglobals
808
  (eval-when-compile
809
    (regexp-opt '("_GET" "_POST" "_COOKIE" "_SESSION" "_ENV" "GLOBALS"
810
          "_SERVER" "_FILES" "_REQUEST")))
811
  "PHP superglobal variables.")
812
813
;; Set up font locking
814
(defconst php-font-lock-keywords-1
815
  (list
816
   ;; Fontify constants
817
   (cons
818
    (concat "\\<\\(" php-constants "\\)\\>")
819
    'font-lock-constant-face)
820
821
   ;; Fontify keywords
822
   (cons
823
    (concat "\\<\\(" php-keywords "\\)\\>")
824
    'font-lock-keyword-face)
825
826
   ;; Fontify keywords and targets, and case default tags.
827
   (list "\\<\\(break\\|case\\|continue\\)\\>[ \t]*\\(-?\\(?:\\sw\\|\\s_\\)+\\)?"
828
     '(1 font-lock-keyword-face) '(2 font-lock-constant-face t t))
829
   ;; This must come after the one for keywords and targets.
830
   '(":" ("^[ \t]*\\(\\(?:\\sw\\|\\s_\\)+\\)[ \t]*:[ \t]*$"
831
      (beginning-of-line) (end-of-line)
832
      (1 font-lock-constant-face)))
833
834
   ;; treat 'print' as keyword only when not used like a function name
835
   '("\\<print\\s-*(" . default)
836
   '("\\<print\\>" . font-lock-keyword-face)
837
838
   ;; Fontify PHP tag
839
   '("<\\?\\(php\\)?" . font-lock-constant-face)
840
   '("\\?>" . font-lock-constant-face)
841
842
   ;; Fontify ASP-style tag
843
   '("<\\%\\(=\\)?" . font-lock-constant-face)
844
   '("\\%>" . font-lock-constant-face)
845
846
   )
847
  "Subdued level highlighting for PHP mode.")
848
849
(defconst php-font-lock-keywords-2
850
  (append
851
   php-font-lock-keywords-1
852
   (list
853
854
    ;; class declaration
855
    '("\\<\\(class\\|interface\\)[ \t]*\\(\\(?:\\sw\\|\\s_\\)+\\)?"
856
      (1 font-lock-keyword-face) (2 font-lock-type-face nil t))
857
    ;; handle several words specially, to include following word,
858
    ;; thereby excluding it from unknown-symbol checks later
859
    ;; FIX to handle implementing multiple
860
    ;; currently breaks on "class Foo implements Bar, Baz"
861
    '("\\<\\(new\\|extends\\|implements\\)\\s-+\\$?\\(\\(?:\\sw\\|\\s_\\)+\\)"
862
      (1 font-lock-keyword-face) (2 font-lock-type-face))
863
864
    ;; function declaration
865
    '("\\<\\(function\\)\\s-+&?\\(\\(?:\\sw\\|\\s_\\)+\\)\\s-*("
866
      (1 font-lock-keyword-face)
867
      (2 font-lock-function-name-face nil t))
868
869
    ;; class hierarchy
870
    '("\\(self\\|parent\\)\\W" (1 font-lock-constant-face nil nil))
871
872
    ;; method and variable features
873
    '("\\<\\(private\\|protected\\|public\\)\\s-+\\$?\\(?:\\sw\\|\\s_\\)+"
874
      (1 font-lock-keyword-face))
875
876
    ;; method features
877
    '("^[ \t]*\\(abstract\\|static\\|final\\)\\s-+\\$?\\(?:\\sw\\|\\s_\\)+"
878
      (1 font-lock-keyword-face))
879
880
    ;; variable features
881
    '("^[ \t]*\\(static\\|const\\)\\s-+\\$?\\(?:\\sw\\|\\s_\\)+"
882
      (1 font-lock-keyword-face))
883
    ))
884
  "Medium level highlighting for PHP mode.")
885
886
(defconst php-font-lock-keywords-3
887
  (append
888
   php-font-lock-keywords-2
889
   (list
890
891
    ;; <word> or </word> for HTML
892
    '("</?\\sw+[^>]*>" . font-lock-constant-face)
893
894
    ;; HTML entities
895
    '("&\\w+;" . font-lock-variable-name-face)
896
897
    ;; warn about '$' immediately after ->
898
    '("\\$\\(?:\\sw\\|\\s_\\)+->\\s-*\\(\\$\\)\\(\\(?:\\sw\\|\\s_\\)+\\)"
899
      (1 font-lock-warning-face) (2 default))
900
901
    ;; warn about $word.word -- it could be a valid concatenation,
902
    ;; but without any spaces we'll assume $word->word was meant.
903
    '("\\$\\(?:\\sw\\|\\s_\\)+\\(\\.\\)\\sw"
904
      1 font-lock-warning-face)
905
906
    ;; Warn about ==> instead of =>
907
    '("==+>" . font-lock-warning-face)
908
909
    ;; exclude casts from bare-word treatment (may contain spaces)
910
    `(,(concat "(\\s-*\\(" php-types "\\)\\s-*)")
911
      1 font-lock-type-face)
912
913
    ;; PHP5: function declarations may contain classes as parameters type
914
    `(,(concat "[(,]\\s-*\\(\\(?:\\sw\\|\\s_\\)+\\)\\s-+\\$\\(?:\\sw\\|\\s_\\)+\\>")
915
      1 font-lock-type-face)
916
772
    ;; Fontify variables and function calls
917
    ;; Fontify variables and function calls
773
    '("\\$\\(this\\|that\\)\\W" (1 font-lock-constant-face nil nil))
918
    '("\\$\\(this\\|that\\)\\W" (1 font-lock-constant-face nil nil))
774
    `(,(concat "\\$\\(" php-superglobals "\\)\\W")
919
    `(,(concat "\\$\\(" php-superglobals "\\)\\W")
775
      (1 font-lock-constant-face nil nil)) ; $_GET & co
920
      (1 font-lock-constant-face nil nil)) ; $_GET & co
776
    '("\\$\\(\\(?:\\sw\\|\\s_\\)+\\)" (1 font-lock-variable-name-face)) ; $variable
921
    '("\\$\\(\\(?:\\sw\\|\\s_\\)+\\)" (1 font-lock-variable-name-face)) ; $variable