20require 
"MagicConfig.php";
 
   31        if (!($filehandle = @fopen(
$filename, 
"rb"))) {
 
   34        set_magic_quotes_runtime(0);
 
   36        set_magic_quotes_runtime(get_magic_quotes_gpc());
 
   43        $arr = unpack(
"C*", 
$file);
 
   44        for (
$i=1; 
$i<
sizeof($arr); 
$i++) {
 
   45            if ($arr[
$i]<32 && $arr[
$i]!=13 && $arr[
$i]!=10) {
 
   55        $extensionspl = explode($this->config->separator, 
$filename);
 
   56        $extension = $extensionspl[
sizeof($extensionspl)-1];
 
   57        $langstr = $this->config->extensions[$extension];
 
   59        $langarr = explode(
"|", $langstr);
 
   62        if (
sizeof($langarr)==1 && $langarr[0]!=
"") {
 
   71        if ($this->config->file == undef) {
 
   74        $this->is_ascii = $this->
_is_ascii($this->config->file);
 
   76        if (isset($langstr)) {
 
   81            foreach ($langarr as 
$lang) {
 
   82                if ($this->is_ascii && in_array(
$lang, $this->config->langfunctions)) {
 
   83                    array_push($outarray, 
$lang);
 
   84                } elseif (in_array(
$lang, $this->config->binfunctions)) {
 
   85                    array_push($outarray, 
$lang);
 
   88            $testarray = $outarray;
 
   90            if ($this->is_ascii) {
 
   91                $testarray = $this->config->langfunctions;
 
   93                $testarray = $this->config->binfunctions;
 
   96        foreach ($testarray as 
$test) {
 
   97            $func = 
"detect_" . 
$test;
 
   98            if ($this->config->$func()) {
 
An exception for terminatinating execution or to throw for unit testing.
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file