summaryrefslogtreecommitdiffstats
path: root/lib/SimpleSAML/Module.php
diff options
context:
space:
mode:
authorOlav Morken <olav.morken@uninett.no>2008-08-18 11:34:48 +0000
committerOlav Morken <olav.morken@uninett.no>2008-08-18 11:34:48 +0000
commit13384dde48fb2ed589146d16efbf48235d383f15 (patch)
treed508a971bd53115d831212cc269c3b662058bf11 /lib/SimpleSAML/Module.php
parent85e4deaa0c71b67db91ef6eb82cca11b6a2dff08 (diff)
downloadsimplesamlphp-13384dde48fb2ed589146d16efbf48235d383f15.zip
simplesamlphp-13384dde48fb2ed589146d16efbf48235d383f15.tar.gz
simplesamlphp-13384dde48fb2ed589146d16efbf48235d383f15.tar.bz2
Module framework for request handling.
git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@809 44740490-163a-0410-bde0-09ae8108e29a
Diffstat (limited to 'lib/SimpleSAML/Module.php')
-rw-r--r--lib/SimpleSAML/Module.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/SimpleSAML/Module.php b/lib/SimpleSAML/Module.php
index 5ac8c46..18a332b 100644
--- a/lib/SimpleSAML/Module.php
+++ b/lib/SimpleSAML/Module.php
@@ -129,6 +129,23 @@ class SimpleSAML_Module {
return $className;
}
+
+ /**
+ * Get absolute URL to a specified module resource.
+ *
+ * This function creates an absolute URL to a resource stored under ".../modules/<module>/www/".
+ *
+ * @param string $resource Resource path, on the form "<module name>/<resource>"
+ * @return string The absolute URL to the given resource.
+ */
+ public static function getModuleURL($resource) {
+ assert('is_string($resource)');
+ assert('$resource[0] !== "/"');
+
+ $config = SimpleSAML_Configuration::getInstance();
+ return SimpleSAML_Utilities::selfURLhost() . '/' . $config->getBaseURL() . 'module.php/' . $resource;
+ }
+
}
?> \ No newline at end of file