Commit e2d7887b067ae1e78d8ea39c733ea3f36ae7089c

Authored by Benjamin Renard
1 parent 63057027

Fix apiDoc install

1 data/ 1 data/
2 shared_data/ 2 shared_data/
  3 +help/apidoc/
3 generic_data/EPNResources/*.xml 4 generic_data/EPNResources/*.xml
4 generic_data/LocalData/ 5 generic_data/LocalData/
5 generic_data/RemoteData/ 6 generic_data/RemoteData/
@@ -20,3 +21,4 @@ _test* @@ -20,3 +21,4 @@ _test*
20 *.idea 21 *.idea
21 /nbproject/ 22 /nbproject/
22 nohup.out 23 nohup.out
  24 +php/rest/apidoc.json
php/rest/apidoc.json renamed to php/rest/apidoc.json.template
@@ -2,6 +2,6 @@ @@ -2,6 +2,6 @@
2 "name": "AMDA web-services Rest API", 2 "name": "AMDA web-services Rest API",
3 "description": "The web-services provided by AMDA aim at giving to a user access public data as well as its private data. These data may be private or shared Time Tables, public or user-defined parameters. All these webservices are also available through a SOAP interface.", 3 "description": "The web-services provided by AMDA aim at giving to a user access public data as well as its private data. These data may be private or shared Time Tables, public or user-defined parameters. All these webservices are also available through a SOAP interface.",
4 "title": "AMDA Web-services Rest API documentation", 4 "title": "AMDA Web-services Rest API documentation",
5 - "url": "http://amda.irap.omp.eu/php/rest/",  
6 - "sampleUrl": "http://amda.irap.omp.eu/php/rest/" 5 + "url": "{:REST_API_URL:}",
  6 + "sampleUrl": "{:REST_API_URL:}"
7 } 7 }
scripts/apiDoc.php
@@ -2,11 +2,11 @@ @@ -2,11 +2,11 @@
2 require_once dirname(__FILE__) . '/../php/config.php'; 2 require_once dirname(__FILE__) . '/../php/config.php';
3 3
4 $restFolderPath = AMDA_IHM . "php/rest"; 4 $restFolderPath = AMDA_IHM . "php/rest";
5 -$apidocConfigFile = $restFolderPath . "apidoc.json";  
6 -$tempConfigFile = tempnam(sys_get_temp_dir(), 'apidoc.json'); 5 +$apidocConfigTemplateFile = $restFolderPath . "/apidoc.json.template";
  6 +$apidocConfigFile = $restFolderPath . "/apidoc.json";
7 7
8 -$apidocConfig = str_replace("{:REST_API_URL:}", REST_API_URL, file_get_contents($apidocConfigFile));  
9 -file_put_contents($tempConfigFile, $apidocConfig); 8 +$apidocConfig = str_replace("{:REST_API_URL:}", REST_API_URL, file_get_contents($apidocConfigTemplateFile));
  9 +file_put_contents($apidocConfigFile, $apidocConfig);
10 10
11 -echo exec("apidoc -v -c $tempConfigFile -i $restFolderPath -o " . API_DOC_PATH); 11 +echo exec("apidoc -v -c $apidocConfigFile -i $restFolderPath -o " . API_DOC_PATH).PHP_EOL;
12 ?> 12 ?>