Commit 72cddaa0966aa59cc175812d1d61897d31a4d30d
1 parent
99ae8744
Exists in
master
and in
110 other branches
Add template for environment file
Showing
3 changed files
with
53 additions
and
46 deletions
Show diff stats
.gitignore
php/config.php
... | ... | @@ -7,16 +7,21 @@ |
7 | 7 | /* |
8 | 8 | * Installation-dependent settings |
9 | 9 | */ |
10 | + | |
11 | +if (!file_exists(__DIR__."/my_config.php")) { | |
12 | + die("Missing 'my_config.php' config file. Please copy the template file 'php/my_config.template' in 'php/my_config.php' and fill it with your own values."); | |
13 | +} | |
14 | + | |
10 | 15 | require_once 'my_config.php'; |
11 | 16 | |
12 | 17 | error_reporting(E_ERROR); |
13 | 18 | |
14 | 19 | # Load AMDA_Integration config |
15 | -require_once(INTEGRATION_BASE_PATH.'config/AMDAIntegrationConfig.php'); | |
20 | +require_once(INTEGRATION_BASE_PATH.'/config/AMDAIntegrationConfig.php'); | |
16 | 21 | |
17 | 22 | //AKKA - For compatibility with IHM |
18 | -define('BASE_PATH', IHM_SRC_DIR); | |
19 | -define('AMDA_IHM', IHM_SRC_DIR); | |
23 | +define('BASE_PATH', IHM_SRC_DIR."/"); | |
24 | +define('AMDA_IHM', IHM_SRC_DIR."/"); | |
20 | 25 | |
21 | 26 | //log for AmdaUpdate/AmdaInstall |
22 | 27 | define('log', IHM_SRC_DIR.'/LOG'); |
... | ... | @@ -68,51 +73,51 @@ ini_set('user_agent', 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:7.0) Gecko/201 |
68 | 73 | |
69 | 74 | |
70 | 75 | // General Info dirs |
71 | -define('DATAPATH', IHM_SRC_DIR.'generic_data/'); | |
76 | +define('DATAPATH', IHM_SRC_DIR.'/generic_data/'); | |
72 | 77 | //define('Param', DATAPATH.'Param/'); |
73 | -define('LocalData', DATAPATH.'LocalData/'); | |
74 | -define('PARAMS_LOCALDB_DIR', LocalData.'ParamDef/'); | |
75 | -define('PARAMS_LOCALINFO_DIR', LocalData.'ParamInfo/'); | |
76 | -define('ParamTemplate', LocalData.'ParamTemplate/'); | |
77 | -define('MissionInfo', LocalData.'MissionInfo'); | |
78 | -define('InstrumentInfo', LocalData.'InstrumentInfo'); | |
79 | -define('DataSetInfo', LocalData.'DataSetInfo/'); | |
80 | -define('RemoteData', DATAPATH.'RemoteData/'); | |
81 | -define('Functions', DATAPATH.'Functions/'); | |
82 | -define('HelpAuto', DATAPATH.'help/auto/'); | |
78 | +define('LocalData', DATAPATH.'/LocalData/'); | |
79 | +define('PARAMS_LOCALDB_DIR', LocalData.'/ParamDef/'); | |
80 | +define('PARAMS_LOCALINFO_DIR', LocalData.'/ParamInfo/'); | |
81 | +define('ParamTemplate', LocalData.'/ParamTemplate/'); | |
82 | +define('MissionInfo', LocalData.'/MissionInfo'); | |
83 | +define('InstrumentInfo', LocalData.'/InstrumentInfo'); | |
84 | +define('DataSetInfo', LocalData.'/DataSetInfo/'); | |
85 | +define('RemoteData', DATAPATH.'/RemoteData/'); | |
86 | +define('Functions', DATAPATH.'/Functions/'); | |
87 | +define('HelpAuto', DATAPATH.'/help/auto/'); | |
83 | 88 | //define('Plot', DATAPATH.'Plot/'); |
84 | -define('Hst', DATAPATH.'Hst/'); | |
85 | -define('SpecialSettingsDir',DATAPATH.'SpecialSettings/'); | |
89 | +define('Hst', DATAPATH.'/Hst/'); | |
90 | +define('SpecialSettingsDir',DATAPATH.'/SpecialSettings/'); | |
86 | 91 | |
87 | 92 | // General Info files |
88 | -define('orbitsXml',LocalData.'Orbites.xml'); | |
89 | -define('orbitsAllXml',LocalData.'OrbitsAll.xml'); | |
90 | -define('FeedbackXml', DATAPATH.'Feedback/Feedback.xml'); | |
91 | -define('specialGrpsXml',SpecialSettingsDir.'Groups.xml'); | |
92 | -define('specialSettingsXml',SpecialSettingsDir.'Settings.xml'); | |
93 | +define('orbitsXml',LocalData.'/Orbites.xml'); | |
94 | +define('orbitsAllXml',LocalData.'/OrbitsAll.xml'); | |
95 | +define('FeedbackXml', DATAPATH.'/Feedback/Feedback.xml'); | |
96 | +define('specialGrpsXml',SpecialSettingsDir.'/Groups.xml'); | |
97 | +define('specialSettingsXml',SpecialSettingsDir.'/Settings.xml'); | |
93 | 98 | |
94 | 99 | //Help info dirs |
95 | -define('HELPPATH', IHM_SRC_DIR."help/"); | |
100 | +define('HELPPATH', IHM_SRC_DIR."/help/"); | |
96 | 101 | |
97 | 102 | // IMPEX section |
98 | -define('SimuTargetsXml', DATAPATH.'SimuTemplate/TargetsSimu.xml'); | |
103 | +define('SimuTargetsXml', DATAPATH.'/SimuTemplate/TargetsSimu.xml'); | |
99 | 104 | define('IMPEX_INTERVAL_LIMIT', 86400); // one day for impex request |
100 | 105 | |
101 | 106 | // Root User dir : All user dirs are defined in UserMgr.php |
102 | -define('USERPATH', IHM_SRC_DIR.'data/'); | |
107 | +define('USERPATH', IHM_SRC_DIR.'/data/'); | |
103 | 108 | |
104 | 109 | // Shared dir |
105 | -define('SHAREDPATH', IHM_SRC_DIR.'shared_data/'); | |
110 | +define('SHAREDPATH', IHM_SRC_DIR.'/shared_data/'); | |
106 | 111 | |
107 | 112 | // WEB SERVICES section |
108 | -define('WSRESULT', USERPATH.'WSRESULT/'); // Web Services result directory | |
109 | -define('wsResultsXml',WSRESULT.'WSresults.xml'); // Web Service result file | |
110 | -define('plotsXml', IHM_SRC_DIR.'public/WebServices/XML/AmdaPlots.xml'); // Web Service getPlot : list of parameters to plot | |
113 | +define('WSRESULT', USERPATH.'/WSRESULT/'); // Web Services result directory | |
114 | +define('wsResultsXml',WSRESULT.'/WSresults.xml'); // Web Service result file | |
115 | +define('plotsXml', IHM_SRC_DIR.'/public/WebServices/XML/AmdaPlots.xml'); // Web Service getPlot : list of parameters to plot | |
111 | 116 | |
112 | 117 | // Web Service servers WSDL : $_SERVER['SERVER_NAME'] (par apache) gethostname() (par command) |
113 | 118 | $SERVER_NAME = $_SERVER['SERVER_NAME'] ? $_SERVER['SERVER_NAME'] : gethostname(); |
114 | 119 | define('webAlias',"http://".$SERVER_NAME.APACHE_ALIAS); |
115 | -define('wsdl_AMDA', webAlias."public/wsdl/Methods_AMDA.wsdl"); | |
120 | +define('wsdl_AMDA', webAlias."/public/wsdl/Methods_AMDA.wsdl"); | |
116 | 121 | |
117 | 122 | define('DD_WSDL',DDSERVICE.'/dd.wsdl'); |
118 | 123 | |
... | ... | @@ -120,9 +125,9 @@ putenv("LD_LIBRARY_PATH=".COTS_BASE_DIR."/lib:".GCC_BASE_DIR."/lib:".GCC_BASE_DI |
120 | 125 | putenv("PATH=./:".COTS_BASE_DIR."/bin:".GCC_BASE_DIR."/bin:"."/bin:/usr/bin:/usr/local/bin:".IHM_SRC_DIR."/php/bin"); |
121 | 126 | |
122 | 127 | putenv("DDPATH=".DDRES_DIR); |
123 | -define('XMLPATH', IHM_SRC_DIR.'php/XML/'); | |
128 | +define('XMLPATH', IHM_SRC_DIR.'/php/XML/'); | |
124 | 129 | |
125 | -require_once(INTEGRATION_BASE_PATH.'src/amdaintegration_autoload.php'); | |
130 | +require_once(INTEGRATION_BASE_PATH.'/src/amdaintegration_autoload.php'); | |
126 | 131 | |
127 | 132 | global $API; |
128 | 133 | $API = array( | ... | ... |
php/my_config.php renamed to php/my_config.template.php
... | ... | @@ -5,30 +5,31 @@ |
5 | 5 | * |
6 | 6 | */ |
7 | 7 | |
8 | -//AKKA - Path to AMDA_Integration base dir | |
9 | -define('INTEGRATION_BASE_PATH', '/home/brenard/AMDA-GIT/AMDA_Integration/'); | |
8 | +//This is a template file. | |
9 | +//Copy this file in php/my_config.php and replace all placeholders (included between "{:" and ":}" flags) by your own values | |
10 | 10 | |
11 | +//Path to AMDA_Integration base dir | |
12 | +define('INTEGRATION_BASE_PATH', '{:INTEGRATION_BASE_PATH:}'); | |
11 | 13 | //DD WebServices |
12 | -define('DDSERVICE', 'http://amdadev.fr/DDService/'); | |
14 | +define('DDSERVICE', '{:DDSERVICE:}'); | |
13 | 15 | // User apache |
14 | -define('APACHE_USER', 'apache'); | |
16 | +define('APACHE_USER', '{:APACHE_USER:}'); | |
15 | 17 | // Alias for name of AMDA |
16 | -define('APACHE_ALIAS', ''); | |
18 | +define('APACHE_ALIAS', '{:APACHE_ALIAS:}'); | |
17 | 19 | //email to send errors from AmdaUpdate/AmdaInstall |
18 | -define('email','ebudnik@irap.omp.eu'); | |
19 | - | |
20 | -define('TITLE', 'AMDANEW-Test'); | |
21 | - | |
20 | +define('email', '{:email:}'); | |
21 | +//IHM title | |
22 | +define('TITLE', '{:TITLE:}'); | |
22 | 23 | // real upload_max_filesize is defined in /etc/php.ini : ini_get('upload_max_filesize') |
23 | 24 | // here for additional flexibility |
24 | -define('MAX_UPLOADED_FILESIZE',30000000); // in bytes !!! | |
25 | +define('MAX_UPLOADED_FILESIZE',{:MAX_UPLOADED_FILESIZE:}); // in bytes !!! | |
25 | 26 | |
26 | 27 | // To define only if you are behind a proxy |
27 | -#define('PROXY_HOST','and-fgt-ha.akka.eu:9090'); | |
28 | -#define('PROXY_USERPWD','benjamin.renard:Ocu4teickpa&da'); | |
28 | +define('PROXY_HOST','{:PROXY_HOST:}'); | |
29 | +define('PROXY_USERPWD','{:PROXY_USERPWD:}'); | |
29 | 30 | |
30 | -define('NEWMETA', '/home/brenard/AMDA-GIT/NEWMETA'); | |
31 | -define('AMDA_SPASE_INTERFACE', '/home/brenard/AMDA-GIT/AMDA_SPASE_INTERFACE'); | |
32 | -define('AMDAINTERNALDIR', '/home/brenard/AMDA-GIT/AMDA_INTERNAL_METADATA'); | |
31 | +define('NEWMETA', '{:NEWMETA:}'); | |
32 | +define('AMDA_SPASE_INTERFACE', '{:AMDA_SPASE_INTERFACE:}'); | |
33 | +define('AMDAINTERNALDIR', '{:AMDAINTERNALDIR:}'); | |
33 | 34 | |
34 | 35 | ?> | ... | ... |