<?php
  $dir = $pathtoroot."/compat/";

  if (is_dir($dir)) 
  {
     if ($dh = opendir($dir)) 
     {
         while (($file = readdir($dh)) !== false) 
         {
         	if($file != "." && $file != ".." && substr($file,-3)=="php")
         	{
              require_once($dir.$file); 
         	}
         }
         closedir($dh);
     }
  }
?>