--- /dev/null
+package net.sourceforge.phpeclipse.editors;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.text.TextAttribute;
+import org.eclipse.jface.text.rules.IRule;
+import org.eclipse.jface.text.rules.IToken;
+import org.eclipse.jface.text.rules.RuleBasedScanner;
+import org.eclipse.jface.text.rules.SingleLineRule;
+import org.eclipse.jface.text.rules.Token;
+import org.eclipse.jface.text.rules.WhitespaceRule;
+import org.eclipse.jface.text.rules.WordRule;
+import org.eclipse.swt.SWT;
+
+public class PHPScanner extends RuleBasedScanner {
+
+ public PHPScanner(ColorManager manager) {
+ List rules = new ArrayList();
+ IToken procInstr =
+ new Token(
+ new TextAttribute(
+ manager.getColor(IPHPColorConstants.PROC_INSTR)));
+
+ ColorManager colors = new ColorManager();
+
+ IToken php_string =
+ new Token(
+ new TextAttribute(
+ colors.getColor(IPHPColorConstants.PHP_STRING),
+ null,
+ SWT.DEFAULT));
+ IToken php_default =
+ new Token(
+ new TextAttribute(
+ colors.getColor(IPHPColorConstants.PHP_DEFAULT),
+ null,
+ SWT.BOLD));
+ IToken php_tag =
+ new Token(
+ new TextAttribute(
+ colors.getColor(IPHPColorConstants.PHP_TAG),
+ null,
+ SWT.DEFAULT));
+ IToken php_comment =
+ new Token(
+ new TextAttribute(
+ colors.getColor(IPHPColorConstants.PHP_COMMENT),
+ null,
+ SWT.DEFAULT));
+ IToken php_function =
+ new Token(
+ new TextAttribute(
+ colors.getColor(IPHPColorConstants.PHP_FUNCTION),
+ null,
+ SWT.BOLD));
+
+ //Add rule for processing instructions
+ rules.add(new SingleLineRule("<?", "?>", php_tag));
+ rules.add(new SingleLineRule("<?php", "?>", php_tag));
+ rules.add(new SingleLineRule("<?PHP", "?>", php_tag));
+ rules.add(new SingleLineRule("\"", "\"", php_string));
+ rules.add(new SingleLineRule("'", "'", php_string));
+ rules.add(new SingleLineRule("//", "//", php_comment));
+
+ //
+ WordRule rule = new WordRule(new WordDetector());
+ rule.addWord("if", php_default);
+ rule.addWord("else", php_default);
+ rule.addWord("elseif", php_default);
+ rule.addWord("while", php_default);
+ rule.addWord("do", php_default);
+ rule.addWord("for", php_default);
+ rule.addWord("foreach", php_default);
+ rule.addWord("break", php_default);
+ rule.addWord("continue", php_default);
+ rule.addWord("switch", php_default);
+ rule.addWord("declare", php_default);
+ rule.addWord("ticks", php_default);
+ rule.addWord("require", php_default);
+ rule.addWord("include", php_default);
+ rule.addWord("true", php_default);
+ rule.addWord("false", php_default);
+
+ /*
+ rule.addWord( "abs", php_function);
+ rule.addWord( "acos", php_function);
+ rule.addWord( "addcslashes", php_function);
+ rule.addWord( "addslashes", php_function);
+ rule.addWord( "apache_lookup_uri", php_function);
+ rule.addWord( "apache_note", php_function);
+ rule.addWord( "array", php_function);
+ rule.addWord( "array_count_values", php_function);
+ rule.addWord( "array_diff", php_function);
+ rule.addWord( "array_filter", php_function);
+ rule.addWord( "array_flip", php_function);
+ rule.addWord( "array_intersect", php_function);
+ rule.addWord( "array_keys", php_function);
+ rule.addWord( "array_map", php_function);
+ rule.addWord( "array_merge", php_function);
+ rule.addWord( "array_merge_recursive", php_function);
+ rule.addWord( "array_multisort", php_function);
+ rule.addWord( "array_pad", php_function);
+ rule.addWord( "array_pop", php_function);
+ rule.addWord( "array_push", php_function);
+ rule.addWord( "array_rand", php_function);
+ rule.addWord( "array_reduce", php_function);
+ rule.addWord( "array_reverse", php_function);
+ rule.addWord( "array_search", php_function);
+ rule.addWord( "array_shift", php_function);
+ rule.addWord( "array_slice", php_function);
+ rule.addWord( "array_splice", php_function);
+ rule.addWord( "array_sum", php_function);
+ rule.addWord( "array_unique", php_function);
+ rule.addWord( "array_unshift", php_function);
+ rule.addWord( "array_values", php_function);
+ rule.addWord( "array_walk", php_function);
+ rule.addWord( "arsort", php_function);
+ rule.addWord( "ascii2ebcdic", php_function);
+ rule.addWord( "asin", php_function);
+ rule.addWord( "asort", php_function);
+ rule.addWord( "assert", php_function);
+ rule.addWord( "assert-options", php_function);
+ rule.addWord( "atan", php_function);
+ rule.addWord( "atan2", php_function);
+ rule.addWord( "base64_decode", php_function);
+ rule.addWord( "base64_encode", php_function);
+ rule.addWord( "base_convert", php_function);
+ rule.addWord( "basename", php_function);
+ rule.addWord( "bin2hex", php_function);
+ rule.addWord( "bindec", php_function);
+ rule.addWord( "call_user_method", php_function);
+ rule.addWord( "call_user_method_array", php_function);
+ rule.addWord( "ceil", php_function);
+ rule.addWord( "chdir", php_function);
+ rule.addWord( "checkdate", php_function);
+ rule.addWord( "checkdnsrr", php_function);
+ rule.addWord( "chgrp", php_function);
+ rule.addWord( "chmod", php_function);
+ rule.addWord( "chop", php_function);
+ rule.addWord( "chown", php_function);
+ rule.addWord( "chr", php_function);
+ rule.addWord( "chroot", php_function);
+ rule.addWord( "chunk_split", php_function);
+ rule.addWord( "class_exists", php_function);
+ rule.addWord( "clearstatcache", php_function);
+ rule.addWord( "closedir", php_function);
+ rule.addWord( "closelog", php_function);
+ rule.addWord( "compact", php_function);
+ rule.addWord( "connection_aborted", php_function);
+ rule.addWord( "connection_status", php_function);
+ rule.addWord( "connection_timeout", php_function);
+ rule.addWord( "constant", php_function);
+ rule.addWord( "convert_cyr_string", php_function);
+ rule.addWord( "copy", php_function);
+ rule.addWord( "cos", php_function);
+ rule.addWord( "count", php_function);
+ rule.addWord( "count_chars", php_function);
+ rule.addWord( "crc32", php_function);
+ rule.addWord( "crypt", php_function);
+ rule.addWord( "current", php_function);
+ rule.addWord( "date", php_function);
+ rule.addWord( "debugger_off", php_function);
+ rule.addWord( "debugger_on", php_function);
+ rule.addWord( "decbin", php_function);
+ rule.addWord( "dechex", php_function);
+ rule.addWord( "decoct", php_function);
+ rule.addWord( "define", php_function);
+ rule.addWord( "define_syslog_variables", php_function);
+ rule.addWord( "defined", php_function);
+ rule.addWord( "deg2rad", php_function);
+ rule.addWord( "delete", php_function);
+ rule.addWord( "die", php_function);
+ rule.addWord( "dir", php_function);
+ rule.addWord( "dirname", php_function);
+ rule.addWord( "disk_total_space", php_function);
+ rule.addWord( "diskfreespace", php_function);
+ rule.addWord( "dl", php_function);
+ rule.addWord( "doubleval", php_function);
+ rule.addWord( "each", php_function);
+ rule.addWord( "easter_date", php_function);
+ rule.addWord( "easter_days", php_function);
+ rule.addWord( "ebcdic2ascii", php_function);
+ rule.addWord( "echo", php_function);
+ rule.addWord( "empty", php_function);
+ rule.addWord( "end", php_function);
+ rule.addWord( "error_log", php_function);
+ rule.addWord( "error_reporting", php_function);
+ rule.addWord( "eval", php_function);
+ rule.addWord( "exit", php_function);
+ rule.addWord( "exp", php_function);
+ rule.addWord( "explode", php_function);
+ rule.addWord( "extension_loaded", php_function);
+ rule.addWord( "extract", php_function);
+ rule.addWord( "ezmlm_hash", php_function);
+ rule.addWord( "fclose", php_function);
+ rule.addWord( "feof", php_function);
+ rule.addWord( "fflush", php_function);
+ rule.addWord( "fgetc", php_function);
+ rule.addWord( "fgetcsv", php_function);
+ rule.addWord( "fgets", php_function);
+ rule.addWord( "fgetss", php_function);
+ rule.addWord( "file", php_function);
+ rule.addWord( "file_exists", php_function);
+ rule.addWord( "fileatime", php_function);
+ rule.addWord( "filectime", php_function);
+ rule.addWord( "filegroup", php_function);
+ rule.addWord( "fileinode", php_function);
+ rule.addWord( "filemtime", php_function);
+ rule.addWord( "fileowner", php_function);
+ rule.addWord( "fileperms", php_function);
+ rule.addWord( "filesize", php_function);
+ rule.addWord( "filetype", php_function);
+ rule.addWord( "flock", php_function);
+ rule.addWord( "floor", php_function);
+ rule.addWord( "flush", php_function);
+ rule.addWord( "fopen", php_function);
+ rule.addWord( "fpassthru", php_function);
+ rule.addWord( "fputs", php_function);
+ rule.addWord( "fread", php_function);
+ rule.addWord( "frenchtojd", php_function);
+ rule.addWord( "fscanf", php_function);
+ rule.addWord( "fseek", php_function);
+ rule.addWord( "fsockopen", php_function);
+ rule.addWord( "fstat", php_function);
+ rule.addWord( "ftell", php_function);
+ rule.addWord( "ftp_cdup", php_function);
+ rule.addWord( "ftp_chdir", php_function);
+ rule.addWord( "ftp_connect", php_function);
+ rule.addWord( "ftp_delete", php_function);
+ rule.addWord( "ftp_fget", php_function);
+ rule.addWord( "ftp_fput", php_function);
+ rule.addWord( "ftp_get", php_function);
+ rule.addWord( "ftp_login", php_function);
+ rule.addWord( "ftp_mdtm", php_function);
+ rule.addWord( "ftp_mkdir", php_function);
+ rule.addWord( "ftp_nlist", php_function);
+ rule.addWord( "ftp_pasv", php_function);
+ rule.addWord( "ftp_put", php_function);
+ rule.addWord( "ftp_pwd", php_function);
+ rule.addWord( "ftp_quit", php_function);
+ rule.addWord( "ftp_rawlist", php_function);
+ rule.addWord( "ftp_rename", php_function);
+ rule.addWord( "ftp_rmdir", php_function);
+ rule.addWord( "ftp_site", php_function);
+ rule.addWord( "ftp_size", php_function);
+ rule.addWord( "ftp_systype", php_function);
+ rule.addWord( "ftruncate", php_function);
+ rule.addWord( "fwrite", php_function);
+ rule.addWord( "get_browser", php_function);
+ rule.addWord( "get_cfg_var", php_function);
+ rule.addWord( "get_class", php_function);
+ rule.addWord( "get_class_methods", php_function);
+ rule.addWord( "get_class_vars", php_function);
+ rule.addWord( "get_current_user", php_function);
+ rule.addWord( "get_declared_classes", php_function);
+ rule.addWord( "get_defined_constants", php_function);
+ rule.addWord( "get_defined_vars", php_function);
+ rule.addWord( "get_extension_funcs", php_function);
+ rule.addWord( "get_html_translation_table", php_function);
+ rule.addWord( "get_included_files", php_function);
+ rule.addWord( "get_loaded_extensions", php_function);
+ rule.addWord( "get_magic_quotes_gpc", php_function);
+ rule.addWord( "get_magic_quotes_runtime", php_function);
+ rule.addWord( "get_meta_tags", php_function);
+ rule.addWord( "get_object_vars", php_function);
+ rule.addWord( "get_parent_class", php_function);
+ rule.addWord( "get_required_files", php_function);
+ rule.addWord( "get_resource_type", php_function);
+ rule.addWord( "getallheaders", php_function);
+ rule.addWord( "getcwd", php_function);
+ rule.addWord( "getdate", php_function);
+ rule.addWord( "getenv", php_function);
+ rule.addWord( "gethostbyaddr", php_function);
+ rule.addWord( "gethostbyname", php_function);
+ rule.addWord( "gethostbynamel", php_function);
+ rule.addWord( "getimagesize", php_function);
+ rule.addWord( "getlastmod", php_function);
+ rule.addWord( "getmxrr", php_function);
+ rule.addWord( "getmyinode", php_function);
+ rule.addWord( "getmypid", php_function);
+ rule.addWord( "getmyuid", php_function);
+ rule.addWord( "getprotobyname", php_function);
+ rule.addWord( "getprotobynumber", php_function);
+ rule.addWord( "getrandmax", php_function);
+ rule.addWord( "getrusage", php_function);
+ rule.addWord( "getservbyname", php_function);
+ rule.addWord( "getservbyport", php_function);
+ rule.addWord( "gettimeofday", php_function);
+ rule.addWord( "gettype", php_function);
+ rule.addWord( "gmdate", php_function);
+ rule.addWord( "gmmktime", php_function);
+ rule.addWord( "gmstrftime", php_function);
+ rule.addWord( "gregoriantojd", php_function);
+ rule.addWord( "header", php_function);
+ rule.addWord( "headers_sent", php_function);
+ rule.addWord( "hebrev", php_function);
+ rule.addWord( "hebrevc", php_function);
+ rule.addWord( "hexdec", php_function);
+ rule.addWord( "highlight_file", php_function);
+ rule.addWord( "highlight_string", php_function);
+ rule.addWord( "htmlentities", php_function);
+ rule.addWord( "htmlspecialchars", php_function);
+ rule.addWord( "ignore_user_abort", php_function);
+ rule.addWord( "imagealphablending", php_function);
+ rule.addWord( "imagearc", php_function);
+ rule.addWord( "imagechar", php_function);
+ rule.addWord( "imagecharup", php_function);
+ rule.addWord( "imagecolorallocate", php_function);
+ rule.addWord( "imagecolorat", php_function);
+ rule.addWord( "imagecolorclosest", php_function);
+ rule.addWord( "imagecolorclosestalpha", php_function);
+ rule.addWord( "imagecolordeallocate", php_function);
+ rule.addWord( "imagecolorexact", php_function);
+ rule.addWord( "imagecolorexactalpha", php_function);
+ rule.addWord( "imagecolorresolve", php_function);
+ rule.addWord( "imagecolorresolvealpha", php_function);
+ rule.addWord( "imagecolorset", php_function);
+ rule.addWord( "imagecolorsforindex", php_function);
+ rule.addWord( "imagecolorstotal", php_function);
+ rule.addWord( "imagecolortransparent", php_function);
+ rule.addWord( "imagecopy", php_function);
+ rule.addWord( "imagecopymerge", php_function);
+ rule.addWord( "imagecopymergegray", php_function);
+ rule.addWord( "imagecopyresampled", php_function);
+ rule.addWord( "imagecopyresized", php_function);
+ rule.addWord( "imagecreate", php_function);
+ rule.addWord( "imagecreatefromgif", php_function);
+ rule.addWord( "imagecreatefromjpeg", php_function);
+ rule.addWord( "imagecreatefrompng", php_function);
+ rule.addWord( "imagecreatefromstring", php_function);
+ rule.addWord( "imagecreatefromwbmp", php_function);
+ rule.addWord( "imagecreatetruecolor", php_function);
+ rule.addWord( "imagedashedline", php_function);
+ rule.addWord( "imagedestroy", php_function);
+ rule.addWord( "imageellipse", php_function);
+ rule.addWord( "imagefill", php_function);
+ rule.addWord( "imagefilledarc", php_function);
+ rule.addWord( "imagefilledellipse", php_function);
+ rule.addWord( "imagefilledpolygon", php_function);
+ rule.addWord( "imagefilledrectangle", php_function);
+ rule.addWord( "imagefilltoborder", php_function);
+ rule.addWord( "imagefontheight", php_function);
+ rule.addWord( "imagefontwidth", php_function);
+ rule.addWord( "imagegammacorrect", php_function);
+ rule.addWord( "imagegif", php_function);
+ rule.addWord( "imageinterlace", php_function);
+ rule.addWord( "imagejpeg", php_function);
+ rule.addWord( "imageline", php_function);
+ rule.addWord( "imageloadfont", php_function);
+ rule.addWord( "imagepng", php_function);
+ rule.addWord( "imagepolygon", php_function);
+ rule.addWord( "imagepsbbox", php_function);
+ rule.addWord( "imagepsencodefont", php_function);
+ rule.addWord( "imagepsextendfont", php_function);
+ rule.addWord( "imagepsfreefont", php_function);
+ rule.addWord( "imagepsloadfont", php_function);
+ rule.addWord( "imagepsslantfont", php_function);
+ rule.addWord( "imagepstext", php_function);
+ rule.addWord( "imagerectangle", php_function);
+ rule.addWord( "imagesetbrush", php_function);
+ rule.addWord( "imagesetpixel", php_function);
+ rule.addWord( "imagesetthickness", php_function);
+ rule.addWord( "imagesettile", php_function);
+ rule.addWord( "imagestring", php_function);
+ rule.addWord( "imagestringup", php_function);
+ rule.addWord( "imagesx", php_function);
+ rule.addWord( "imagesy", php_function);
+ rule.addWord( "imagetruecolortopalette", php_function);
+ rule.addWord( "imagettfbbox", php_function);
+ rule.addWord( "imagettftext", php_function);
+ rule.addWord( "imagetypes", php_function);
+ rule.addWord( "imagewbmp", php_function);
+ rule.addWord( "implode", php_function);
+ rule.addWord( "in_array", php_function);
+ rule.addWord( "Include()", php_function);
+ rule.addWord( "Include_once()", php_function);
+ rule.addWord( "ini_alter", php_function);
+ rule.addWord( "ini_get", php_function);
+ rule.addWord( "ini_restore", php_function);
+ rule.addWord( "ini_set", php_function);
+ rule.addWord( "intval", php_function);
+ rule.addWord( "ip2long", php_function);
+ rule.addWord( "iptcparse", php_function);
+ rule.addWord( "is_array", php_function);
+ rule.addWord( "is_bool", php_function);
+ rule.addWord( "is_dir", php_function);
+ rule.addWord( "is_double", php_function);
+ rule.addWord( "is_executable", php_function);
+ rule.addWord( "is_file", php_function);
+ rule.addWord( "is_float", php_function);
+ rule.addWord( "is_int", php_function);
+ rule.addWord( "is_integer", php_function);
+ rule.addWord( "is_link", php_function);
+ rule.addWord( "is_long", php_function);
+ rule.addWord( "is_null", php_function);
+ rule.addWord( "is_numeric", php_function);
+ rule.addWord( "is_object", php_function);
+ rule.addWord( "is_readable", php_function);
+ rule.addWord( "is_real", php_function);
+ rule.addWord( "is_resource", php_function);
+ rule.addWord( "is_scalar", php_function);
+ rule.addWord( "is_string", php_function);
+ rule.addWord( "is_subclass_of", php_function);
+ rule.addWord( "is_uploaded_file", php_function);
+ rule.addWord( "is_writable", php_function);
+ rule.addWord( "is_writeable", php_function);
+ rule.addWord( "isset", php_function);
+ rule.addWord( "jddayofweek", php_function);
+ rule.addWord( "jdmonthname", php_function);
+ rule.addWord( "jdtofrench", php_function);
+ rule.addWord( "jdtogregorian", php_function);
+ rule.addWord( "jdtojewish", php_function);
+ rule.addWord( "jdtojulian", php_function);
+ rule.addWord( "jdtounix", php_function);
+ rule.addWord( "jewishtojd", php_function);
+ rule.addWord( "join", php_function);
+ rule.addWord( "juliantojd", php_function);
+ rule.addWord( "key", php_function);
+ rule.addWord( "krsort", php_function);
+ rule.addWord( "ksort", php_function);
+ rule.addWord( "lcg_value", php_function);
+ rule.addWord( "leak", php_function);
+ rule.addWord( "levenshtein", php_function);
+ rule.addWord( "link", php_function);
+ rule.addWord( "linkinfo", php_function);
+ rule.addWord( "list", php_function);
+ rule.addWord( "localeconv", php_function);
+ rule.addWord( "localtime", php_function);
+ rule.addWord( "log", php_function);
+ rule.addWord( "log10", php_function);
+ rule.addWord( "long2ip", php_function);
+ rule.addWord( "lstat", php_function);
+ rule.addWord( "ltrim", php_function);
+ rule.addWord( "mail", php_function);
+ rule.addWord( "max", php_function);
+ rule.addWord( "mcrypt_cbc", php_function);
+ rule.addWord( "mcrypt_cfb", php_function);
+ rule.addWord( "mcrypt_create_iv", php_function);
+ rule.addWord( "mcrypt_decrypt", php_function);
+ rule.addWord( "mcrypt_ecb", php_function);
+ rule.addWord( "mcrypt_enc_get_algorithms_name", php_function);
+ rule.addWord( "mcrypt_enc_get_block_size", php_function);
+ rule.addWord( "mcrypt_enc_get_iv_size", php_function);
+ rule.addWord( "mcrypt_enc_get_key_size", php_function);
+ rule.addWord( "mcrypt_enc_get_modes_name", php_function);
+ rule.addWord( "mcrypt_enc_get_supported_key_sizes", php_function);
+ rule.addWord( "mcrypt_enc_is_block_algorithm", php_function);
+ rule.addWord( "mcrypt_enc_is_block_algorithm_mode", php_function);
+ rule.addWord( "mcrypt_enc_is_block_mode", php_function);
+ rule.addWord( "mcrypt_enc_self_test", php_function);
+ rule.addWord( "mcrypt_encrypt", php_function);
+ rule.addWord( "mcrypt_generic", php_function);
+ rule.addWord( "mcrypt_generic_end", php_function);
+ rule.addWord( "mcrypt_generic_init", php_function);
+ rule.addWord( "mcrypt_get_block_size", php_function);
+ rule.addWord( "mcrypt_get_cipher_name", php_function);
+ rule.addWord( "mcrypt_get_iv_size", php_function);
+ rule.addWord( "mcrypt_get_key_size", php_function);
+ rule.addWord( "mcrypt_list_algorithms", php_function);
+ rule.addWord( "mcrypt_list_modes", php_function);
+ rule.addWord( "mcrypt_module_get_algo_block_size", php_function);
+ rule.addWord( "mcrypt_module_get_algo_key_size", php_function);
+ rule.addWord( "mcrypt_module_get_algo_supported_key_sizes", php_function);
+ rule.addWord( "mcrypt_module_is_block_algorithm", php_function);
+ rule.addWord( "mcrypt_module_is_block_algorithm_mode", php_function);
+ rule.addWord( "mcrypt_module_is_block_mode", php_function);
+ rule.addWord( "mcrypt_module_open", php_function);
+ rule.addWord( "mcrypt_module_self_test", php_function);
+ rule.addWord( "mcrypt_ofb", php_function);
+ rule.addWord( "md5", php_function);
+ rule.addWord( "mdecrypt_generic", php_function);
+ rule.addWord( "metaphone", php_function);
+ rule.addWord( "method_exists", php_function);
+ rule.addWord( "microtime", php_function);
+ rule.addWord( "min", php_function);
+ rule.addWord( "mkdir", php_function);
+ rule.addWord( "mktime", php_function);
+ rule.addWord( "move_uploaded_file", php_function);
+ rule.addWord( "mt_getrandmax", php_function);
+ rule.addWord( "mt_rand", php_function);
+ rule.addWord( "mt_srand", php_function);
+ rule.addWord( "mysql_affected_rows", php_function);
+ rule.addWord( "mysql_change_user", php_function);
+ rule.addWord( "mysql_close", php_function);
+ rule.addWord( "mysql_connect", php_function);
+ rule.addWord( "mysql_create_db", php_function);
+ rule.addWord( "mysql_data_seek", php_function);
+ rule.addWord( "mysql_db_name", php_function);
+ rule.addWord( "mysql_db_query", php_function);
+ rule.addWord( "mysql_drop_db", php_function);
+ rule.addWord( "mysql_errno", php_function);
+ rule.addWord( "mysql_error", php_function);
+ rule.addWord( "mysql_escape_string", php_function);
+ rule.addWord( "mysql_fetch_array", php_function);
+ rule.addWord( "mysql_fetch_assoc", php_function);
+ rule.addWord( "mysql_fetch_field", php_function);
+ rule.addWord( "mysql_fetch_lengths", php_function);
+ rule.addWord( "mysql_fetch_object", php_function);
+ rule.addWord( "mysql_fetch_row", php_function);
+ rule.addWord( "mysql_field_flags", php_function);
+ rule.addWord( "mysql_field_len", php_function);
+ rule.addWord( "mysql_field_name", php_function);
+ rule.addWord( "mysql_field_seek", php_function);
+ rule.addWord( "mysql_field_table", php_function);
+ rule.addWord( "mysql_field_type", php_function);
+ rule.addWord( "mysql_free_result", php_function);
+ rule.addWord( "mysql_get_client_info", php_function);
+ rule.addWord( "mysql_get_host_info", php_function);
+ rule.addWord( "mysql_get_proto_info", php_function);
+ rule.addWord( "mysql_get_server_info", php_function);
+ rule.addWord( "mysql_insert_id", php_function);
+ rule.addWord( "mysql_list_dbs", php_function);
+ rule.addWord( "mysql_list_fields", php_function);
+ rule.addWord( "mysql_list_tables", php_function);
+ rule.addWord( "mysql_num_fields", php_function);
+ rule.addWord( "mysql_num_rows", php_function);
+ rule.addWord( "mysql_pconnect", php_function);
+ rule.addWord( "mysql_query", php_function);
+ rule.addWord( "mysql_result", php_function);
+ rule.addWord( "mysql_select_db", php_function);
+ rule.addWord( "mysql_tablename", php_function);
+ rule.addWord( "mysql_unbuffered_query", php_function);
+ rule.addWord( "natcasesort", php_function);
+ rule.addWord( "natsort", php_function);
+ rule.addWord( "next", php_function);
+ rule.addWord( "nl2br", php_function);
+ rule.addWord( "number_format", php_function);
+ rule.addWord( "ob_end_clean", php_function);
+ rule.addWord( "ob_end_flush", php_function);
+ rule.addWord( "ob_get_contents", php_function);
+ rule.addWord( "ob_get_length", php_function);
+ rule.addWord( "ob_gzhandler", php_function);
+ rule.addWord( "ob_implicit_flush", php_function);
+ rule.addWord( "ob_start", php_function);
+ rule.addWord( "octdec", php_function);
+ rule.addWord( "opendir", php_function);
+ rule.addWord( "openlog", php_function);
+ rule.addWord( "ord", php_function);
+ rule.addWord( "pack", php_function);
+ rule.addWord( "parse_str", php_function);
+ rule.addWord( "parse_url", php_function);
+ rule.addWord( "pathinfo", php_function);
+ rule.addWord( "pclose", php_function);
+ rule.addWord( "pfsockopen", php_function);
+ rule.addWord( "php_logo_guid", php_function);
+ rule.addWord( "php_sapi_name", php_function);
+ rule.addWord( "php_uname", php_function);
+ rule.addWord( "phpcredits", php_function);
+ rule.addWord( "phpinfo", php_function);
+ rule.addWord( "phpversion", php_function);
+ rule.addWord( "pi", php_function);
+ rule.addWord( "popen", php_function);
+ rule.addWord( "pos", php_function);
+ rule.addWord( "pow", php_function);
+ rule.addWord( "prev", php_function);
+ rule.addWord( "print", php_function);
+ rule.addWord( "print_r", php_function);
+ rule.addWord( "printf", php_function);
+ rule.addWord( "putenv", php_function);
+ rule.addWord( "quoted_printable_decode", php_function);
+ rule.addWord( "quotemeta", php_function);
+ rule.addWord( "rad2deg", php_function);
+ rule.addWord( "rand", php_function);
+ rule.addWord( "range", php_function);
+ rule.addWord( "rawurldecode", php_function);
+ rule.addWord( "rawurlencode", php_function);
+ rule.addWord( "read_exif_data", php_function);
+ rule.addWord( "readdir", php_function);
+ rule.addWord( "readfile", php_function);
+ rule.addWord( "readlink", php_function);
+ rule.addWord( "realpath", php_function);
+ rule.addWord( "rename", php_function);
+ rule.addWord( "Require()", php_function);
+ rule.addWord( "Require_once()", php_function);
+ rule.addWord( "reset", php_function);
+ rule.addWord( "restore_error_handler", php_function);
+ rule.addWord( "rewind", php_function);
+ rule.addWord( "rewinddir", php_function);
+ rule.addWord( "rmdir", php_function);
+ rule.addWord( "round", php_function);
+ rule.addWord( "rsort", php_function);
+ rule.addWord( "rtrim", php_function);
+ rule.addWord( "serialize", php_function);
+ rule.addWord( "session_cache_limiter", php_function);
+ rule.addWord( "session_decode", php_function);
+ rule.addWord( "session_destroy", php_function);
+ rule.addWord( "session_encode", php_function);
+ rule.addWord( "session_get_cookie_params", php_function);
+ rule.addWord( "session_id", php_function);
+ rule.addWord( "session_is_registered", php_function);
+ rule.addWord( "session_module_name", php_function);
+ rule.addWord( "session_name", php_function);
+ rule.addWord( "session_register", php_function);
+ rule.addWord( "session_save_path", php_function);
+ rule.addWord( "session_set_cookie_params", php_function);
+ rule.addWord( "session_set_save_handler", php_function);
+ rule.addWord( "session_start", php_function);
+ rule.addWord( "session_unregister", php_function);
+ rule.addWord( "session_unset", php_function);
+ rule.addWord( "session_write_close", php_function);
+ rule.addWord( "set_error_handler", php_function);
+ rule.addWord( "set_file_buffer", php_function);
+ rule.addWord( "set_magic_quotes_runtime", php_function);
+ rule.addWord( "set_time_limit", php_function);
+ rule.addWord( "setcookie", php_function);
+ rule.addWord( "setlocale", php_function);
+ rule.addWord( "settype", php_function);
+ rule.addWord( "show_source", php_function);
+ rule.addWord( "shuffle", php_function);
+ rule.addWord( "similar_text", php_function);
+ rule.addWord( "sin", php_function);
+ rule.addWord( "sizeof", php_function);
+ rule.addWord( "sleep", php_function);
+ rule.addWord( "socket_get_status", php_function);
+ rule.addWord( "socket_set_blocking", php_function);
+ rule.addWord( "socket_set_timeout", php_function);
+ rule.addWord( "sort", php_function);
+ rule.addWord( "soundex", php_function);
+ rule.addWord( "sprintf", php_function);
+ rule.addWord( "sqrt", php_function);
+ rule.addWord( "srand", php_function);
+ rule.addWord( "sscanf", php_function);
+ rule.addWord( "stat", php_function);
+ rule.addWord( "str_pad", php_function);
+ rule.addWord( "str_repeat", php_function);
+ rule.addWord( "str_replace", php_function);
+ rule.addWord( "strcasecmp", php_function);
+ rule.addWord( "strchr", php_function);
+ rule.addWord( "strcmp", php_function);
+ rule.addWord( "strcoll", php_function);
+ rule.addWord( "strcspn", php_function);
+ rule.addWord( "strftime", php_function);
+ rule.addWord( "strip_tags", php_function);
+ rule.addWord( "stripcslashes", php_function);
+ rule.addWord( "stripslashes", php_function);
+ rule.addWord( "stristr", php_function);
+ rule.addWord( "strlen", php_function);
+ rule.addWord( "strnatcasecmp", php_function);
+ rule.addWord( "strnatcmp", php_function);
+ rule.addWord( "strncasecmp", php_function);
+ rule.addWord( "strncmp", php_function);
+ rule.addWord( "strpos", php_function);
+ rule.addWord( "strrchr", php_function);
+ rule.addWord( "strrev", php_function);
+ rule.addWord( "strrpos", php_function);
+ rule.addWord( "strspn", php_function);
+ rule.addWord( "strstr", php_function);
+ rule.addWord( "strtok", php_function);
+ rule.addWord( "strtolower", php_function);
+ rule.addWord( "strtotime", php_function);
+ rule.addWord( "strtoupper", php_function);
+ rule.addWord( "strtr", php_function);
+ rule.addWord( "strval", php_function);
+ rule.addWord( "substr", php_function);
+ rule.addWord( "substr_count", php_function);
+ rule.addWord( "substr_replace", php_function);
+ rule.addWord( "symlink", php_function);
+ rule.addWord( "syslog", php_function);
+ rule.addWord( "tan", php_function);
+ rule.addWord( "tempnam", php_function);
+ rule.addWord( "time", php_function);
+ rule.addWord( "tmpfile", php_function);
+ rule.addWord( "touch", php_function);
+ rule.addWord( "trigger_error", php_function);
+ rule.addWord( "trim", php_function);
+ rule.addWord( "uasort", php_function);
+ rule.addWord( "ucfirst", php_function);
+ rule.addWord( "ucwords", php_function);
+ rule.addWord( "uksort", php_function);
+ rule.addWord( "umask", php_function);
+ rule.addWord( "uniqid", php_function);
+ rule.addWord( "unixtojd", php_function);
+ rule.addWord( "unlink", php_function);
+ rule.addWord( "unpack", php_function);
+ rule.addWord( "unserialize", php_function);
+ rule.addWord( "unset", php_function);
+ rule.addWord( "urldecode", php_function);
+ rule.addWord( "urlencode", php_function);
+ rule.addWord( "user_error", php_function);
+ rule.addWord( "usleep", php_function);
+ rule.addWord( "usort", php_function);
+ rule.addWord( "var_dump", php_function);
+ rule.addWord( "virtual", php_function);
+ rule.addWord( "wordwrap", php_function);
+ rule.addWord( "zend_logo_guid", php_function);
+ rule.addWord( "zend_version ", php_function);
+ */
+ rules.add(rule);
+
+ // Add generic whitespace rule.
+ rules.add(new WhitespaceRule(new WhitespaceDetector()));
+
+ IRule[] result = new IRule[rules.size()];
+ rules.toArray(result);
+
+ setRules(result);
+ }
+}