From: Jerome Jutteau Date: Thu, 31 Jan 2013 20:58:13 +0000 (+0100) Subject: Add the capacity to grab version using the scripting interface X-Git-Tag: 1.1~222 X-Git-Url: https://git.p6c8.net/jirafeau_mojo42.git/commitdiff_plain/e788e47fbd5f963e03de3b7eba41580f1f00dd0f?ds=sidebyside Add the capacity to grab version using the scripting interface --- diff --git a/lib/lang/fr.php b/lib/lang/fr.php index c8001c8..ed3110b 100755 --- a/lib/lang/fr.php +++ b/lib/lang/fr.php @@ -132,6 +132,7 @@ $tr = array ( 'This interface permits to script your uploads and downloads.' => 'Cette interface permet de programmer vos envoie et téléversements.', 'The instructions above show how to query this interface.' => 'Les instructions ci-dessous montrent comment interroger cette interface.', 'Get server capacity' => 'Récupérer la capacité d\'envoie du serveur', + 'Get Jirafeau\'s version' => 'Récupérer la version de Jirafeau', 'Send a GET query to' => 'Envoyez une requette GET à', 'Send a POST query to' => 'Envoyez une requette POST à', 'Required' => 'Requis', diff --git a/script.php b/script.php index eda2cc9..8968aac 100755 --- a/script.php +++ b/script.php @@ -50,6 +50,19 @@ if ($_SERVER['REQUEST_METHOD'] == "GET" && count ($_GET) == 0) ' ' . t('The instructions above show how to query this interface.'); echo '

'; + echo '

' . t('Get Jirafeau\'s version') . ':

'; + echo '

'; + echo t('Send a GET query to') . ': ' . $web_root . 'script.php
'; + echo '
'; + echo t('Parameters') . ':
'; + echo "get_version=1 (" . t('Required') . ")
"; + echo '

'; + echo '

' . t('This will return brut text content.') . ' ' . + t('First line is the version number.') . '

'; + echo '

'; + echo t('Example') . ": " . $web_root . "script.php?get_version=1 "; + echo '

'; + echo '

' . t('Get server capacity') . ':

'; echo '

'; echo t('Send a GET query to') . ': ' . $web_root . 'script.php
'; @@ -240,6 +253,10 @@ elseif (isset ($_GET['get_capacity'])) echo min (jirafeau_ini_to_bytes (ini_get ('post_max_size')), jirafeau_ini_to_bytes (ini_get ('upload_max_filesize'))); } +elseif (isset ($_GET['get_version'])) +{ + echo JIRAFEAU_VERSION; +} elseif (isset ($_GET['lang'])) { $l=$_GET['lang'];