class Response

Singleton class used to manage the rendering of pages in PMA

Properties

static protected array $httpStatusMessages

Methods

void
setAjax(bool $isAjax)

Set the ajax flag to indicate whether we are servicing an ajax request

static Response
getInstance()

Returns the singleton Response object

void
setRequestStatus(bool $state)

Set the status of an ajax response, whether it is a success or an error

bool
isAjax()

Returns true or false depending on whether we are servicing an ajax request

string
getCWD()

Returns the path to the current working directory Necessary to work around a PHP bug where the CWD is reset after the initial script exits

void
disable()

Disables the rendering of the header and the footer in responses

getHeader()

Returns a PhpMyAdmin\Header object

getFooter()

Returns a PhpMyAdmin\Footer object

void
addHTML(string $content)

Add HTML code to the response

void
addJSON(mixed $json, mixed $value = null)

Add JSON code to the response

void
response()

Sends an HTML response to the browser

void
header(string $text)

Wrapper around PHP's header() function.

bool
headersSent()

Wrapper around PHP's headers_sent() function.

void
httpResponseCode(int $response_code)

Wrapper around PHP's http_response_code() function.

void
setHttpResponseCode(int $responseCode)

Sets http response code.

void
generateHeader303(string $location)

Generate header for 303

bool
loginPage()

Configures response for the login page

Details

at line 197
void setAjax(bool $isAjax)

Set the ajax flag to indicate whether we are servicing an ajax request

Parameters

bool $isAjax Whether we are servicing an ajax request

Return Value

void

at line 209
static Response getInstance()

Returns the singleton Response object

Return Value

Response object

at line 225
void setRequestStatus(bool $state)

Set the status of an ajax response, whether it is a success or an error

Parameters

bool $state Whether the request was successfully processed

Return Value

void

at line 236
bool isAjax()

Returns true or false depending on whether we are servicing an ajax request

Return Value

bool

at line 248
string getCWD()

Returns the path to the current working directory Necessary to work around a PHP bug where the CWD is reset after the initial script exits

Return Value

string

at line 259
void disable()

Disables the rendering of the header and the footer in responses

Return Value

void

at line 271
Header getHeader()

Returns a PhpMyAdmin\Header object

Return Value

Header

at line 281
Footer getFooter()

Returns a PhpMyAdmin\Footer object

Return Value

Footer

at line 294
void addHTML(string $content)

Add HTML code to the response

Parameters

string $content A string to be appended to the current output buffer

Return Value

void

at line 317
void addJSON(mixed $json, mixed $value = null)

Add JSON code to the response

Parameters

mixed $json Either a key (string) or an array or key-value pairs
mixed $value Null, if passing an array in $json otherwise it's a string value to the key

Return Value

void

at line 504
void response()

Sends an HTML response to the browser

Return Value

void

at line 527
void header(string $text)

Wrapper around PHP's header() function.

Parameters

string $text header string

Return Value

void

at line 537
bool headersSent()

Wrapper around PHP's headers_sent() function.

Return Value

bool

at line 549
void httpResponseCode(int $response_code)

Wrapper around PHP's http_response_code() function.

Parameters

int $response_code will set the response code.

Return Value

void

at line 561
void setHttpResponseCode(int $responseCode)

Sets http response code.

Parameters

int $responseCode will set the response code.

Return Value

void

at line 582
void generateHeader303(string $location)

Generate header for 303

Parameters

string $location will set location to redirect.

Return Value

void

at line 596
bool loginPage()

Configures response for the login page

Return Value

bool Whether caller should exit