Bearsampp 2025.8.29
Loading...
Searching...
No Matches
TplConsoleZ Class Reference

Static Public Member Functions

static process ()

Data Fields

const ICON_APP = 'app.ico'
const ICON_COMPOSER = 'composer.ico'
const ICON_DB = 'db.ico'
const ICON_GHOSTSCRIPT = 'ghostscript.ico'
const ICON_GIT = 'git.ico'
const ICON_NGROK = 'ngrok.ico'
const ICON_NODEJS = 'nodejs.ico'
const ICON_PEAR = 'pear.ico'
const ICON_PERL = 'perl.ico'
const ICON_POWERSHELL = 'powershell.ico'
const ICON_PYTHON = 'python.ico'
const ICON_RUBY = 'ruby.ico'

Private Member Functions

 __construct ()

Static Private Member Functions

static getAppearanceSection ()
static getBehaviorSection ()
static getConsoleSection ()
static getHotkeysSection ()
static getIncrStr ($size=1)
static getMouseSection ()
static getTab ($title, $icon, $shell, $initDir)
static getTabCmdSection ()
static getTabComposerSection ()
static getTabGhostscriptSection ()
static getTabGitSection ()
static getTabMariadbSection ()
static getTabMysqlSection ()
static getTabNgrokSection ()
static getTabNodejsSection ()
static getTabPearSection ()
static getTabPerlSection ()
static getTabPostgresqlSection ()
static getTabPowerShellSection ()
static getTabPythonSection ()
static getTabRubySection ()
static getTabsSection ()

Detailed Description

Class TplConsoleZ

This class is responsible for generating the configuration file for ConsoleZ. It includes methods to define various sections of the configuration such as console settings, appearance, behavior, hotkeys, mouse actions, and tabs.

Definition at line 17 of file class.tpl.consolez.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( )
private

Private constructor to prevent instantiation.

Definition at line 35 of file class.tpl.consolez.php.

36 {
37 }

Member Function Documentation

◆ getAppearanceSection()

getAppearanceSection ( )
staticprivate

Generates the XML section for appearance settings.

This method constructs the XML string for the appearance settings of the ConsoleZ configuration. It includes settings for font, window properties, controls, styles, position, and transparency.

Returns
string The XML string representing the appearance settings.

Definition at line 117 of file class.tpl.consolez.php.

118 {
119 $sectionFont = self::getIncrStr(2) . '<font name="Courier New" size="10" bold="0" italic="0" smoothing="0">' . PHP_EOL .
120 self::getIncrStr(3) . '<color use="0" r="0" g="255" b="0"/>' . PHP_EOL .
121 self::getIncrStr(2) . '</font>';
122
123 $windowSection = self::getIncrStr(2) . '<window ' .
124 'title="ConsoleZ" ' .
125 'icon="" ' .
126 'use_tab_icon="1" ' .
127 'use_console_title="0" ' .
128 'show_cmd="0" ' .
129 'show_cmd_tabs="0" ' .
130 'use_tab_title="1" ' .
131 'trim_tab_titles="20" ' .
132 'trim_tab_titles_right="0"/>';
133
134 $controlsSection = self::getIncrStr(2) . '<controls ' .
135 'show_menu="0" ' .
136 'show_toolbar="1" ' .
137 'show_statusbar="1" ' .
138 'show_tabs="1" ' .
139 'hide_single_tab="1" ' .
140 'show_scrollbars="1" ' .
141 'flat_scrollbars="0" ' .
142 'tabs_on_bottom="0"/>';
143
144 $stylesSection = self::getIncrStr(2) . '<styles caption="1" resizable="1" taskbar_button="1" border="1" inside_border="2" tray_icon="0">' . PHP_EOL .
145 self::getIncrStr(3) . '<selection_color r="255" g="255" b="255"/>' . PHP_EOL .
146 self::getIncrStr(2) . '</styles>';
147
148 $positionSection = self::getIncrStr(2) . '<divosition ' .
149 'x="-1" ' .
150 'y="-1" ' .
151 'dock="-1" ' .
152 'snap="0" ' .
153 'z_order="0" ' .
154 'save_position="0"/>';
155
156 $transparencySection = self::getIncrStr(2) . '<transparency ' .
157 'type="1" ' .
158 'active_alpha="240" ' .
159 'inactive_alpha="225" ' .
160 'r="0" ' .
161 'g="0" ' .
162 'b="0"/>';
163
164 return self::getIncrStr(1) . '<appearance>' . PHP_EOL .
165 $sectionFont . PHP_EOL .
166 $windowSection . PHP_EOL .
167 $controlsSection . PHP_EOL .
168 $stylesSection . PHP_EOL .
169 $positionSection . PHP_EOL .
170 $transparencySection . PHP_EOL .
171 self::getIncrStr(1) . '</appearance>';
172 }
static getIncrStr($size=1)

References getIncrStr().

Referenced by process().

◆ getBehaviorSection()

getBehaviorSection ( )
staticprivate

Generates the XML section for behavior settings.

This method constructs the XML string for the behavior settings of the ConsoleZ configuration. It includes settings for copy-paste behavior, scroll behavior, and tab highlight behavior.

Returns
string The XML string representing the behavior settings.

Definition at line 182 of file class.tpl.consolez.php.

