X-Git-Url: https://git.p6c8.net/jirafeau_mojo42.git/blobdiff_plain/db5c05cc01e7874e0a7fc7518782ab37b39911a8..6b28d8973d9d57cae8a4d1f52ec5556cbfce1840:/script.php?ds=sidebyside diff --git a/script.php b/script.php index 6fd8626..2409f1b 100755 --- a/script.php +++ b/script.php @@ -33,6 +33,11 @@ require (JIRAFEAU_ROOT . 'lib/lang.php'); 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); + if ($_SERVER['REQUEST_METHOD'] == "GET" && count ($_GET) == 0) { require (JIRAFEAU_ROOT . 'lib/template/header.php'); @@ -135,6 +140,107 @@ if ($_SERVER['REQUEST_METHOD'] == "GET" && count ($_GET) == 0) foreach ($script_langages as $lang => $name) echo "$name: " . $web_root . "script.php?lang=$lang "; echo '
'; + + 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.') . '
'; + echo t('This interface permits to create a block of data filled with zeros.') . + ' ' . t('You can read selected parts, write (using a code) and delete the block.') . + ' ' . t('Blocks may be removed after a month of non usage.'); + echo '
'; + echo '';
+ echo t('Send a GET query to') . ': ' . $web_root . 'script.php?init_block
';
+ echo '
';
+ echo t('Parameters') . ':
';
+ echo "size=size_in_bytes (" . t('Required') . ")
";
+ echo '
' . t('This will return brut text content.') . ' ' .
+ t('First line is a block id the second line the edit/delete code.') . '
';
+ echo t('Send a GET query to') . ': ' . $web_root . 'script.php?get_block_size
';
+ echo '
';
+ echo t('Parameters') . ':
';
+ echo "id=block_id (" . t('Required') . ")
";
+ echo '
' . t('This will return asked data or "Error" string.') . '
';
+ echo t('Send a GET query to') . ': ' . $web_root . 'script.php?read_block
';
+ echo '
';
+ echo t('Parameters') . ':
';
+ echo "id=block_id (" . t('Required') . ")
";
+ echo "start=byte_position_starting_from_zero (" . t('Required') . ")
";
+ echo "length=length_to_read_in_bytes (" . t('Required') . ")
";
+ echo '
' . t('This will return asked data or "Error" string.') . '
';
+ echo t('Send a GET query to') . ': ' . $web_root . 'script.php?write_block
';
+ echo '
';
+ echo t('Parameters') . ':
';
+ echo "id=block_id (" . t('Required') . ")
";
+ echo "code=block_code (" . t('Required') . ")
";
+ echo "start=byte_position_starting_from_zero (" . t('Required') . ")
";
+ echo "data=data_to_write (" . t('Required') . ")
";
+ echo '
' . t('This will return "Ok" or "Error" string.') . '
';
+ echo t('Send a GET query to') . ': ' . $web_root . 'script.php?delete_block
';
+ echo '
';
+ echo t('Parameters') . ':
';
+ echo "id=block_id (" . t('Required') . ")
";
+ echo "code=block_code (" . t('Required') . ")
";
+ echo '
' . t('This will return "Ok" or "Error" string.') . '