X-Git-Url: https://git.p6c8.net/jirafeau_mojo42.git/blobdiff_plain/2a71cdda5bacf89790a214a38174e5ced3ad07c0..e4f9c92ff84f6146aaf1244147082efd57e289f6:/script.php?ds=sidebyside diff --git a/script.php b/script.php old mode 100755 new mode 100644 index eda2cc9..09c7a8c --- a/script.php +++ b/script.php @@ -25,24 +25,31 @@ define ('JIRAFEAU_ROOT', dirname (__FILE__) . '/'); -require (JIRAFEAU_ROOT . 'lib/config.php'); +require (JIRAFEAU_ROOT . 'lib/config.original.php'); require (JIRAFEAU_ROOT . 'lib/settings.php'); require (JIRAFEAU_ROOT . 'lib/functions.php'); require (JIRAFEAU_ROOT . 'lib/lang.php'); -if (file_exists (JIRAFEAU_ROOT . 'install.php')) -{ - header('Content-Type: text; charset=utf-8'); - echo "Error"; - exit; -} - global $script_langages; $script_langages = array ('bash' => 'Bash'); +/* Operations may take a long time. + * Be sure PHP's safe mode is off. + */ +@set_time_limit(0); +/* Remove errors. */ +@error_reporting(0); + if ($_SERVER['REQUEST_METHOD'] == "GET" && count ($_GET) == 0) { require (JIRAFEAU_ROOT . 'lib/template/header.php'); + check_errors ($cfg); + if (has_error ()) + { + show_errors (); + require (JIRAFEAU_ROOT . 'lib/template/footer.php'); + exit; + } echo '
'; @@ -50,6 +57,19 @@ if ($_SERVER['REQUEST_METHOD'] == "GET" && count ($_GET) == 0) ' ' . t('The instructions above show how to query this interface.'); echo '
'; + echo '';
+ echo t('Send a GET query to') . ': ' . $web_root . 'script.php
';
+ echo '
';
+ echo t('Parameters') . ':
';
+ echo "get_version=1 (" . t('Required') . ")
";
+ echo '
' . t('This will return brut text content.') . ' ' .
+ t('First line is the version number.') . '
'; + echo t('Example') . ": " . $web_root . "script.php?get_version=1 "; + echo '
'; + echo '';
echo t('Send a GET query to') . ': ' . $web_root . 'script.php
';
@@ -122,6 +142,47 @@ if ($_SERVER['REQUEST_METHOD'] == "GET" && count ($_GET) == 0)
foreach ($script_langages as $lang => $name)
echo "$name: " . $web_root . "script.php?lang=$lang ";
echo '
'; + echo t('The goal is to permit to transfert big file, chunk by chunk.') . ' '; + echo t('Chunks of data must be sent in order.'); + echo '
'; + echo '';
+ echo t('Send a GET query to') . ': ' . $web_root . 'script.php?init_async
';
+ echo '
';
+ echo t('Parameters') . ':
';
+ echo "filename=file_name.ext (" . t('Required') . ")
";
+ echo "type=MIME_TYPE (" . t('Optional') . ")
";
+ echo "time=[minute|hour|day|week|month|none] (" . t('Optional') . ', '. t('default: none') . ")
";
+ echo "password=your_password (" . t('Optional') . ")
";
+ echo "one_time_download=1 (" . t('Optional') . ")
";
+ echo '
' . t('This will return brut text content.') . ' ' .
+ t('First line is the asynchronous transfert reference and the second line the code to use in the next operation.') . '
';
+ echo t('Send a GET query to') . ': ' . $web_root . 'script.php?push_async
';
+ echo '
';
+ echo t('Parameters') . ':
';
+ echo "ref=async_reference (" . t('Required') . ")
";
+ echo "data=data_chunk (" . t('Required') . ")
";
+ echo "code=last_provided_code (" . t('Required') . ")
";
+ echo '
' . t('This will return brut text content.') . ' ' .
+ t('Returns the next code to use.') . '
';
+ echo t('Send a GET query to') . ': ' . $web_root . 'script.php?end_async
';
+ echo '
';
+ echo t('Parameters') . ':
';
+ echo "ref=async_reference (" . t('Required') . ")
";
+ echo "code=last_provided_code (" . t('Required') . ")
";
+ echo '
' . t('This will return brut text content.') . ' ' .
+ t('First line is the download reference and the second line the delete code.') . '