\DevConsole
Developers console implementation
Synopsis
class DevConsole
{
- // constants
- const URL_ME = '?module=sqlconsole';
- const URL_DEVCON = '?module=sqlconsole&devconsole=true';
- const URL_OP_MANAGE = '?module=sqlconsole&devconsole=true&manageonepunch=true';
- const OPTION_KEEP = 'DEVCON_SQL_KEEP';
- const OPTION_DEBUG = 'DEVCON_VERBOSE_DEBUG';
- const OPTION_CM = 'DEVCON_CM';
- const ROUTE_PHP_CON = 'devconsole';
- const ROUTE_OP_RUN = 'runscript';
- const ROUTE_OP_CREATE = 'scriptadd';
- const ROUTE_OP_DELETE = 'delscript';
- const ROUTE_OP_EDIT = 'editscript';
- const ROUTE_OP_IMPORT = 'importoldcodetemplates';
- const ROUTE_OP_MANAGE = 'manageonepunch';
- const PROUTE_SQL = 'sqlq';
- const PROUTE_PHP = 'phpq';
- const PROUTE_OPN_NAME = 'newscriptname';
- const PROUTE_OPN_ALIAS = 'newscriptalias';
- const PROUTE_OPN_CONTENT = 'newscriptcontent';
- const PROUTE_OPE_ID = 'editscriptid';
- const PROUTE_OPE_OLDALIAS = 'editscriptoldalias';
- const PROUTE_OPE_NAME = 'editscriptname';
- const PROUTE_OPE_ALIAS = 'editscriptalias';
- const PROUTE_OPE_CONTENT = 'editscriptcontent';
- const PROUTE_HLIGHT = 'phphightlight';
- const PROUTE_TABLE = 'tableresult';
- const PROUTE_TRUETABLE = 'truetableresult';
- const PROUTE_SQL_DISPLAY = 'sqldisplay';
- const SQL_DISPLAY_RAW = 'raw';
- const SQL_DISPLAY_TABLE = 'table';
- const SQL_DISPLAY_TRUETABLE = 'truetable';
- // members
- protected array $altCfg = ;
- protected $onePunch = '';
- protected bool $cmirrFlag = false;
- protected string $cmirrStyle = ' #editor-container { width: 100% !important; border: 1px solid #ccc; } .CodeMirror { width: 100% !important; font-size: 16px; } ';
- // methods
- public void __construct()
- protected void loadConfigs()
- protected void initOnePunch()
- protected string renderControls()
- public string renderSqlForm()
- public string renderPhpForm()
- public string renderPhpInterfaces()
- public string renderPhpScriptsQuickList()
- public void executeSqlQuery()
- public void showDebugData()
- public void showCodeHighlight()
Constants
| Name | Value |
|---|---|
| URL_ME | '?module=sqlconsole' |
| URL_DEVCON | '?module=sqlconsole&devconsole=true' |
| URL_OP_MANAGE | '?module=sqlconsole&devconsole=true&manageonepunch=true' |
| OPTION_KEEP | 'DEVCON_SQL_KEEP' |
| OPTION_DEBUG | 'DEVCON_VERBOSE_DEBUG' |
| OPTION_CM | 'DEVCON_CM' |
| ROUTE_PHP_CON | 'devconsole' |
| ROUTE_OP_RUN | 'runscript' |
| ROUTE_OP_CREATE | 'scriptadd' |
| ROUTE_OP_DELETE | 'delscript' |
| ROUTE_OP_EDIT | 'editscript' |
| ROUTE_OP_IMPORT | 'importoldcodetemplates' |
| ROUTE_OP_MANAGE | 'manageonepunch' |
| PROUTE_SQL | 'sqlq' |
| PROUTE_PHP | 'phpq' |
| PROUTE_OPN_NAME | 'newscriptname' |
| PROUTE_OPN_ALIAS | 'newscriptalias' |
| PROUTE_OPN_CONTENT | 'newscriptcontent' |
| PROUTE_OPE_ID | 'editscriptid' |
| PROUTE_OPE_OLDALIAS | 'editscriptoldalias' |
| PROUTE_OPE_NAME | 'editscriptname' |
| PROUTE_OPE_ALIAS | 'editscriptalias' |
| PROUTE_OPE_CONTENT | 'editscriptcontent' |
| PROUTE_HLIGHT | 'phphightlight' |
| PROUTE_TABLE | 'tableresult' |
| PROUTE_TRUETABLE | 'truetableresult' |
| PROUTE_SQL_DISPLAY | 'sqldisplay' |
| SQL_DISPLAY_RAW | 'raw' |
| SQL_DISPLAY_TABLE | 'table' |
| SQL_DISPLAY_TRUETABLE | 'truetable' |
Members
protected
-
$altCfg
Contains alter config a key=>value - $cmirrFlag
—
bool
CodeMirror editor enabled flag - $cmirrStyle
—
string
CodeMirror editor default style - $onePunch
—
Protected OnePunch scripts object instance
Methods
protected
- initOnePunch() — Initializes the OnePunch object
- loadConfigs() — Loads required configs data
- renderControls() — Renders the controls for the developers console
public
- __construct() — Plagued by doubt that it can be done In a culture so committed to temporal pleasure and distraction Should I flee into lifelong mountain retreat?
- executeSqlQuery() — Executes an SQL query and displays the result.
- renderPhpForm() — Renders the PHP form for the dev console.
- renderPhpInterfaces() — Renders the PHP interfaces grid for the dev console.
- renderPhpScriptsQuickList() — Renders quick one-punch scripts list for PHP console page
- renderSqlForm() — Renders the SQL console form
- showCodeHighlight() — Displays the highlighted PHP code in a window if the POST request matches the specified route.
- showDebugData() — Displays the debug data in the PHP console if enabled with option.