183 {
184 $sectionCopyPaste = self::getIncrStr(2) . '<copy_paste ' .
185 'copy_on_select="0" ' .
186 'clear_on_copy="1" ' .
187 'no_wrap="1" ' .
188 'trim_spaces="1" ' .
189 'copy_newline_char="0" ' .
190 'sensitive_copy="1"/>';
191
192 $sectionScroll = self::getIncrStr(2) . '<scroll page_scroll_rows="0"/>';
193
194 $sectionTabHighlight = self::getIncrStr(2) . '<tab_highlight flashes="3" stay_highligted="1"/>';
195
196 return self::getIncrStr(1) . '<behavior>' . PHP_EOL .
197 $sectionCopyPaste . PHP_EOL .
198 $sectionScroll . PHP_EOL .
199 $sectionTabHighlight . PHP_EOL .
200 self::getIncrStr(1) . '</behavior>';
201 }

References getIncrStr().

Referenced by process().

◆ getConsoleSection()

getConsoleSection ( )
staticprivate

Generates the XML section for console settings.

This method constructs the XML string for the console settings of the ConsoleZ configuration. It includes settings for refresh rates, buffer sizes, and initial directory.

Returns
string The XML string representing the console settings.

Definition at line 69 of file class.tpl.consolez.php.

70 {
71 global $bearsamppRoot, $bearsamppTools;
72
73 $sectionConsoleStart = self::getIncrStr(1) . '<console ' .
74 'change_refresh="10" ' .
75 'refresh="100" ' .
76 'rows="' . $bearsamppTools->getConsoleZ()->getRows() . '" ' .
77 'columns="' . $bearsamppTools->getConsoleZ()->getCols() . '" ' .
78 'buffer_rows="2048" ' .
79 'buffer_columns="0" ' .
80 'shell="" ' .
81 'init_dir="' . $bearsamppRoot->getRootPath() . '" ' .
82 'start_hidden="0" ' .
83 'save_size="0">' . PHP_EOL;
84
85 $sectionColors = self::getIncrStr(2) . '<colors>' . PHP_EOL .
86 self::getIncrStr(3) . '<color id="0" r="39" g="40" b="34"/>' . PHP_EOL .
87 self::getIncrStr(3) . '<color id="1" r="88" g="194" b="229"/>' . PHP_EOL .
88 self::getIncrStr(3) . '<color id="2" r="88" g="194" b="229"/>' . PHP_EOL .
89 self::getIncrStr(3) . '<color id="3" r="198" g="197" b="254"/>' . PHP_EOL .
90 self::getIncrStr(3) . '<color id="4" r="168" g="125" b="184"/>' . PHP_EOL .
91 self::getIncrStr(3) . '<color id="5" r="243" g="4" b="75"/>' . PHP_EOL .
92 self::getIncrStr(3) . '<color id="6" r="243" g="4" b="75"/>' . PHP_EOL .
93 self::getIncrStr(3) . '<color id="7" r="238" g="238" b="238"/>' . PHP_EOL .
94 self::getIncrStr(3) . '<color id="8" r="124" g="124" b="124"/>' . PHP_EOL .
95 self::getIncrStr(3) . '<color id="9" r="3" g="131" b="245"/>' . PHP_EOL .
96 self::getIncrStr(3) . '<color id="10" r="141" g="208" b="6"/>' . PHP_EOL .
97 self::getIncrStr(3) . '<color id="11" r="88" g="194" b="229"/>' . PHP_EOL .
98 self::getIncrStr(3) . '<color id="12" r="168" g="125" b="184"/>' . PHP_EOL .
99 self::getIncrStr(3) . '<color id="13" r="243" g="4" b="75"/>' . PHP_EOL .
100 self::getIncrStr(3) . '<color id="14" r="204" g="204" b="129"/>' . PHP_EOL .
101 self::getIncrStr(3) . '<color id="15" r="255" g="255" b="255"/>' . PHP_EOL .
102 self::getIncrStr(2) . '</colors>' . PHP_EOL;
103
104 $sectionConsoleEnd = self::getIncrStr(1) . '</console>';
105
106 return $sectionConsoleStart . $sectionColors . $sectionConsoleEnd;
107 }
global $bearsamppRoot

References $bearsamppRoot, and getIncrStr().

Referenced by process().

◆ getHotkeysSection()

getHotkeysSection ( )
staticprivate

Generates the XML section for hotkeys settings.

This method constructs the XML string for the hotkeys settings of the ConsoleZ configuration. It includes settings for various hotkey combinations and their corresponding commands.

Returns
string The XML string representing the hotkeys settings.

Definition at line 211 of file class.tpl.consolez.php.

