Skip to content
GitLab
About GitLab
GitLab: the DevOps platform
Explore GitLab
Install GitLab
How GitLab compares
Get started
GitLab docs
GitLab Learn
Pricing
Talk to an expert
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Projects
Groups
Snippets
Sign up now
Login
Sign in
Toggle navigation
Menu
Open sidebar
project
provision
Commits
789911da
Commit
789911da
authored
Sep 06, 2014
by
Grazyna Jaworska
Browse files
Shorten and simplify the subdirs checks code.
parent
2e916fbd
Changes
4
Hide whitespace changes
Inline
Side-by-side
http/Provision/Config/Apache/vhost.tpl.php
View file @
789911da
...
...
@@ -87,13 +87,7 @@ if ($this->redirection || $ssl_redirection) {
<?php
$if_subsite
=
$this
->
data
[
'http_subdird_path'
]
.
'/'
.
$this
->
uri
;
$if_subdirs
=
drush_get_option
(
'hosting_features'
,
array
());
if
((
array_key_exists
(
'subdirs'
,
$if_subdirs
)
&&
$if_subdirs
[
'subdirs'
]))
{
$subdirs_support
=
TRUE
;
}
else
{
$subdirs_support
=
FALSE
;
}
if
(
$subdirs_support
&&
provision_file
()
->
exists
(
$if_subsite
)
->
status
())
{
if
(
array_key_exists
(
'subdirs'
,
$if_subdirs
)
&&
$if_subdirs
[
'subdirs'
]
&&
provision_file
()
->
exists
(
$if_subsite
)
->
status
())
{
print
" Include "
.
$if_subsite
.
"/*.conf
\n
"
;
}
?>
...
...
http/Provision/Config/Nginx/vhost.tpl.php
View file @
789911da
...
...
@@ -69,13 +69,7 @@ else {
}
$if_subsite
=
$this
->
data
[
'http_subdird_path'
]
.
'/'
.
$this
->
uri
;
$if_subdirs
=
drush_get_option
(
'hosting_features'
,
array
());
if
((
array_key_exists
(
'subdirs'
,
$if_subdirs
)
&&
$if_subdirs
[
'subdirs'
]))
{
$subdirs_support
=
TRUE
;
}
else
{
$subdirs_support
=
FALSE
;
}
if
(
$subdirs_support
&&
provision_file
()
->
exists
(
$if_subsite
)
->
status
())
{
if
(
array_key_exists
(
'subdirs'
,
$if_subdirs
)
&&
$if_subdirs
[
'subdirs'
]
&&
provision_file
()
->
exists
(
$if_subsite
)
->
status
())
{
print
" include "
.
$if_subsite
.
"/*.conf;
\n
"
;
}
?>
...
...
http/Provision/Service/http/apache.php
View file @
789911da
...
...
@@ -18,13 +18,7 @@ class Provision_Service_http_apache extends Provision_Service_http_public {
$this
->
configs
[
'platform'
][]
=
'Provision_Config_Apache_Platform'
;
$this
->
configs
[
'site'
][]
=
'Provision_Config_Apache_Site'
;
$if_subdirs
=
drush_get_option
(
'hosting_features'
,
array
());
if
((
array_key_exists
(
'subdirs'
,
$if_subdirs
)
&&
$if_subdirs
[
'subdirs'
]))
{
$subdirs_support
=
TRUE
;
}
else
{
$subdirs_support
=
FALSE
;
}
if
(
$subdirs_support
)
{
if
(
array_key_exists
(
'subdirs'
,
$if_subdirs
)
&&
$if_subdirs
[
'subdirs'
])
{
$this
->
configs
[
'site'
][]
=
'Provision_Config_Apache_Subdir'
;
$this
->
configs
[
'site'
][]
=
'Provision_Config_Apache_SubdirVhost'
;
}
...
...
@@ -60,7 +54,7 @@ class Provision_Service_http_apache extends Provision_Service_http_public {
/**
* Restart apache to pick up the new config files.
*/
*/
function
parse_configs
()
{
return
$this
->
restart
();
}
...
...
http/Provision/Service/http/nginx.php
View file @
789911da
...
...
@@ -24,13 +24,7 @@ class Provision_Service_http_nginx extends Provision_Service_http_public {
$this
->
server
->
setProperty
(
'phpfpm_mode'
,
'port'
);
$this
->
server
->
setProperty
(
'subdirs_support'
,
FALSE
);
$if_subdirs
=
drush_get_option
(
'hosting_features'
,
array
());
if
((
array_key_exists
(
'subdirs'
,
$if_subdirs
)
&&
$if_subdirs
[
'subdirs'
]))
{
$subdirs_support
=
TRUE
;
}
else
{
$subdirs_support
=
FALSE
;
}
if
(
$subdirs_support
)
{
if
(
array_key_exists
(
'subdirs'
,
$if_subdirs
)
&&
$if_subdirs
[
'subdirs'
])
{
$this
->
server
->
subdirs_support
=
TRUE
;
$this
->
configs
[
'site'
][]
=
'Provision_Config_Nginx_Subdir'
;
$this
->
configs
[
'site'
][]
=
'Provision_Config_Nginx_SubdirVhost'
;
...
...
@@ -84,13 +78,7 @@ class Provision_Service_http_nginx extends Provision_Service_http_public {
// Set correct subdirs_support value on server save
$if_subdirs
=
drush_get_option
(
'hosting_features'
,
array
());
if
((
array_key_exists
(
'subdirs'
,
$if_subdirs
)
&&
$if_subdirs
[
'subdirs'
]))
{
$subdirs_support
=
TRUE
;
}
else
{
$subdirs_support
=
FALSE
;
}
if
(
$subdirs_support
)
{
if
(
array_key_exists
(
'subdirs'
,
$if_subdirs
)
&&
$if_subdirs
[
'subdirs'
])
{
$this
->
server
->
subdirs_support
=
TRUE
;
}
}
...
...
@@ -141,13 +129,7 @@ class Provision_Service_http_nginx extends Provision_Service_http_public {
// Set correct subdirs_support value on server verify
$if_subdirs
=
drush_get_option
(
'hosting_features'
,
array
());
if
((
array_key_exists
(
'subdirs'
,
$if_subdirs
)
&&
$if_subdirs
[
'subdirs'
]))
{
$subdirs_support
=
TRUE
;
}
else
{
$subdirs_support
=
FALSE
;
}
if
(
$subdirs_support
)
{
if
(
array_key_exists
(
'subdirs'
,
$if_subdirs
)
&&
$if_subdirs
[
'subdirs'
])
{
$this
->
server
->
subdirs_support
=
TRUE
;
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment