12 require_once(
'_include.php');
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',
46 assert(
'substr($url, 0, 1) === "/"');
73 if (strpos(
$url,
'\\') !==
false) {
75 } elseif (strpos(
$url,
'./') !==
false) {
82 for ($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)) {
116 if (!file_exists(
$path)) {
119 throw new SimpleSAML_Error_NotFound('The URL wasn\
't found in the module.');
122 if (preg_match(
'#\.php$#D',
$path)) {
130 $script =
"/$module/$url";
131 if (stripos(
$_SERVER[
'SCRIPT_NAME'], $script) ===
false) {
143 if (preg_match(
'#\.([^/\.]+)$#D',
$path,
$type)) {
154 if (function_exists(
'mime_content_type')) {
167 header(
'Cache-Control: public,max-age=86400');
168 header(
'Expires: '.gmdate(
'D, j M Y H:i:s \G\M\T',
time() + 10 * 60));
169 header(
'Last-Modified: '.gmdate(
'D, j M Y H:i:s \G\M\T', filemtime(
$path)));
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
if($url===false) if(!SimpleSAML\Module::isModuleEnabled($module)) if(strpos($url, '\\') !==false) elseif(strpos($url, './') !==false) $moduleDir
static getModuleDir($module)
Retrieve the base directory for a module.
if($modEnd===false) $module
if(empty($_SERVER['PATH_INFO'])) $url
Attribute-related utility methods.
if(preg_match('#\.( $contentLength[^/\.]+)$#D', $path, $type)) if($contentType===null)
Add a drawing to the header
Create styles array
The data for the language used.
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', $path)) $contentType
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.