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
MIN_PHP_VERSION
minimal required PHP version
public
mixed
MIN_PHP_VERSION
= '7.3.0'
Tags
VERSION
version
public
mixed
VERSION
= '1.7.5'
Tags
Properties
$_conf
configuration
private
Configuration
$_conf
Tags
$_error
error message
private
string
$_error
= ''
Tags
$_is_deleted
status message
private
bool
$_is_deleted
= false
Tags
$_json
JSON message
private
string
$_json
= ''
Tags
$_model
Factory of instance models
private
model
$_model
Tags
$_request
request
private
request
$_request
Tags
$_status
status message
private
string
$_status
= ''
Tags
$_urlBase
URL base
private
string
$_urlBase
Tags
Methods
__construct()
constructor
public
__construct() : mixed
initializes and runs PrivateBin
Tags
_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
Return values
string_delete()
Delete an existing paste
private
_delete(string $dataid, string $deletetoken) : mixed
Parameters
- $dataid : string
- $deletetoken : string
Tags
_init()
initialize PrivateBin
private
_init() : mixed
Tags
_jsonld()
outputs requested JSON-LD context
private
_jsonld(string $type) : mixed
Parameters
- $type : string
Tags
_read()
Read an existing paste or comment, only allowed via a JSON API call
private
_read(string $dataid) : mixed
Parameters
- $dataid : string
Tags
_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
_setCacheHeaders()
Turn off browser caching
private
_setCacheHeaders() : mixed
Tags
_view()
Display frontend.
private
_view() : mixed
Tags
_yourlsproxy()
proxies link to YOURLS, updates status or error with response
private
_yourlsproxy(string $link) : mixed
Parameters
- $link : string