212 {
213 return self::getIncrStr(1) . '<hotkeys use_scroll_lock="0">' . PHP_EOL .
214 self::getIncrStr(2) . '<hotkey ctrl="1" shift="0" alt="0" extended="0" code="83" command="settings"/>' . PHP_EOL .
215 self::getIncrStr(2) . '<hotkey ctrl="0" shift="0" alt="0" extended="0" code="112" command="help"/>' . PHP_EOL .
216 self::getIncrStr(2) . '<hotkey ctrl="0" shift="0" alt="1" extended="0" code="115" command="exit"/>' . PHP_EOL .
217 self::getIncrStr(2) . '<hotkey ctrl="1" shift="0" alt="0" extended="0" code="112" command="newtab1"/>' . PHP_EOL .
218 self::getIncrStr(2) . '<hotkey ctrl="1" shift="0" alt="0" extended="0" code="113" command="newtab2"/>' . PHP_EOL .
219 self::getIncrStr(2) . '<hotkey ctrl="1" shift="0" alt="0" extended="0" code="114" command="newtab3"/>' . PHP_EOL .
220 self::getIncrStr(2) . '<hotkey ctrl="1" shift="0" alt="0" extended="0" code="115" command="newtab4"/>' . PHP_EOL .
221 self::getIncrStr(2) . '<hotkey ctrl="1" shift="0" alt="0" extended="0" code="116" command="newtab5"/>' . PHP_EOL .
222 self::getIncrStr(2) . '<hotkey ctrl="1" shift="0" alt="0" extended="0" code="117" command="newtab6"/>' . PHP_EOL .
223 self::getIncrStr(2) . '<hotkey ctrl="1" shift="0" alt="0" extended="0" code="118" command="newtab7"/>' . PHP_EOL .
224 self::getIncrStr(2) . '<hotkey ctrl="1" shift="0" alt="0" extended="0" code="119" command="newtab8"/>' . PHP_EOL .
225 self::getIncrStr(2) . '<hotkey ctrl="1" shift="0" alt="0" extended="0" code="120" command="newtab9"/>' . PHP_EOL .
226 self::getIncrStr(2) . '<hotkey ctrl="1" shift="0" alt="0" extended="0" code="121" command="newtab10"/>' . PHP_EOL .
227 self::getIncrStr(2) . '<hotkey ctrl="1" shift="0" alt="0" extended="0" code="49" command="switchtab1"/>' . PHP_EOL .
228 self::getIncrStr(2) . '<hotkey ctrl="1" shift="0" alt="0" extended="0" code="50" command="switchtab2"/>' . PHP_EOL .
229 self::getIncrStr(2) . '<hotkey ctrl="1" shift="0" alt="0" extended="0" code="51" command="switchtab3"/>' . PHP_EOL .
230 self::getIncrStr(2) . '<hotkey ctrl="1" shift="0" alt="0" extended="0" code="52" command="switchtab4"/>' . PHP_EOL .
231 self::getIncrStr(2) . '<hotkey ctrl="1" shift="0" alt="0" extended="0" code="53" command="switchtab5"/>' . PHP_EOL .
232 self::getIncrStr(2) . '<hotkey ctrl="1" shift="0" alt="0" extended="0" code="54" command="switchtab6"/>' . PHP_EOL .
233 self::getIncrStr(2) . '<hotkey ctrl="1" shift="0" alt="0" extended="0" code="55" command="switchtab7"/>' . PHP_EOL .
234 self::getIncrStr(2) . '<hotkey ctrl="1" shift="0" alt="0" extended="0" code="56" command="switchtab8"/>' . PHP_EOL .
235 self::getIncrStr(2) . '<hotkey ctrl="1" shift="0" alt="0" extended="0" code="57" command="switchtab9"/>' . PHP_EOL .
236 self::getIncrStr(2) . '<hotkey ctrl="1" shift="0" alt="0" extended="0" code="48" command="switchtab10"/>' . PHP_EOL .
237 self::getIncrStr(2) . '<hotkey ctrl="1" shift="0" alt="0" extended="0" code="9" command="nexttab"/>' . PHP_EOL .
238 self::getIncrStr(2) . '<hotkey ctrl="1" shift="1" alt="0" extended="0" code="9" command="prevtab"/>' . PHP_EOL .
239 self::getIncrStr(2) . '<hotkey ctrl="1" shift="0" alt="0" extended="0" code="87" command="closetab"/>' . PHP_EOL .
240 self::getIncrStr(2) . '<hotkey ctrl="1" shift="0" alt="0" extended="0" code="82" command="renametab"/>' . PHP_EOL .
241 self::getIncrStr(2) . '<hotkey ctrl="1" shift="0" alt="0" extended="1" code="45" command="copy"/>' . PHP_EOL .
242 self::getIncrStr(2) . '<hotkey ctrl="1" shift="0" alt="0" extended="1" code="46" command="clear_selection"/>' . PHP_EOL .
243 self::getIncrStr(2) . '<hotkey ctrl="0" shift="1" alt="0" extended="1" code="45" command="paste"/>' . PHP_EOL .
244 self::getIncrStr(2) . '<hotkey ctrl="0" shift="0" alt="0" extended="0" code="0" command="stopscroll"/>' . PHP_EOL .
245 self::getIncrStr(2) . '<hotkey ctrl="0" shift="0" alt="0" extended="0" code="0" command="scrollrowup"/>' . PHP_EOL .
246 self::getIncrStr(2) . '<hotkey ctrl="0" shift="0" alt="0" extended="0" code="0" command="scrollrowdown"/>' . PHP_EOL .
247 self::getIncrStr(2) . '<hotkey ctrl="0" shift="0" alt="0" extended="0" code="0" command="scrollpageup"/>' . PHP_EOL .
248 self::getIncrStr(2) . '<hotkey ctrl="0" shift="0" alt="0" extended="0" code="0" command="scrollpagedown"/>' . PHP_EOL .
249 self::getIncrStr(2) . '<hotkey ctrl="0" shift="0" alt="0" extended="0" code="0" command="scrollcolleft"/>' . PHP_EOL .
250 self::getIncrStr(2) . '<hotkey ctrl="0" shift="0" alt="0" extended="0" code="0" command="scrollcolright"/>' . PHP_EOL .
251 self::getIncrStr(2) . '<hotkey ctrl="0" shift="0" alt="0" extended="0" code="0" command="scrollpageleft"/>' . PHP_EOL .
252 self::getIncrStr(2) . '<hotkey ctrl="0" shift="0" alt="0" extended="0" code="0" command="scrollpageright"/>' . PHP_EOL .
253 self::getIncrStr(2) . '<hotkey ctrl="1" shift="1" alt="0" extended="0" code="112" command="dumpbuffer"/>' . PHP_EOL .
254 self::getIncrStr(2) . '<hotkey ctrl="0" shift="0" alt="0" extended="0" code="0" command="activate"/>' . PHP_EOL .
255 self::getIncrStr(1) . '</hotkeys>';
256 }

