Documentation

Controller
in package

Controller

Puts it all together.

Table of Contents

Constants

GENERIC_ERROR  = 'Paste does not exist, has expired or has been deleted.'
show the same error message if the paste expired or does not exist
MIN_PHP_VERSION  = '7.3.0'
minimal required PHP version
VERSION  = '1.7.5'
version

Properties

$_conf  : Configuration
configuration
$_error  : string
error message
$_is_deleted  : bool
status message
$_json  : string
JSON message
$_model  : model
Factory of instance models
$_request  : request
request
$_status  : string
status message
$_urlBase  : string
URL base

Methods

__construct()  : mixed
constructor
_create()  : string
Store new paste or comment
_delete()  : mixed
Delete an existing paste
_init()  : mixed
initialize PrivateBin
_jsonld()  : mixed
outputs requested JSON-LD context
_read()  : mixed
Read an existing paste or comment, only allowed via a JSON API call
_return_message()  : mixed
prepares JSON encoded status message
_setCacheHeaders()  : mixed
Turn off browser caching
_view()  : mixed
Display frontend.
_yourlsproxy()  : mixed
proxies link to YOURLS, updates status or error with response

Constants

GENERIC_ERROR

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

public mixed GENERIC_ERROR = 'Paste does not exist, has expired or has been deleted.'
Tags
const

string

MIN_PHP_VERSION

minimal required PHP version

public mixed MIN_PHP_VERSION = '7.3.0'
Tags
const

string

VERSION

version

public mixed VERSION = '1.7.5'
Tags
const

string

Properties

$_error

error message

private string $_error = ''
Tags
access

private

$_is_deleted

status message

private bool $_is_deleted = false
Tags
access

private

$_json

JSON message

private string $_json = ''
Tags
access

private

$_model

Factory of instance models

private model $_model
Tags
access

private

$_request

request

private request $_request
Tags
access

private

$_status

status message

private string $_status = ''
Tags
access

private

$_urlBase

URL base

private string $_urlBase
Tags
access

private

Methods

__construct()

constructor

public __construct() : mixed

initializes and runs PrivateBin

Tags
access

public

throws
Exception

_create()

Store new paste or comment

private _create() : string

POST contains one or both: data = json encoded FormatV2 encrypted text (containing keys: iv,v,iter,ks,ts,mode,adata,cipher,salt,ct) attachment = json encoded FormatV2 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 FormatV2 encrypted text (containing keys: iv,v,iter,ks,ts,mode,adata,cipher,salt,ct) nickname (optional) = in discussion, encoded FormatV2 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.

Tags
access

private

Return values
string

_delete()

Delete an existing paste

private _delete(string $dataid, string $deletetoken) : mixed
Parameters
$dataid : string
$deletetoken : string
Tags
access

private

_init()

initialize PrivateBin

private _init() : mixed
Tags
access

private

throws
Exception

_jsonld()

outputs requested JSON-LD context

private _jsonld(string $type) : mixed
Parameters
$type : string
Tags
access

private

_read()

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

private _read(string $dataid) : mixed
Parameters
$dataid : string
Tags
access

private

_return_message()

prepares JSON encoded status message

private _return_message(int $status, string $message[, array<string|int, mixed> $other = array() ]) : mixed
Parameters
$status : int
$message : string
$other : array<string|int, mixed> = array()
Tags
access

private

_setCacheHeaders()

Turn off browser caching

private _setCacheHeaders() : mixed
Tags
access

private

_view()

Display frontend.

private _view() : mixed
Tags
access

private

_yourlsproxy()

proxies link to YOURLS, updates status or error with response

private _yourlsproxy(string $link) : mixed
Parameters
$link : string
Tags
access

private


        
On this page

Search results