Definition at line 21 of file MagicConfig.php.
◆ detect_awk()
MagicConfig::detect_awk |
( |
| ) |
|
Definition at line 118 of file MagicConfig.php.
References file.
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;
Reload workbook from saved file
◆ detect_bash()
MagicConfig::detect_bash |
( |
| ) |
|
Definition at line 144 of file MagicConfig.php.
References file.
146 if (preg_match(
"/^#!\s+\/bin\/bash/", $this->
file)
147 || preg_match(
"/^#!\s+\/usr\/local\/bin\/bash/", $this->
file))
return true;
Reload workbook from saved file
◆ detect_bmp()
MagicConfig::detect_bmp |
( |
| ) |
|
Definition at line 273 of file MagicConfig.php.
References file.
275 return (substr($this->
file, 0, 2) ==
"BM");
Reload workbook from saved file
◆ detect_cpp()
MagicConfig::detect_cpp |
( |
| ) |
|
Definition at line 113 of file MagicConfig.php.
References file.
115 return !(strpos($this->
file,
"//") ===
false);
Reload workbook from saved file
◆ detect_diff()
MagicConfig::detect_diff |
( |
| ) |
|
Definition at line 169 of file MagicConfig.php.
References file.
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;
Reload workbook from saved file
◆ detect_env()
MagicConfig::detect_env |
( |
| ) |
|
Definition at line 157 of file MagicConfig.php.
References file.
159 if (preg_match(
"/^#!\s*\/usr\/bin\/env/", $this->
file))
return true;
Reload workbook from saved file
◆ detect_genericshell()
MagicConfig::detect_genericshell |
( |
| ) |
|
Definition at line 163 of file MagicConfig.php.
References file.
165 if (preg_match(
"/^#!/", $this->
file))
return true;
Reload workbook from saved file
◆ detect_gif()
MagicConfig::detect_gif |
( |
| ) |
|
Definition at line 253 of file MagicConfig.php.
References file.
255 return (substr($this->
file, 0, 6) ==
"GIF89a");
Reload workbook from saved file
◆ detect_html()
MagicConfig::detect_html |
( |
| ) |
|
Definition at line 228 of file MagicConfig.php.
References file.
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;
Reload workbook from saved file
◆ detect_jpeg()
MagicConfig::detect_jpeg |
( |
| ) |
|
Definition at line 258 of file MagicConfig.php.
References file.
260 return !(strpos(substr($this->
file, 0, 16),
"JFIF") ===
false);
Reload workbook from saved file
◆ detect_lex()
MagicConfig::detect_lex |
( |
| ) |
|
Definition at line 196 of file MagicConfig.php.
References file.
198 if (substr($this->
file, 53, 10)==
"yyprevious" 199 || substr($this->
file, 21, 17)==
"generated by flex")
return true;
Reload workbook from saved file
◆ detect_lisp()
MagicConfig::detect_lisp |
( |
| ) |
|
Definition at line 203 of file MagicConfig.php.
References file.
205 return !(strpos($this->
file,
";;") ===
false);
Reload workbook from saved file
◆ detect_magic()
MagicConfig::detect_magic |
( |
| ) |
|
Definition at line 208 of file MagicConfig.php.
References file.
210 return preg_match(
"/^#\s+Magic/", $this->
file);
Reload workbook from saved file
◆ detect_mime()
MagicConfig::detect_mime |
( |
| ) |
|
Definition at line 213 of file MagicConfig.php.
References file.
215 return preg_match(
"/^Content-Type:/", $this->
file);
Reload workbook from saved file
◆ detect_perl()
MagicConfig::detect_perl |
( |
| ) |
|
Definition at line 133 of file MagicConfig.php.
References file.
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;
Reload workbook from saved file
◆ detect_png()
MagicConfig::detect_png |
( |
| ) |
|
Definition at line 263 of file MagicConfig.php.
References file.
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);
Reload workbook from saved file
◆ detect_postscript()
MagicConfig::detect_postscript |
( |
| ) |
|
Definition at line 218 of file MagicConfig.php.
References file.
220 return (substr($this->
file, 0, 2)==
"%!" || substr($this->
file, 0, 3)==(
string)(4).
"%!");
Reload workbook from saved file
◆ detect_psfont()
MagicConfig::detect_psfont |
( |
| ) |
|
Definition at line 190 of file MagicConfig.php.
References file.
192 if (preg_match(
"/^(.*?)PS-AdobeFont-1\.0/", $this->
file))
return true;
Reload workbook from saved file
◆ detect_rc()
MagicConfig::detect_rc |
( |
| ) |
|
Definition at line 151 of file MagicConfig.php.
References file.
153 if (preg_match(
"/^#!\s+\/bin\/rc/", $this->
file))
return true;
Reload workbook from saved file
◆ detect_rtf()
MagicConfig::detect_rtf |
( |
| ) |
|
Definition at line 223 of file MagicConfig.php.
References file.
225 return substr($this->
file, 0, 5)==
"{\\rtf";
Reload workbook from saved file
◆ detect_sgml()
MagicConfig::detect_sgml |
( |
| ) |
|
Definition at line 243 of file MagicConfig.php.
References file.
245 if (preg_match(
"/\s*<!doctype/", $this->
file)
246 || preg_match(
"/\s*<!subdoc/", $this->
file)
247 || preg_match(
"/\s*<!--/", $this->
file))
return true;
Reload workbook from saved file
◆ detect_swf()
MagicConfig::detect_swf |
( |
| ) |
|
Definition at line 184 of file MagicConfig.php.
References file.
186 if (preg_match(
"/^FWS/", $this->
file))
return true;
Reload workbook from saved file
◆ detect_tif()
MagicConfig::detect_tif |
( |
| ) |
|
Definition at line 278 of file MagicConfig.php.
References file.
280 return ((substr($this->
file, 0, 2) ==
"MM") || (substr($this->
file, 0, 2) ==
"II"));
Reload workbook from saved file
◆ detect_xdiff()
MagicConfig::detect_xdiff |
( |
| ) |
|
Definition at line 178 of file MagicConfig.php.
References file.
180 if (preg_match(
"/^%XDZ/", $this->
file))
return true;
Reload workbook from saved file
◆ detect_xml()
MagicConfig::detect_xml |
( |
| ) |
|
Definition at line 237 of file MagicConfig.php.
References file.
239 if (preg_match(
"/\s*<\?xml/", $this->
file))
return true;
Reload workbook from saved file
◆ MagicConfig()
MagicConfig::MagicConfig |
( |
| ) |
|
Definition at line 23 of file MagicConfig.php.
References array.
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(
Create styles array
The data for the language used.
The documentation for this class was generated from the following file: