Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
simplesamlphp
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Perun
Perun ProxyIdP
v1
simplesamlphp
Commits
ec481f73
Commit
ec481f73
authored
10 years ago
by
Thijs Kinkhorst
Browse files
Options
Downloads
Patches
Plain Diff
Throw an error when downloading remote module definition fails.
parent
914e101a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/core/lib/ModuleDefinition.php
+4
-1
4 additions, 1 deletion
modules/core/lib/ModuleDefinition.php
with
4 additions
and
1 deletion
modules/core/lib/ModuleDefinition.php
+
4
−
1
View file @
ec481f73
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
/**
/**
* Represents a definiti
n
o of a module.
* Represents a definitio
n
of a module.
* Is usually read and parsed from a JSON definition file.
* Is usually read and parsed from a JSON definition file.
*
*
* @Author Andreas Åkre Solberg, <andreas.solberg@uninett.no>
* @Author Andreas Åkre Solberg, <andreas.solberg@uninett.no>
...
@@ -43,6 +43,9 @@ class sspmod_core_ModuleDefinition {
...
@@ -43,6 +43,9 @@ class sspmod_core_ModuleDefinition {
}
elseif
(
preg_match
(
'|^http(s)?://.*$|'
,
$id
))
{
}
elseif
(
preg_match
(
'|^http(s)?://.*$|'
,
$id
))
{
$defraw
=
file_get_contents
(
$id
);
$defraw
=
file_get_contents
(
$id
);
if
(
$defraw
===
FALSE
)
{
throw
new
Exception
(
'Error while downloading module definition ['
.
$id
.
']'
);
}
$def
=
json_decode
(
$defraw
,
TRUE
);
$def
=
json_decode
(
$defraw
,
TRUE
);
}
else
{
}
else
{
throw
new
Exception
(
'Could not resolve ['
.
$id
.
'] as URL nor module identifier.'
);
throw
new
Exception
(
'Could not resolve ['
.
$id
.
'] as URL nor module identifier.'
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment