API - XOOPS 2.5.11 Beta 2
By monxoops.fr
|
Functions | |
get_request_method () | |
Variables | |
if (isset( $_POST[ 'Authorization'])) | |
$xoopsLogger | activated = false |
$assert | |
$claims = TokenReader::fromRequest('fineuploader', 'Authorization', $assert) | |
$handler = (property_exists($claims, 'handler')) ? $claims->handler : '' | |
$moddir = (property_exists($claims, 'moddir')) ? $claims->moddir : '' | |
if($handler===''|| $moddir==='') | $className = $handler |
if(false===strpos($handler, '\\')) | $uploader = new $className($claims) |
$method = get_request_method() | |
if( $method==="POST") elseif($method=="DELETE") | else |
get_request_method | ( | ) |
This will retrieve the "intended" request method. Normally, this is the actual method of the request. Sometimes, though, the intended request method must be hidden in the parameters of the request. For example, when attempting to delete a file using a POST request. In that case, "DELETE" will be sent along with the request in a "_method" parameter.
$assert |
Get our expected claims from the JSON Web Token.
This is the list of claims which should be included:
aud audience (asserted as our php script name) cat category id the user has chosen and is authorized for uid user id (asserted as the session specified user) handler handler class moddir module directory for handler
We will assert that aud and uid agree with our expectations (for security)
$claims = TokenReader::fromRequest('fineuploader', 'Authorization', $assert) |
if ( $handler===''||$moddir==='') $className = $handler |
The handler claim can be specified as either:
$handler = (property_exists($claims, 'handler')) ? $claims->handler : '' |
$method = get_request_method() |
$moddir = (property_exists($claims, 'moddir')) ? $claims->moddir : '' |
if (false===strpos( $handler, '\\')) $uploader = new $className($claims) |
$xoopsLogger activated = false |
if($method==="POST") elseif ( $method=="DELETE") else |
if(isset($_POST['Authorization'])) | ( | isset( $_POST[ 'Authorization']) | ) |
PHP Server-Side Example for Fine Uploader (traditional endpoint handler). Maintained by Widen Enterprises.
This example:
Follow these steps to get up and running with Fine Uploader in a PHP environment:
chunking.success.endpoint
option. This will be called by Fine Uploader when all chunks for a file have been successfully uploaded, triggering the PHP server to combine all parts into one file. This is particularly useful for the concurrent chunking feature, but is now required in all cases if you are making use of this PHP example.@license MIT License (MIT)