References getIncrStr().

Referenced by process().

◆ getIncrStr()

getIncrStr ( $size = 1)
staticprivate

Generates a string of incremented tabs.

This function constructs a string consisting of a specified number of tab characters.

Parameters
int$sizeThe number of tabs to include in the string.
Returns
string The string of incremented tabs.

Definition at line 744 of file class.tpl.consolez.php.

745 {
746 $result = '';
747 for ($i = 0; $i <= $size; $i++) {
749 }
750 return $result;
751 }
$result
const RETURN_TAB
Definition root.php:20

References $result, and RETURN_TAB.

Referenced by getAppearanceSection(), getBehaviorSection(), getConsoleSection(), getHotkeysSection(), getMouseSection(), getTab(), and getTabsSection().

◆ getMouseSection()

getMouseSection ( )
staticprivate

Generates the XML structure for the mouse section.

This function creates an XML structure defining mouse actions and their corresponding key combinations. It uses the getIncrStr method to format the XML with appropriate indentation.

Returns
string The formatted XML string for the mouse section.

Definition at line 267 of file class.tpl.consolez.php.

268 {
269 return self::getIncrStr(1) . '<mouse>' . PHP_EOL .
270 self::getIncrStr(2) . '<actions>' . PHP_EOL .
271 self::getIncrStr(3) . '<action ctrl="0" shift="0" alt="0" button="1" name="copy"/>' . PHP_EOL .
272 self::getIncrStr(3) . '<action ctrl="0" shift="1" alt="0" button="1" name="select"/>' . PHP_EOL .
273 self::getIncrStr(3) . '<action ctrl="0" shift="0" alt="0" button="3" name="paste"/>' . PHP_EOL .
274 self::getIncrStr(3) . '<action ctrl="1" shift="0" alt="0" button="1" name="drag"/>' . PHP_EOL .
275 self::getIncrStr(3) . '<action ctrl="0" shift="0" alt="0" button="2" name="menu"/>' . PHP_EOL .
276 self::getIncrStr(2) . '</actions>' . PHP_EOL .
277 self::getIncrStr(1) . '</mouse>';
278 }

References getIncrStr().

Referenced by process().

◆ getTab()

getTab ( $title,
$icon,
$shell,
$initDir )
staticprivate

Generates the HTML structure for a tab in the console.

This function constructs the HTML structure for a tab, including the title, icon, shell command, initial directory, cursor style, and background settings.

Parameters
string$titleThe title of the tab.
string$iconThe icon for the tab.
string$shellThe shell command to be executed in the tab.
string$initDirThe initial directory for the tab.
Returns
string The HTML structure for the tab. @global Core $bearsamppCore The core object of the application.

Definition at line 722 of file class.tpl.consolez.php.

723 {
724 global $bearsamppCore;
725 return self::getIncrStr(2) . '<tab title="' . $title . '" icon="' . $bearsamppCore->getIconsPath(false) . '/' . $icon . '" use_default_icon="0">' . PHP_EOL .
726 self::getIncrStr(3) . '<console shell="' . $shell . '" init_dir="' . $initDir . '" run_as_user="0" user=""/>' . PHP_EOL .
727 self::getIncrStr(3) . '<cursor style="0" r="255" g="255" b="255"/>' . PHP_EOL .
728 self::getIncrStr(3) . '<background type="0" r="0" g="0" b="0">' . PHP_EOL .
729 self::getIncrStr(4) . '<image file="" relative="0" extend="0" position="0">' . PHP_EOL .
730 self::getIncrStr(5) . '<tint opacity="0" r="0" g="0" b="0"/>' . PHP_EOL .
731 self::getIncrStr(4) . '</image>' . PHP_EOL .
732 self::getIncrStr(3) . '</background>' . PHP_EOL .
733 self::getIncrStr(2) . '</tab>';
734 }
global $bearsamppCore

References $bearsamppCore, and getIncrStr().

Referenced by getTabCmdSection(), getTabComposerSection(), getTabGhostscriptSection(), getTabGitSection(), getTabMariadbSection(), getTabMysqlSection(), getTabNgrokSection(), getTabNodejsSection(), getTabPearSection(), getTabPerlSection(), getTabPostgresqlSection(), getTabPowerShellSection(), getTabPythonSection(), and getTabRubySection().

◆ getTabCmdSection()

getTabCmdSection ( )
staticprivate

Generates the XML structure for the command tab section.

This function creates an XML structure defining the command tab and its configuration. It retrieves the tab title and shell command from the ConsoleZ tool and sets the root path.

Returns
string The formatted XML string for the command tab section. @global Tools $bearsamppTools The tools object of the application.

@global Root $bearsamppRoot The root object of the application.

Definition at line 320 of file class.tpl.consolez.php.

321 {
322 global $bearsamppRoot, $bearsamppTools;
323
324 return self::getTab(
325 $bearsamppTools->getConsoleZ()->getTabTitleDefault(),
326 self::ICON_APP,
327 $bearsamppTools->getConsoleZ()->getShell(),
328 $bearsamppRoot->getRootPath()
329 ) . PHP_EOL;
330 }
static getTab($title, $icon, $shell, $initDir)

