\PrivateBinController

Controller

Puts it all together.

Summary

Methods
Properties
Constants
__construct()
No public properties found
VERSION
MIN_PHP_VERSION
GENERIC_ERROR
No protected methods found
No protected properties found
N/A
_init()
_create()
_delete()
_read()
_view()
_jsonld()
_return_message()
$_conf
$_error
$_status
$_json
$_model
$_request
$_urlBase
N/A

Constants

VERSION

VERSION

version

MIN_PHP_VERSION

MIN_PHP_VERSION

minimal required PHP version

GENERIC_ERROR

GENERIC_ERROR

show the same error message if the paste expired or does not exist

Properties

$_error

$_error : string

error message

Type

string

$_status

$_status : string

status message

Type

string

$_json

$_json : string

JSON message

Type

string

$_model

$_model : \PrivateBin\model

Factory of instance models

Type

\PrivateBin\model

$_request

$_request : \PrivateBin\request

request

Type

\PrivateBin\request

$_urlBase

$_urlBase : string

URL base

Type

string

Methods

__construct()

__construct() 

constructor

initializes and runs PrivateBin

Throws

\Exception

_init()

_init() 

initialize PrivateBin

_create()

_create() : string

Store new paste or comment

POST contains one or both: data = json encoded SJCL encrypted text (containing keys: iv,v,iter,ks,ts,mode,adata,cipher,salt,ct) attachment = json encoded SJCL encrypted text (containing keys: iv,v,iter,ks,ts,mode,adata,cipher,salt,ct)

All optional data will go to meta information: expire (optional) = expiration delay (never,5min,10min,1hour,1day,1week,1month,1year,burn) (default:never) formatter (optional) = format to display the paste as (plaintext,syntaxhighlighting,markdown) (default:syntaxhighlighting) burnafterreading (optional) = if this paste may only viewed once ? (0/1) (default:0) opendiscusssion (optional) = is the discussion allowed on this paste ? (0/1) (default:0) attachmentname = json encoded SJCL encrypted text (containing keys: iv,v,iter,ks,ts,mode,adata,cipher,salt,ct) nickname (optional) = in discussion, encoded SJCL encrypted text nickname of author of comment (containing keys: iv,v,iter,ks,ts,mode,adata,cipher,salt,ct) parentid (optional) = in discussion, which comment this comment replies to. pasteid (optional) = in discussion, which paste this comment belongs to.

Returns

string

_delete()

_delete(string  $dataid, string  $deletetoken) 

Delete an existing paste

Parameters

string $dataid
string $deletetoken

_read()

_read(string  $dataid) 

Read an existing paste or comment, only allowed via a JSON API call

Parameters

string $dataid

_view()

_view() 

Display frontend.

_jsonld()

_jsonld(string  $type) 

outputs requested JSON-LD context

Parameters

string $type

_return_message()

_return_message(integer  $status, string  $message, array  $other = array()) 

prepares JSON encoded status message

Parameters

integer $status
string $message
array $other