Property | Type | Description | |
---|---|---|---|
$action | integer | The action currently processed : defaults to 1 | |
$authentication | boolean | Whether authentication is required. | |
$baseUrl | string | Normally no need to be modified. But if App is run from outside a vhost that maps "/web" to "/" then it is required to inform the App about the new path/URL. | |
$client | Clickalicious\Memcached\Client | Master instance of Memcached client for cloning from. | |
$clients | array | The collection of clients instantiated and used by the current run. | |
$cluster | string | The name of the cluster. | |
$config | stdClass | The configuration. | |
$connections | array | The connections already established. | |
$credentials | array | Credentials valid for access. | |
$dateFormat | string | The format used when displaying date/time values. | |
$defaultTemplateVariables | array | The list of memcached hosts. | |
$error | string | The last error's message. | |
$errorMessages | array | Error Messages. | |
$hosts | array | The list of memcached hosts. | |
$info | string | An info message | |
$success | string | An success message | |
$title | string | The app title. |
Method | Description | |
---|---|---|
__construct ( stdClass $config, Clickalicious\Memcached\Client $client, string $baseUrl = self::DEFAULT_BASEURL, string $dateFormat = self::DEFAULT_DATEFORMAT, string $title = self::DEFAULT_TITLE ) : |
Constructor. | |
getAction ( ) : integer | Getter for action. | |
getActiveHost ( boolean $asArray = false ) : string | Returns currently active host. If no host is active, the first one found in list of servers is the active one. | |
getMenuHtml ( ) : string | ||
render ( string $route = self::DEFAULT_BASEURL, array $arguments = [] ) : string | Renders the result (HTML5 output) for passed $route and $arguments. |
Method | Description | |
---|---|---|
action ( integer $action ) | Setter for action. | |
actionToTemplates ( integer $action ) : array | Returns a collection in logical order of templates required for passed action. | |
aggregateStatistics ( array $hosts = [] ) : array | Fetch statistics for a single host or (aggregated) for a collection of hosts (cluster). | |
authenticate ( ) | Try to authenticate the user for active session. | |
baseUrl ( string $baseUrl ) | Setter for baseUrl. | |
castAsPhpType ( mixed $value ) : mixed | Returns the value casted to a native PHP type. | |
client ( Clickalicious\Memcached\Client $client ) | Setter for client. | |
clients ( array $clients ) | Setter for clients. | |
cluster ( string $cluster ) | Setter for cluster. | |
config ( stdClass $config ) | Setter for config. | |
convertUptime ( integer $timestamp ) : array | Returns uptime converted to years, month, days, hours . | |
credentials ( string $username, string $password ) | Setter for credentials. | |
dateFormat ( string $dateFormat ) | Setter for dateFormat. | |
dumpEntries ( string $host, integer $port, string | null $namespace = null, boolean $flat = false ) : array | Returns all entries for a passed slab (hostname & port) by passed namespace or all. | |
error ( string $error ) | Setter for error. | |
errorContext ( integer $errorNumber, array $context = [] ) : array | Returns an error context array which contains an error-number and variables related to the error. | |
formatNumberAsText ( mixed $value, string $lineEnding = '↵' ) : string | Formats a number to display it better readable. | |
getAppendButtonHtml ( string $key ) : string | Returns the HTML for the append button. | |
getBaseUrl ( ) : string | Getter for baseUrl. | |
getClient ( ) : Clickalicious\Memcached\Client | null | Getter for client. | |
getClients ( ) : Clickalicious\Memcached\Client[] | Getter for clients. | |
getCluster ( ) : string | Getter for cluster. | |
getConfig ( ) : stdClass | Getter for config. | |
getContent ( integer $action ) : string | Returns the inner content of the pages by action. | |
getCredentials ( ) : array | Getter for credentials. | |
getDateFormat ( ) : string | Getter for dateFormat. | |
getDecrementButtonHtml ( string $key ) : string | Returns the HTML for the decrement button. | |
getDefaultTemplateVariables ( ) : array | Returns the default template variables. | |
getDeleteButtonHtml ( string $key ) : string | Returns the delete button rendered by template render engine. | |
getEditButtonHtml ( string $key, string $value ) : string | Returns the edit button rendered by template render engine. | |
getError ( ) : string | Getter for error. | |
getErrorMessageByNumber ( integer $number ) : string | Returns the error for the passed number if set, otherwise the string 'n.a.'. | |
getErrorMessageHtml ( ) : string | Returns the HTML for the error message if error is set, otherwise empty string. | |
getHostFromRequest ( ) : null\string | Returns host from request if exist, otherwise NULL. | |
getHosts ( ) : array | Getter for hosts. | |
getHtmlInfoMessage ( ) : string | Returns the HTML for the info message if info is set, otherwise empty string. | |
getHtmlNavigationEntry ( integer $action, string $title, string $glyphicon = '' ) : string |
Creates |
|
getHtmlSuccessMessage ( ) : string | Returns the HTML for the success message if info is set, otherwise empty string. | |
getIncrementButtonHtml ( string $key ) : string | Returns the HTML for the increment button. | |
getInfo ( ) : string | Getter for info. | |
getLinkForAction ( integer $action = null, array $arguments = [] ) : string | Returns the link to the phpMemAdmin installation with optional action argument. | |
getMemcachedClient ( string $host, integer $port = Client::DEFAULT_PORT, integer $timeout = null ) : Clickalicious\Memcached\Client | Returns an instance of Client for host and port combination. | |
getMemcachedLatestVersion ( ) : string | Returns the latest version from memcached official website or 1.0.0 as fallback. | |
getMessages ( ) : string | Retrieves the messages to be shown in rendered page. | |
getPrependButtonHtml ( string $key ) : string | Returns the HTML for the prepend button. | |
getSettings ( string $host ) : array | Retrieve settings from Memcached instance. | |
getSuccess ( ) : string | Getter for success. | |
getTitle ( ) : string | Getter for title. | |
getUrl ( array $arguments = [], string $prefix = '', $anchor = '' ) : string | Return the URL for the current executed route. | |
hosts ( array $hosts ) | Setter for hosts. | |
info ( string $info ) | Setter for info. | |
loadTemplates ( string | array $templates ) : string | Loads a template from filesystem. | |
parseArguments ( array $arguments ) : void | Parser for arguments passed to this instance. | |
processRequestOperations ( integer $action, array $arguments ) : void | Processes the operations passed with the current request. | |
redirect ( string $url ) : void | Redirects to the passed URL. | |
renderString ( string $string, array $variables = [] ) : string | Renders the content of $string with variables from $variables. | |
renderTemplate ( string $html, array $variables = [] ) : string | Renders a template. | |
retrieveStoredData ( string $host, integer $port ) : array | Returns the stored data from a Memcached instance. | |
setAction ( integer $action ) : void | Setter for action. | |
setBaseUrl ( string $baseUrl ) : void | Setter for baseUrl. | |
setClient ( Clickalicious\Memcached\Client $client ) : void | Setter for client. | |
setClients ( array $clients ) : void | Setter for clients. | |
setCluster ( string $cluster ) : void | Setter for cluster. | |
setConfig ( stdClass $config ) : void | Setter for config. | |
setCredentials ( string $username, string $password ) : void | Setter for credentials. | |
setDateFormat ( string $dateFormat ) : void | Setter for dateFormat. | |
setError ( string $error ) : void | Setter for error. | |
setHosts ( array $hosts ) : void | Setter for hosts. | |
setInfo ( string $info ) : void | Setter for info. | |
setSuccess ( string $success ) : void | Setter for success. | |
setTitle ( string $title ) : void | Setter for title. | |
success ( string $success ) | Setter for success. | |
title ( string $title ) | Setter for title. | |
uuid ( ) : string | Simple generic hashing of dynamic input. |
public __construct ( stdClass $config, Clickalicious\Memcached\Client $client, string $baseUrl = self::DEFAULT_BASEURL, string $dateFormat = self::DEFAULT_DATEFORMAT, string $title = self::DEFAULT_TITLE ) : |
||
$config | stdClass | The configuration containing all preset values at least. |
$client | Clickalicious\Memcached\Client | The master client instance used for cloning instances. |
$baseUrl | string | The base URL of the application |
$dateFormat | string | The date format used for formatting dates |
$title | string | The title of the application |
return |
protected actionToTemplates ( integer $action ) : array | ||
$action | integer | The action to return templates for |
return | array | An collection of templates in logical order |
protected aggregateStatistics ( array $hosts = [] ) : array | ||
$hosts | array | An array containing a single host or a collection of hosts to fetch statistics for. |
return | array | The aggregated statistics |
protected authenticate ( ) |
protected castAsPhpType ( mixed $value ) : mixed | ||
$value | mixed | The value to cast magically. |
return | mixed | The resulting value |
protected client ( Clickalicious\Memcached\Client $client ) | ||
$client | Clickalicious\Memcached\Client | The client to set |
protected config ( stdClass $config ) | ||
$config | stdClass | The config to set |
protected convertUptime ( integer $timestamp ) : array | ||
$timestamp | integer | The timestamp to parse |
return | array | The result |
protected credentials ( string $username, string $password ) | ||
$username | string | The username used to authenticate |
$password | string | The password used to authenticate |
protected dateFormat ( string $dateFormat ) | ||
$dateFormat | string | The date-format string. |
protected dumpEntries ( string $host, integer $port, string | null $namespace = null, boolean $flat = false ) : array | ||
$host | string | The host (slab) to fetch items from |
$port | integer | The port |
$namespace | string | null | The namespace to filter on as string, otherwise NULL to fetch all |
$flat | boolean | TRUE to return plain key/value pairs, FALSE to return meta-data as well |
return | array | List of entries indexed by key |
public getActiveHost ( boolean $asArray = false ) : string | ||
$asArray | boolean | TRUE to return the host as prepared array, otherwise FALSE to return as string (default). |
return | string | The active host name or ip |
protected getAppendButtonHtml ( string $key ) : string | ||
$key | string | The key to render button for |
return | string | The HTML of the button |
protected getBaseUrl ( ) : string | ||
return | string | The base URL for this instance |
protected getClients ( ) : Clickalicious\Memcached\Client[] | ||
return | Clickalicious\Memcached\Client[] | The clients if set, otherwise empty array |
protected getCluster ( ) : string | ||
return | string | The name of the cluster |
protected getConfig ( ) : stdClass | ||
return | stdClass | config |
protected getContent ( integer $action ) : string | ||
$action | integer | The action to return content for |
return | string | HTML |
protected getCredentials ( ) : array | ||
return | array | The credentials |
protected getDateFormat ( ) : string | ||
return | string | The active date-time format |
protected getDecrementButtonHtml ( string $key ) : string | ||
$key | string | The key to render button for |
return | string | The HTML of the button |
protected getDefaultTemplateVariables ( ) : array | ||
return | array | The default template variables |
protected getDeleteButtonHtml ( string $key ) : string | ||
$key | string | The key for button |
return | string | The HTML of the button |
protected getErrorMessageByNumber ( integer $number ) : string | ||
$number | integer | The number to return error for |
return | string | The error message |
protected getErrorMessageHtml ( ) : string | ||
return | string | The HTML as string |
protected getHostFromRequest ( ) : null\string | ||
return | null\string |
protected getHtmlInfoMessage ( ) : string | ||
return | string | The HTML as string |
protected getHtmlSuccessMessage ( ) : string | ||
return | string | The HTML as string |
protected getIncrementButtonHtml ( string $key ) : string | ||
$key | string | The key to render button for |
return | string | The HTML of the button |
protected getMemcachedClient ( string $host, integer $port = Client::DEFAULT_PORT, integer $timeout = null ) : Clickalicious\Memcached\Client | ||
$host | string | The host to return instance for |
$port | integer | The port to return instance for |
$timeout | integer | The timeout used when connecting |
return | Clickalicious\Memcached\Client | A client instance |
protected getMemcachedLatestVersion ( ) : string | ||
return | string | The latest version of Memcached from website or 1.0.0 as fallback (timeout) |
protected getMessages ( ) : string | ||
return | string | The message HTML string |
protected getPrependButtonHtml ( string $key ) : string | ||
$key | string | The key to render button for |
return | string | The HTML of the button |
protected getSettings ( string $host ) : array | ||
$host | string | The host to retrieve statistics from. |
return | array | Containing the result |
protected getSuccess ( ) : string | ||
return | string | The success message |
protected parseArguments ( array $arguments ) : void | ||
$arguments | array | The arguments to parse |
return | void |
protected setBaseUrl ( string $baseUrl ) : void | ||
$baseUrl | string | The base URL to set. |
return | void |
protected setClients ( array $clients ) : void | ||
$clients | array | The client to set |
return | void |
protected setCluster ( string $cluster ) : void | ||
$cluster | string | The name of the cluster |
return | void |
protected setDateFormat ( string $dateFormat ) : void | ||
$dateFormat | string | The date-format string. |
return | void |
protected setSuccess ( string $success ) : void | ||
$success | string | The success message to set |
return | void |
protected int $action | ||
return | integer |
protected bool $authentication | ||
return | boolean |
protected string $baseUrl | ||
return | string |
protected Client,Clickalicious\Memcached $client | ||
return | Clickalicious\Memcached\Client |
protected array $clients | ||
return | array |
protected static array $connections | ||
return | array |
protected array $credentials | ||
return | array |
protected string $dateFormat | ||
return | string |
protected array $defaultTemplateVariables | ||
return | array |