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
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
de09698f
Unverified
Commit
de09698f
authored
7 years ago
by
Thijs Kinkhorst
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #568 from mariendev/feature/apache-cgi-support
Apache CGI support
parents
3b0edcee
f8277e80
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/SimpleSAML/Utils/Config.php
+5
-0
5 additions, 0 deletions
lib/SimpleSAML/Utils/Config.php
tests/lib/SimpleSAML/Utils/ConfigTest.php
+23
-0
23 additions, 0 deletions
tests/lib/SimpleSAML/Utils/ConfigTest.php
with
28 additions
and
0 deletions
lib/SimpleSAML/Utils/Config.php
+
5
−
0
View file @
de09698f
...
@@ -69,6 +69,11 @@ class Config
...
@@ -69,6 +69,11 @@ class Config
$configDir
=
dirname
(
dirname
(
dirname
(
__DIR__
)))
.
'/config'
;
$configDir
=
dirname
(
dirname
(
dirname
(
__DIR__
)))
.
'/config'
;
/** @var string|false $configDirEnv */
/** @var string|false $configDirEnv */
$configDirEnv
=
getenv
(
'SIMPLESAMLPHP_CONFIG_DIR'
);
$configDirEnv
=
getenv
(
'SIMPLESAMLPHP_CONFIG_DIR'
);
if
(
$configDirEnv
===
false
)
{
$configDirEnv
=
getenv
(
'REDIRECT_SIMPLESAMLPHP_CONFIG_DIR'
);
}
if
(
$configDirEnv
!==
false
)
{
if
(
$configDirEnv
!==
false
)
{
if
(
!
is_dir
(
$configDirEnv
))
{
if
(
!
is_dir
(
$configDirEnv
))
{
throw
new
\InvalidArgumentException
(
throw
new
\InvalidArgumentException
(
...
...
This diff is collapsed.
Click to expand it.
tests/lib/SimpleSAML/Utils/ConfigTest.php
+
23
−
0
View file @
de09698f
...
@@ -35,6 +35,29 @@ class ConfigTest extends TestCase
...
@@ -35,6 +35,29 @@ class ConfigTest extends TestCase
$this
->
assertEquals
(
$configDir
,
__DIR__
);
$this
->
assertEquals
(
$configDir
,
__DIR__
);
}
}
/**
* Test valid dir specified by env redirect var overrides default config dir
*/
public
function
testEnvRedirectVariableConfigDir
()
{
putenv
(
'REDIRECT_SIMPLESAMLPHP_CONFIG_DIR='
.
__DIR__
);
$configDir
=
Config
::
getConfigDir
();
$this
->
assertEquals
(
$configDir
,
__DIR__
);
}
/**
* Test which directory takes precedence
*/
public
function
testEnvRedirectPriorityVariableConfigDir
()
{
putenv
(
'SIMPLESAMLPHP_CONFIG_DIR='
.
dirname
(
__DIR__
));
putenv
(
'REDIRECT_SIMPLESAMLPHP_CONFIG_DIR='
.
__DIR__
);
$configDir
=
Config
::
getConfigDir
();
$this
->
assertEquals
(
$configDir
,
dirname
(
__DIR__
));
}
/**
/**
* Test invalid dir specified by env var results in a thrown exception
* Test invalid dir specified by env var results in a thrown exception
...
...
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