diff --git a/.gitignore b/.gitignore index a460998..188f3f8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ data/ shared_data/ +help/apidoc/ generic_data/EPNResources/*.xml generic_data/LocalData/ generic_data/RemoteData/ @@ -20,3 +21,4 @@ _test* *.idea /nbproject/ nohup.out +php/rest/apidoc.json diff --git a/php/rest/apidoc.json b/php/rest/apidoc.json deleted file mode 100644 index a2be39c..0000000 --- a/php/rest/apidoc.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "AMDA web-services Rest API", - "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.", - "title": "AMDA Web-services Rest API documentation", - "url": "http://amda.irap.omp.eu/php/rest/", - "sampleUrl": "http://amda.irap.omp.eu/php/rest/" -} diff --git a/php/rest/apidoc.json.template b/php/rest/apidoc.json.template new file mode 100644 index 0000000..d36fcc1 --- /dev/null +++ b/php/rest/apidoc.json.template @@ -0,0 +1,7 @@ +{ + "name": "AMDA web-services Rest API", + "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.", + "title": "AMDA Web-services Rest API documentation", + "url": "{:REST_API_URL:}", + "sampleUrl": "{:REST_API_URL:}" +} diff --git a/scripts/apiDoc.php b/scripts/apiDoc.php index ef6e6b3..b535092 100644 --- a/scripts/apiDoc.php +++ b/scripts/apiDoc.php @@ -2,11 +2,11 @@ require_once dirname(__FILE__) . '/../php/config.php'; $restFolderPath = AMDA_IHM . "php/rest"; -$apidocConfigFile = $restFolderPath . "apidoc.json"; -$tempConfigFile = tempnam(sys_get_temp_dir(), 'apidoc.json'); +$apidocConfigTemplateFile = $restFolderPath . "/apidoc.json.template"; +$apidocConfigFile = $restFolderPath . "/apidoc.json"; -$apidocConfig = str_replace("{:REST_API_URL:}", REST_API_URL, file_get_contents($apidocConfigFile)); -file_put_contents($tempConfigFile, $apidocConfig); +$apidocConfig = str_replace("{:REST_API_URL:}", REST_API_URL, file_get_contents($apidocConfigTemplateFile)); +file_put_contents($apidocConfigFile, $apidocConfig); -echo exec("apidoc -v -c $tempConfigFile -i $restFolderPath -o " . API_DOC_PATH); +echo exec("apidoc -v -c $apidocConfigFile -i $restFolderPath -o " . API_DOC_PATH).PHP_EOL; ?> -- libgit2 0.21.2