References $bearsamppRoot, and getTab().

Referenced by getTabsSection().

◆ getTabComposerSection()

getTabComposerSection ( )
staticprivate

Generates the XML structure for the Composer tab section.

This function creates an XML structure defining the Composer tab and its configuration. It retrieves the Composer executable path and sets the WWW path.

Returns
string The formatted XML string for the Composer tab section. @global Tools $bearsamppTools The tools object of the application.

@global Root $bearsamppRoot The root object of the application.

Definition at line 548 of file class.tpl.consolez.php.

549 {
550 global $bearsamppRoot, $bearsamppTools;
551
552 $shell = $bearsamppTools->getConsoleZ()->getShell('&quot;' . $bearsamppTools->getComposer()->getExe() . '&quot; -V');
553 if (!file_exists($bearsamppTools->getComposer()->getExe())) {
554 $shell = $bearsamppTools->getConsoleZ()->getShell('echo ' . $bearsamppTools->getComposer()->getExe() . ' not found');
555 }
556
557 return self::getTab(
558 $bearsamppTools->getConsoleZ()->getTabTitleComposer(),
559 self::ICON_COMPOSER,
560 $shell,
561 $bearsamppRoot->getWwwPath()
562 ) . PHP_EOL;
563 }

References $bearsamppRoot, and getTab().

Referenced by getTabsSection().

◆ getTabGhostscriptSection()

getTabGhostscriptSection ( )
staticprivate

Generates the tab section for Ghostscript in the console.

This function constructs a shell command to check the version of Ghostscript and verifies if the executable exists. If the executable is not found, it returns a message indicating the absence of the executable. It then creates a tab section with the appropriate title, icon, shell command, and initial directory.

Returns
string The HTML structure for the Ghostscript tab section. @global Tools $bearsamppTools The tools object of the application. @global Root $bearsamppRoot The root object of the application.

Definition at line 662 of file class.tpl.consolez.php.

663 {
664 global $bearsamppRoot, $bearsamppTools;
665
666 $shell = $bearsamppTools->getConsoleZ()->getShell('&quot;' . $bearsamppTools->getGhostscript()->getExeConsole() . '&quot; -v');
667 if (!file_exists($bearsamppTools->getGhostscript()->getExeConsole())) {
668 $shell = $bearsamppTools->getConsoleZ()->getShell('echo ' . $bearsamppTools->getGhostscript()->getExeConsole() . ' not found');
669 }
670
671 return self::getTab(
672 $bearsamppTools->getConsoleZ()->getTabTitleGhostscript(),
673 self::ICON_GHOSTSCRIPT,
674 $shell,
675 $bearsamppRoot->getWwwPath()
676 ) . PHP_EOL;
677 }

References $bearsamppRoot, and getTab().

Referenced by getTabsSection().

◆ getTabGitSection()

getTabGitSection ( )
staticprivate

Generates the XML structure for the Git tab section.

This function creates an XML structure defining the Git tab and its configuration. It retrieves the Git executable path and sets the WWW path.

Returns
string The formatted XML string for the Git tab section. @global Tools $bearsamppTools The tools object of the application.

@global Root $bearsamppRoot The root object of the application.

Definition at line 491 of file class.tpl.consolez.php.

492 {
493 global $bearsamppRoot, $bearsamppTools;
494
495 $shell = $bearsamppTools->getConsoleZ()->getShell('&quot;' . $bearsamppTools->getGit()->getExe() . '&quot; --version');
496 if (!file_exists($bearsamppTools->getGit()->getExe())) {
497 $shell = $bearsamppTools->getConsoleZ()->getShell('echo ' . $bearsamppTools->getGit()->getExe() . ' not found');
498 }
499
500 return self::getTab(
501 $bearsamppTools->getConsoleZ()->getTabTitleGit(),
502 self::ICON_GIT,
503 $shell,
504 $bearsamppRoot->getWwwPath()
505 ) . PHP_EOL;
506 }

References $bearsamppRoot, and getTab().

Referenced by getTabsSection().

◆ getTabMariadbSection()

getTabMariadbSection ( )
staticprivate

Generates the XML structure for the MariaDB tab section.

This function creates an XML structure defining the MariaDB tab and its configuration. It retrieves the MariaDB CLI executable path and sets the symlink path.

Returns
string The formatted XML string for the MariaDB tab section. @global Tools $bearsamppTools The tools object of the application.

@global Bins $bearsamppBins The bins object of the application.

Definition at line 429 of file class.tpl.consolez.php.

430 {
431 global $bearsamppBins, $bearsamppTools;
432
433 $shell = $bearsamppTools->getConsoleZ()->getShell('&quot;' . $bearsamppBins->getMariadb()->getCliExe() . '&quot; -u' .
434 $bearsamppBins->getMariadb()->getRootUser() .
435 ($bearsamppBins->getMariadb()->getRootPwd() ? ' -p' : ''));
436 if (!file_exists($bearsamppBins->getMariadb()->getCliExe())) {
437 $shell = $bearsamppTools->getConsoleZ()->getShell('echo ' . $bearsamppBins->getMariadb()->getCliExe() . ' not found');
438 }
439
440 return self::getTab(
441 $bearsamppTools->getConsoleZ()->getTabTitleMariadb(),
442 self::ICON_DB,
443 $shell,
444 $bearsamppBins->getMariadb()->getSymlinkPath()
445 ) . PHP_EOL;
446 }
global $bearsamppBins

