Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
clinicaltrials
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
david Chavalarias
clinicaltrials
Commits
1a7f31a2
Commit
1a7f31a2
authored
Dec 22, 2016
by
Romain Loth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
using 2 chars '#;' for ini comments makes it work well both for php and python!
parent
44bde70b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
6 deletions
+10
-6
parametres_comex.ini
config/parametres_comex.ini
+5
-5
parametres.php
php_library/parametres.php
+4
-0
test_parametres.php
test_parametres.php
+1
-1
No files found.
config/parametres_comex.ini
View file @
1a7f31a2
[main]
[main]
# that's where we'll be serving our routes for web server
#
;
that's where we'll be serving our routes for web server
COMEX_HOST
=
0.0.0.0
COMEX_HOST
=
0.0.0.0
COMEX_PORT
=
9090
COMEX_PORT
=
9090
# that's how much we'll log from services: DEBUG,INFO,WARNING,ERROR
#
;
that's how much we'll log from services: DEBUG,INFO,WARNING,ERROR
LOG_LEVEL
=
DEBUG
LOG_LEVEL
=
DEBUG
LOG_FILE
=
logs/services.log
LOG_FILE
=
logs/services.log
...
@@ -12,13 +12,13 @@ PREFIX=/services
...
@@ -12,13 +12,13 @@ PREFIX=/services
USR_ROUTE
=
/user
USR_ROUTE
=
/user
API_ROUTE
=
/api
API_ROUTE
=
/api
# NB: prefix should match your nginx/apache reverse proxy conf
#
;
NB: prefix should match your nginx/apache reverse proxy conf
[backends]
[backends]
# local address of mysql subservice for the comex_shared database
#
;
local address of mysql subservice for the comex_shared database
SQL_HOST
=
172.20.0.3
SQL_HOST
=
172.20.0.3
SQL_PORT
=
3306
SQL_PORT
=
3306
# local or wan address of doors subservice for client authentication credentials
#
;
local or wan address of doors subservice for client authentication credentials
DOORS_HOST
=
134.158.75.71
DOORS_HOST
=
134.158.75.71
DOORS_PORT
=
80
DOORS_PORT
=
80
php_library/parametres.php
View file @
1a7f31a2
...
@@ -19,15 +19,19 @@ $min_num_friends=0;// nombre minimal de voisin que doit avoir un scholar pour ê
...
@@ -19,15 +19,19 @@ $min_num_friends=0;// nombre minimal de voisin que doit avoir un scholar pour ê
# 1 - ENV read
# 1 - ENV read
$sql_host
=
getenv
(
"SQL_HOST"
);
$sql_host
=
getenv
(
"SQL_HOST"
);
$dbglog
=
"<p>from ENV got
\$
sql_host=
$sql_host
</p>"
;
# 2 - INI file read
# 2 - INI file read
if
(
empty
(
$sql_host
))
{
if
(
empty
(
$sql_host
))
{
$params
=
parse_ini_file
(
"config/parametres_comex.ini"
);
$params
=
parse_ini_file
(
"config/parametres_comex.ini"
);
$sql_host
=
$params
[
'SQL_HOST'
]
;
$sql_host
=
$params
[
'SQL_HOST'
]
;
$dbglog
.=
"<p>from INI got
\$
sql_host=
$sql_host
</p>"
;
}
}
# 3 - default val
# 3 - default val
if
(
empty
(
$sql_host
))
{
if
(
empty
(
$sql_host
))
{
$sql_host
=
"172.17.0.2"
;
$sql_host
=
"172.17.0.2"
;
$dbglog
.=
"<p>from DEF got
\$
sql_host=
$sql_host
</p>"
;
}
}
# other sql vars
# other sql vars
...
...
test_parametres.php
View file @
1a7f31a2
<?php
<?php
include
(
"php_library/parametres.php"
);
include
(
"php_library/parametres.php"
);
echo
"<body><p>behold the final mysql parameters<ul><li>dsn: '
$dsn
',</li> <li>user: '
$user
',</li> <li>pass: '
$pass
',</li> </ul></p></body>"
;
echo
"<body><p>behold the final mysql parameters<ul><li>dsn: '
$dsn
',</li> <li>user: '
$user
',</li> <li>pass: '
$pass
',</li> </ul></p>
$dbglog
</body>"
;
var_dump
(
$_ENV
);
var_dump
(
$_ENV
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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