12require_once(
'_include.php');
 
   15$indexFiles = array(
'index.php', 
'index.html', 
'index.htm', 
'index.txt');
 
   19    'bmp'   => 
'image/x-ms-bmp',
 
   23    'html'  => 
'text/html',
 
   24    'shtml' => 
'text/html',
 
   25    'ico'   => 
'image/vnd.microsoft.icon',
 
   26    'jpe'   => 
'image/jpeg',
 
   27    'jpeg'  => 
'image/jpeg',
 
   28    'jpg'   => 
'image/jpeg',
 
   29    'js'    => 
'text/javascript',
 
   30    'pdf'   => 
'application/pdf',
 
   32    'svg'   => 
'image/svg+xml',
 
   33    'svgz'  => 
'image/svg+xml',
 
   34    'swf'   => 
'application/x-shockwave-flash',
 
   35    'swfl'  => 
'application/x-shockwave-flash',
 
   36    'txt'   => 
'text/plain',
 
   37    'xht'   => 
'application/xhtml+xml',
 
   38    'xhtml' => 
'application/xhtml+xml',
 
   46assert(substr(
$url, 0, 1) === 
'/');
 
   73if (strpos(
$url, 
'\\') !== 
false) {
 
   75} elseif (strpos(
$url, 
'./') !== 
false) {
 
   82for ($phpPos = strpos(
$url, 
'.php/'); $phpPos !== 
false; $phpPos = strpos(
$url, 
'.php/', $phpPos + 1)) {
 
   84    $newURL = substr(
$url, 0, $phpPos + 4);
 
   85    $param = substr(
$url, $phpPos + 4);
 
  102        if (file_exists(
$path.$if)) {
 
  116if (!file_exists(
$path)) {
 
  119    throw new SimpleSAML_Error_NotFound('The URL wasn\
't found in the module.');
 
  123if (preg_match(
'#\.php$#D', mb_strtolower(
$path, 
'UTF-8'))) {
 
  132    $script = 
"/$module/$url";
 
  133    if (stripos(
$_SERVER[
'SCRIPT_NAME'], $script) === 
false) {
 
  145if (preg_match(
'#\.([^/\.]+)$#D', 
$path, 
$type)) {
 
  156    if (function_exists(
'mime_content_type')) {
 
  169header(
'Cache-Control: public,max-age=86400');
 
  170header(
'Expires: '.gmdate(
'D, j M Y H:i:s \G\M\T', time() + 10 * 60));
 
  171header(
'Last-Modified: '.gmdate(
'D, j M Y H:i:s \G\M\T', filemtime(
$path)));
 
An exception for terminatinating execution or to throw for unit testing.
static getModuleDir($module)
Retrieve the base directory for a module.
if($modEnd===false) $module
if(preg_match('#\.( $contentLength[^/\.]+) $#D', $path, $type)) if($contentType===null)
if( $url===false) if(!SimpleSAML\Module::isModuleEnabled($module)) if(strpos( $url, '\\') !==false) elseif(strpos($url, './') !==false) $moduleDir
if(empty($_SERVER['PATH_INFO'])) $url
for($phpPos=strpos($url, '.php/'); $phpPos !==false; $phpPos=strpos($url, '.php/', $phpPos+1)) $path
if( $path[strlen( $path) - 1]==='/') if(is_dir($path)) if(!file_exists( $path)) if(preg_match('#\.php$#D', mb_strtolower($path, 'UTF-8'))) $contentType
Attribute-related utility methods.
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']