References $bearsamppBins, and getTab().

Referenced by getTabsSection().

◆ getTabMysqlSection()

getTabMysqlSection ( )
staticprivate

Generates the XML structure for the MySQL tab section.

This function creates an XML structure defining the MySQL tab and its configuration. It retrieves the MySQL CLI executable path and sets the symlink path.

Returns
string The formatted XML string for the MySQL tab section. @global Tools $bearsamppTools The tools object of the application.

@global Bins $bearsamppBins The bins object of the application.

Definition at line 399 of file class.tpl.consolez.php.

400 {
401 global $bearsamppBins, $bearsamppTools;
402
403 $shell = $bearsamppTools->getConsoleZ()->getShell('&quot;' . $bearsamppBins->getMysql()->getCliExe() . '&quot; -u' .
404 $bearsamppBins->getMysql()->getRootUser() .
405 ($bearsamppBins->getMysql()->getRootPwd() ? ' -p' : ''));
406 if (!file_exists($bearsamppBins->getMysql()->getCliExe())) {
407 $shell = $bearsamppTools->getConsoleZ()->getShell('echo ' . $bearsamppBins->getMysql()->getCliExe() . ' not found');
408 }
409
410 return self::getTab(
411 $bearsamppTools->getConsoleZ()->getTabTitleMysql(),
412 self::ICON_DB,
413 $shell,
414 $bearsamppBins->getMysql()->getSymlinkPath()
415 ) . PHP_EOL;
416 }

References $bearsamppBins, and getTab().

Referenced by getTabsSection().

◆ getTabNgrokSection()

getTabNgrokSection ( )
staticprivate

Generates the tab section for Ngrok in the console.

This function constructs a shell command to check the version of Ngrok and verifies if the executable exists. If the executable is not found, it returns a message indicating the absence of the executable. It then creates a tab section with the appropriate title, icon, shell command, and initial directory.

Returns
string The HTML structure for the Ngrok tab section. @global Tools $bearsamppTools The tools object of the application. @global Root $bearsamppRoot The root object of the application.

Definition at line 692 of file class.tpl.consolez.php.

693 {
694 global $bearsamppRoot, $bearsamppTools;
695
696 $shell = $bearsamppTools->getConsoleZ()->getShell('&quot;' . $bearsamppTools->getNgrok()->getExe() . '&quot; version');
697 if (!file_exists($bearsamppTools->getNgrok()->getExe())) {
698 $shell = $bearsamppTools->getConsoleZ()->getShell('echo ' . $bearsamppTools->getNgrok()->getExe() . ' not found');
699 }
700
701 return self::getTab(
702 $bearsamppTools->getConsoleZ()->getTabTitleNgrok(),
703 self::ICON_NGROK,
704 $shell,
705 $bearsamppRoot->getWwwPath()
706 ) . PHP_EOL;
707 }

References $bearsamppRoot, and getTab().

Referenced by getTabsSection().

◆ getTabNodejsSection()

getTabNodejsSection ( )
staticprivate

Generates the XML structure for the Node.js tab section.

This function creates an XML structure defining the Node.js tab and its configuration. It retrieves the Node.js launch path and sets the WWW path.

Returns
string The formatted XML string for the Node.js tab section. @global Bins $bearsamppBins The bins object of the application. @global Tools $bearsamppTools The tools object of the application.

@global Root $bearsamppRoot The root object of the application.

Definition at line 520 of file class.tpl.consolez.php.

521 {
522 global $bearsamppRoot, $bearsamppBins, $bearsamppTools;
523
524 $shell = $bearsamppTools->getConsoleZ()->getShell('&quot;' . $bearsamppBins->getNodejs()->getLaunch() . '&quot;');
525 if (!file_exists($bearsamppBins->getNodejs()->getLaunch())) {
526 $shell = $bearsamppTools->getConsoleZ()->getShell('echo ' . $bearsamppBins->getNodejs()->getLaunch() . ' not found');
527 }
528
529 return self::getTab(
530 $bearsamppTools->getConsoleZ()->getTabTitleNodejs(),
531 self::ICON_NODEJS,
532 $shell,
533 $bearsamppRoot->getWwwPath()
534 ) . PHP_EOL;
535 }

References $bearsamppBins, $bearsamppRoot, and getTab().

Referenced by getTabsSection().

◆ getTabPearSection()

getTabPearSection ( )
staticprivate

Generates the XML structure for the PEAR tab section.

This function creates an XML structure defining the PEAR tab and its configuration. It retrieves the PEAR executable path and sets the symlink path.

Returns
string The formatted XML string for the PEAR tab section. @global Tools $bearsamppTools The tools object of the application.

@global Bins $bearsamppBins The bins object of the application.

Definition at line 371 of file class.tpl.consolez.php.

372 {
373 global $bearsamppBins, $bearsamppTools;
374
375 $shell = $bearsamppTools->getConsoleZ()->getShell('&quot;' . $bearsamppBins->getPhp()->getPearExe() . '&quot; -V');
376 if (!file_exists($bearsamppBins->getPhp()->getPearExe())) {
377 $shell = $bearsamppTools->getConsoleZ()->getShell('echo ' . $bearsamppBins->getPhp()->getPearExe() . ' not found');
378 }
379
380 return self::getTab(
381 $bearsamppTools->getConsoleZ()->getTabTitlePear(),
382 self::ICON_PEAR,
383 $shell,
384 $bearsamppBins->getPhp()->getSymlinkPath() . '/pear'
385 ) . PHP_EOL;
386 }

