25 $this->separator =
".";
27 $this->extensions = array(
33 "asp" =>
"jscript|vb|vbdotnet",
35 "bas" =>
"vb|vbdotnet",
38 "cls" =>
"vb|vbdotnet",
46 "e" =>
"eiffel|euphoria",
52 "frm" =>
"vb|vbdotnet",
55 "inc" =>
"turbopascal|vb|vbdotnet",
56 "java" =>
"javaswing",
57 "js" =>
"jscript|javascript",
60 "pas" =>
"delphi|turbopascal",
70 "vb" =>
"vb|vbdotnet",
71 "vbs" =>
"vb|vbdotnet|vbscript",
75 $this->langfunctions = array(
101 $this->binfunctions = array(
115 return !(strpos($this->file,
"//") ===
false);
120 if (preg_match(
"/^#!\s+\/bin\/nawk/", $this->file)
121 || preg_match(
"/^#!\s+\/bin\/nawk/", $this->file)
122 || preg_match(
"/^#!\s+\/usr\/bin\/nawk/", $this->file)
123 || preg_match(
"/^#!\s+\/usr\/local\/bin\/nawk/", $this->file)
124 || preg_match(
"/^#!\s+\/bin\/gawk/", $this->file)
125 || preg_match(
"/^#!\s+\/usr\/bin\/gawk/", $this->file)
126 || preg_match(
"/^#!\s+\/usr\/local\/bin\/gawk/", $this->file)
127 || preg_match(
"/^#!\s+\/bin\/awk/", $this->file)
128 || preg_match(
"/^#!\s+\/usr\/bin\/awk/", $this->file)
129 || preg_match(
"/^BEGIN\s+/", $this->file))
return true;
135 if (preg_match(
"/^#!\s+\/bin\/perl/", $this->file)
136 || preg_match(
"/^eval\s+\"exec\s+\/bin\/perl/", $this->file)
137 || preg_match(
"/^#!\s+\/usr\/bin\/perl/", $this->file)
138 || preg_match(
"/^eval\s+\"exec\s+\/usr\/bin\/perl/", $this->file)
139 || preg_match(
"/^#!\s+\/usr\/local\/bin\/perl/", $this->file)
140 || preg_match(
"/^eval\s+\"exec\s+\/usr\/local\/bin\/perl/", $this->file))
return true;
146 if (preg_match(
"/^#!\s+\/bin\/bash/", $this->file)
147 || preg_match(
"/^#!\s+\/usr\/local\/bin\/bash/", $this->file))
return true;
153 if (preg_match(
"/^#!\s+\/bin\/rc/", $this->file))
return true;
159 if (preg_match(
"/^#!\s*\/usr\/bin\/env/", $this->file))
return true;
165 if (preg_match(
"/^#!/", $this->file))
return true;
171 if (preg_match(
"/^diff\s+/", $this->file)
172 || preg_match(
"/^\*\*\*\s+/", $this->file)
173 || preg_match(
"/^Only\s+in\s+/", $this->file)
174 || preg_match(
"/^Common\s+subdirectories:\s+/", $this->file))
return true;
180 if (preg_match(
"/^%XDZ/", $this->file))
return true;
186 if (preg_match(
"/^FWS/", $this->file))
return true;
192 if (preg_match(
"/^(.*?)PS-AdobeFont-1\.0/", $this->file))
return true;
198 if (substr($this->file, 53, 10)==
"yyprevious"
199 || substr($this->file, 21, 17)==
"generated by flex")
return true;
205 return !(strpos($this->file,
";;") ===
false);
210 return preg_match(
"/^#\s+Magic/", $this->file);
215 return preg_match(
"/^Content-Type:/", $this->file);
220 return (substr($this->file, 0, 2)==
"%!" || substr($this->file, 0, 3)==(
string)(4).
"%!");
225 return substr($this->file, 0, 5)==
"{\\rtf";
230 if (preg_match(
"/\s*<!doctype\s+html/", $this->file)
231 || preg_match(
"/\s*<head/", $this->file)
232 || preg_match(
"/\s*<title/", $this->file)
233 || preg_match(
"/\s*<html/", $this->file))
return true;
239 if (preg_match(
"/\s*<\?xml/", $this->file))
return true;
245 if (preg_match(
"/\s*<!doctype/", $this->file)
246 || preg_match(
"/\s*<!subdoc/", $this->file)
247 || preg_match(
"/\s*<!--/", $this->file))
return true;
255 return (substr($this->file, 0, 6) ==
"GIF89a");
260 return !(strpos(substr($this->file, 0, 16),
"JFIF") ===
false);
265 $arr = unpack(
"C*", $this->file);
266 if (
sizeof($arr)<9)
return false;
267 return ($arr[1] == 0x89 && $arr[2] == 0x50
268 && $arr[3] == 0x4E && $arr[4] == 0x47
269 && $arr[5] == 0x0D && $arr[6] == 0x0A
270 && $arr[7] == 0x1A && $arr[8] == 0x0A);
275 return (substr($this->file, 0, 2) ==
"BM");
280 return ((substr($this->file, 0, 2) ==
"MM") || (substr($this->file, 0, 2) ==
"II"));