References $bearsamppBins, and getTab().

Referenced by getTabsSection().

◆ getTabPerlSection()

getTabPerlSection ( )
staticprivate

Generates the XML structure for the Perl tab section.

This function creates an XML structure defining the Perl tab and its configuration. It retrieves the Perl executable path and sets the WWW path.

Returns
string The formatted XML string for the Perl tab section. @global Tools $bearsamppTools The tools object of the application.

@global Root $bearsamppRoot The root object of the application.

Definition at line 632 of file class.tpl.consolez.php.

633 {
634 global $bearsamppRoot, $bearsamppTools;
635
636 $shell = $bearsamppTools->getConsoleZ()->getShell('&quot;' . $bearsamppTools->getPerl()->getExe() . '&quot; -v');
637 if (!file_exists($bearsamppTools->getPerl()->getExe())) {
638 $shell = $bearsamppTools->getConsoleZ()->getShell('echo ' . $bearsamppTools->getPerl()->getExe() . ' not found');
639 }
640
641 return self::getTab(
642 $bearsamppTools->getConsoleZ()->getTabTitlePerl(),
643 self::ICON_PERL,
644 $shell,
645 $bearsamppRoot->getWwwPath()
646 ) . PHP_EOL;
647 }

References $bearsamppRoot, and getTab().

Referenced by getTabsSection().

◆ getTabPostgresqlSection()

getTabPostgresqlSection ( )
staticprivate

Generates the XML structure for the PostgreSQL tab section.

This function creates an XML structure defining the PostgreSQL tab and its configuration. It retrieves the PostgreSQL CLI executable path and sets the symlink path.

Returns
string The formatted XML string for the PostgreSQL tab section. @global Tools $bearsamppTools The tools object of the application.

@global Bins $bearsamppBins The bins object of the application.

Definition at line 459 of file class.tpl.consolez.php.

460 {
461 global $bearsamppBins, $bearsamppTools;
462
463 $shell = $bearsamppTools->getConsoleZ()->getShell('&quot;' . $bearsamppBins->getPostgresql()->getCliExe() . '&quot;' .
464 ' -h 127.0.0.1' .
465 ' -p ' . $bearsamppBins->getPostgresql()->getPort() .
466 ' -U ' . $bearsamppBins->getPostgresql()->getRootUser() .
467 ' -d postgres');
468 if (!file_exists($bearsamppBins->getPostgresql()->getCliExe())) {
469 $shell = $bearsamppTools->getConsoleZ()->getShell('echo ' . $bearsamppBins->getPostgresql()->getCliExe() . ' not found');
470 }
471
472 return self::getTab(
473 $bearsamppTools->getConsoleZ()->getTabTitlePostgresql(),
474 self::ICON_DB,
475 $shell,
476 $bearsamppBins->getPostgresql()->getSymlinkPath()
477 ) . PHP_EOL;
478 }

References $bearsamppBins, and getTab().

Referenced by getTabsSection().

◆ getTabPowerShellSection()

getTabPowerShellSection ( )
staticprivate

Generates the XML structure for the PowerShell tab section.

This function creates an XML structure defining the PowerShell tab and its configuration. It retrieves the PowerShell path and sets the root path.

Returns
string The formatted XML string for the PowerShell tab section. @global Tools $bearsamppTools The tools object of the application.

@global Root $bearsamppRoot The root object of the application.

Definition at line 343 of file class.tpl.consolez.php.

344 {
345 global $bearsamppRoot, $bearsamppTools;
346
347 $powerShellPath = Util::getPowerShellPath();
348 if ($powerShellPath !== false) {
349 return self::getTab(
350 $bearsamppTools->getConsoleZ()->getTabTitlePowershell(),
351 self::ICON_POWERSHELL,
352 $powerShellPath,
353 $bearsamppRoot->getRootPath()
354 ) . PHP_EOL;
355 }
356
357 return "";
358 }
static getPowerShellPath()

References $bearsamppRoot, Util\getPowerShellPath(), and getTab().

Referenced by getTabsSection().

◆ getTabPythonSection()

getTabPythonSection ( )
staticprivate

Generates the XML structure for the Python tab section.

This function creates an XML structure defining the Python tab and its configuration. It retrieves the Python executable path and sets the WWW path.

Returns
string The formatted XML string for the Python tab section. @global Tools $bearsamppTools The tools object of the application.

@global Root $bearsamppRoot The root object of the application.

Definition at line 576 of file class.tpl.consolez.php.

577 {
578 global $bearsamppRoot, $bearsamppTools;
579
580 $shell = $bearsamppTools->getConsoleZ()->getShell('&quot;' . $bearsamppTools->getPython()->getExe() . '&quot; -V');
581 if (!file_exists($bearsamppTools->getPython()->getExe())) {
582 $shell = $bearsamppTools->getConsoleZ()->getShell('echo ' . $bearsamppTools->getPython()->getExe() . ' not found');
583 }
584
585 return self::getTab(
586 $bearsamppTools->getConsoleZ()->getTabTitlePython(),
587 self::ICON_PYTHON,
588 $shell,
589 $bearsamppRoot->getWwwPath()
590 ) . PHP_EOL;
591 }

References $bearsamppRoot, and getTab().

Referenced by getTabsSection().

◆ getTabRubySection()

getTabRubySection ( )
staticprivate

Generates the XML structure for the Ruby tab section.

This function creates an XML structure defining the Ruby tab and its configuration. It retrieves the Ruby executable path and sets the WWW path.

Returns
string The formatted XML string for the Ruby tab section. @global Tools $bearsamppTools The tools object of the application.

@global Root $bearsamppRoot The root object of the application.

Definition at line 604 of file class.tpl.consolez.php.

605 {
606 global $bearsamppRoot, $bearsamppTools;
607
608 $shell = $bearsamppTools->getConsoleZ()->getShell('&quot;' . $bearsamppTools->getRuby()->getExe() . '&quot; -v');
609 if (!file_exists($bearsamppTools->getRuby()->getExe())) {
610 $shell = $bearsamppTools->getConsoleZ()->getShell('echo ' . $bearsamppTools->getRuby()->getExe() . ' not found');
611 }
612
613 return self::getTab(
614 $bearsamppTools->getConsoleZ()->getTabTitleRuby(),
615 self::ICON_RUBY,
616 $shell,
617 $bearsamppRoot->getWwwPath()
618 ) . PHP_EOL;
619 }

References $bearsamppRoot, and getTab().

Referenced by getTabsSection().

◆ getTabsSection()

getTabsSection ( )
staticprivate

Generates the XML structure for the tabs section.

This function creates an XML structure defining various tabs and their configurations. It includes multiple tab sections such as command, PowerShell, PEAR, MySQL, MariaDB, PostgreSQL, Ghostscript, Git, Node.js, Composer, Perl, Python, Ruby and Ngrok.

Returns
string The formatted XML string for the tabs section.

Definition at line 289 of file class.tpl.consolez.php.

290 {
291 return self::getIncrStr(1) . '<tabs>' . PHP_EOL .
306 self::getIncrStr(1) . '</tabs>';
307 }
static getTabMysqlSection()
static getTabNgrokSection()
static getTabRubySection()
static getTabPerlSection()
static getTabPythonSection()
static getTabNodejsSection()
static getTabGitSection()
static getTabPowerShellSection()
static getTabPearSection()
static getTabPostgresqlSection()
static getTabCmdSection()
static getTabMariadbSection()
static getTabComposerSection()
static getTabGhostscriptSection()

References getIncrStr(), getTabCmdSection(), getTabComposerSection(), getTabGhostscriptSection(), getTabGitSection(), getTabMariadbSection(), getTabMysqlSection(), getTabNgrokSection(), getTabNodejsSection(), getTabPearSection(), getTabPerlSection(), getTabPostgresqlSection(), getTabPowerShellSection(), getTabPythonSection(), and getTabRubySection().

Referenced by process().

◆ process()

process ( )
static

Generates the ConsoleZ configuration file.

This method constructs the XML structure for the ConsoleZ configuration by calling various helper methods to generate different sections of the configuration. The resulting XML is then written to the configuration file.

Definition at line 46 of file class.tpl.consolez.php.

47 {
48 global $bearsamppTools;
49 $result = '<?xml version="1.0"?>' . PHP_EOL . '<settings>' . PHP_EOL .
50 self::getConsoleSection() . PHP_EOL .
51 self::getAppearanceSection() . PHP_EOL .
52 self::getBehaviorSection() . PHP_EOL .
53 self::getHotkeysSection() . PHP_EOL .
54 self::getMouseSection() . PHP_EOL .
55 self::getTabsSection() . PHP_EOL .
56 '</settings>';
57
58 file_put_contents($bearsamppTools->getConsoleZ()->getConf(), $result);
59 }
static getHotkeysSection()
static getAppearanceSection()
static getBehaviorSection()
static getConsoleSection()

References $result, getAppearanceSection(), getBehaviorSection(), getConsoleSection(), getHotkeysSection(), getMouseSection(), and getTabsSection().

Referenced by ActionReload\__construct().

Field Documentation

◆ ICON_APP

const ICON_APP = 'app.ico'

Definition at line 19 of file class.tpl.consolez.php.

◆ ICON_COMPOSER

const ICON_COMPOSER = 'composer.ico'

Definition at line 26 of file class.tpl.consolez.php.

◆ ICON_DB

const ICON_DB = 'db.ico'

Definition at line 22 of file class.tpl.consolez.php.

◆ ICON_GHOSTSCRIPT

const ICON_GHOSTSCRIPT = 'ghostscript.ico'

Definition at line 23 of file class.tpl.consolez.php.

◆ ICON_GIT

const ICON_GIT = 'git.ico'

Definition at line 24 of file class.tpl.consolez.php.

◆ ICON_NGROK

const ICON_NGROK = 'ngrok.ico'

Definition at line 30 of file class.tpl.consolez.php.

◆ ICON_NODEJS

const ICON_NODEJS = 'nodejs.ico'

Definition at line 25 of file class.tpl.consolez.php.

◆ ICON_PEAR

const ICON_PEAR = 'pear.ico'

Definition at line 21 of file class.tpl.consolez.php.

◆ ICON_PERL

const ICON_PERL = 'perl.ico'

Definition at line 29 of file class.tpl.consolez.php.

◆ ICON_POWERSHELL

const ICON_POWERSHELL = 'powershell.ico'

Definition at line 20 of file class.tpl.consolez.php.

◆ ICON_PYTHON

const ICON_PYTHON = 'python.ico'

Definition at line 27 of file class.tpl.consolez.php.

◆ ICON_RUBY

const ICON_RUBY = 'ruby.ico'

Definition at line 28 of file class.tpl.consolez.php.


The documentation for this class was generated from the following file: