2024.8.23
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'
 
const ICON_YARN = 'yarn.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 ()
 
static getTabYarnSection ()
 

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()

TplConsoleZ::__construct ( )
private

Private constructor to prevent instantiation.

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

37 {
38 }

Member Function Documentation

◆ getAppearanceSection()

static TplConsoleZ::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 118 of file class.tpl.consolez.php.

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

References getIncrStr().

Referenced by process().

+ Here is the caller graph for this function:

◆ getBehaviorSection()

static TplConsoleZ::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 183 of file class.tpl.consolez.php.

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

References getIncrStr().

Referenced by process().

+ Here is the caller graph for this function:

◆ getConsoleSection()

static TplConsoleZ::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 70 of file class.tpl.consolez.php.

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

References $bearsamppRoot, and getIncrStr().

Referenced by process().

+ Here is the caller graph for this function:

◆ getHotkeysSection()

static TplConsoleZ::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 212 of file class.tpl.consolez.php.

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

References getIncrStr().

Referenced by process().

+ Here is the caller graph for this function:

◆ getIncrStr()

static TplConsoleZ::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 774 of file class.tpl.consolez.php.

775 {
776 $result = '';
777 for ($i = 0; $i <= $size; $i++) {
779 }
780 return $result;
781 }
$result
const RETURN_TAB
Definition root.php:19

References $result, and RETURN_TAB.

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

+ Here is the caller graph for this function:

◆ getMouseSection()

static TplConsoleZ::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 268 of file class.tpl.consolez.php.

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

References getIncrStr().

Referenced by process().

+ Here is the caller graph for this function:

◆ getTab()

static TplConsoleZ::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 752 of file class.tpl.consolez.php.

753 {
754 global $bearsamppCore;
755 return self::getIncrStr(2) . '<tab title="' . $title . '" icon="' . $bearsamppCore->getIconsPath(false) . '/' . $icon . '" use_default_icon="0">' . PHP_EOL .
756 self::getIncrStr(3) . '<console shell="' . $shell . '" init_dir="' . $initDir . '" run_as_user="0" user=""/>' . PHP_EOL .
757 self::getIncrStr(3) . '<cursor style="0" r="255" g="255" b="255"/>' . PHP_EOL .
758 self::getIncrStr(3) . '<background type="0" r="0" g="0" b="0">' . PHP_EOL .
759 self::getIncrStr(4) . '<image file="" relative="0" extend="0" position="0">' . PHP_EOL .
760 self::getIncrStr(5) . '<tint opacity="0" r="0" g="0" b="0"/>' . PHP_EOL .
761 self::getIncrStr(4) . '</image>' . PHP_EOL .
762 self::getIncrStr(3) . '</background>' . PHP_EOL .
763 self::getIncrStr(2) . '</tab>';
764 }
global $bearsamppCore

References $bearsamppCore, and getIncrStr().

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

+ Here is the caller graph for this function:

◆ getTabCmdSection()

static TplConsoleZ::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 322 of file class.tpl.consolez.php.

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

References $bearsamppRoot, and getTab().

Referenced by getTabsSection().

+ Here is the caller graph for this function:

◆ getTabComposerSection()

static TplConsoleZ::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 550 of file class.tpl.consolez.php.

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

References $bearsamppRoot, and getTab().

Referenced by getTabsSection().

+ Here is the caller graph for this function:

◆ getTabGhostscriptSection()

static TplConsoleZ::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 692 of file class.tpl.consolez.php.

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

References $bearsamppRoot, and getTab().

Referenced by getTabsSection().

+ Here is the caller graph for this function:

◆ getTabGitSection()

static TplConsoleZ::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 493 of file class.tpl.consolez.php.

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

References $bearsamppRoot, and getTab().

Referenced by getTabsSection().

+ Here is the caller graph for this function:

◆ getTabMariadbSection()

static TplConsoleZ::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 431 of file class.tpl.consolez.php.

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

References $bearsamppBins, and getTab().

Referenced by getTabsSection().

+ Here is the caller graph for this function:

◆ getTabMysqlSection()

static TplConsoleZ::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 401 of file class.tpl.consolez.php.

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

References $bearsamppBins, and getTab().

Referenced by getTabsSection().

+ Here is the caller graph for this function:

◆ getTabNgrokSection()

static TplConsoleZ::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 722 of file class.tpl.consolez.php.

723 {
724 global $bearsamppRoot, $bearsamppTools;
725
726 $shell = $bearsamppTools->getConsoleZ()->getShell('&quot;' . $bearsamppTools->getNgrok()->getExe() . '&quot; version');
727 if (!file_exists($bearsamppTools->getNgrok()->getExe())) {
728 $shell = $bearsamppTools->getConsoleZ()->getShell('echo ' . $bearsamppTools->getNgrok()->getExe() . ' not found');
729 }
730
731 return self::getTab(
732 $bearsamppTools->getConsoleZ()->getTabTitleNgrok(),
733 self::ICON_NGROK,
734 $shell,
735 $bearsamppRoot->getWwwPath()
736 ) . PHP_EOL;
737 }

References $bearsamppRoot, and getTab().

Referenced by getTabsSection().

+ Here is the caller graph for this function:

◆ getTabNodejsSection()

static TplConsoleZ::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 522 of file class.tpl.consolez.php.

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

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

Referenced by getTabsSection().

+ Here is the caller graph for this function:

◆ getTabPearSection()

static TplConsoleZ::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 373 of file class.tpl.consolez.php.

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

References $bearsamppBins, and getTab().

Referenced by getTabsSection().

+ Here is the caller graph for this function:

◆ getTabPerlSection()

static TplConsoleZ::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 662 of file class.tpl.consolez.php.

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

References $bearsamppRoot, and getTab().

Referenced by getTabsSection().

+ Here is the caller graph for this function:

◆ getTabPostgresqlSection()

static TplConsoleZ::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 461 of file class.tpl.consolez.php.

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

References $bearsamppBins, and getTab().

Referenced by getTabsSection().

+ Here is the caller graph for this function:

◆ getTabPowerShellSection()

static TplConsoleZ::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 345 of file class.tpl.consolez.php.

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

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

Referenced by getTabsSection().

+ Here is the caller graph for this function:

◆ getTabPythonSection()

static TplConsoleZ::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 578 of file class.tpl.consolez.php.

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

References $bearsamppRoot, and getTab().

Referenced by getTabsSection().

+ Here is the caller graph for this function:

◆ getTabRubySection()

static TplConsoleZ::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 606 of file class.tpl.consolez.php.

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

References $bearsamppRoot, and getTab().

Referenced by getTabsSection().

+ Here is the caller graph for this function:

◆ getTabsSection()

static TplConsoleZ::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, Yarn, and Ngrok.

Returns
string The formatted XML string for the tabs section.

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

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

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

Referenced by process().

+ Here is the caller graph for this function:

◆ getTabYarnSection()

static TplConsoleZ::getTabYarnSection ( )
staticprivate

Generates the XML structure for the Yarn tab section.

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

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

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

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

635 {
636 global $bearsamppRoot, $bearsamppTools;
637
638 $shell = $bearsamppTools->getConsoleZ()->getShell('&quot;' . $bearsamppTools->getYarn()->getExe() . '&quot; --version');
639 if (!file_exists($bearsamppTools->getYarn()->getExe())) {
640 $shell = $bearsamppTools->getConsoleZ()->getShell('echo ' . $bearsamppTools->getYarn()->getExe() . ' not found');
641 }
642
643 return self::getTab(
644 $bearsamppTools->getConsoleZ()->getTabTitleYarn(),
645 self::ICON_YARN,
646 $shell,
647 $bearsamppRoot->getWwwPath()
648 ) . PHP_EOL;
649 }

References $bearsamppRoot, and getTab().

Referenced by getTabsSection().

+ Here is the caller graph for this function:

◆ process()

static TplConsoleZ::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 47 of file class.tpl.consolez.php.

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

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

Referenced by ActionReload\__construct().

+ Here is the caller graph for this function:

Field Documentation

◆ ICON_APP

const TplConsoleZ::ICON_APP = 'app.ico'

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

◆ ICON_COMPOSER

const TplConsoleZ::ICON_COMPOSER = 'composer.ico'

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

◆ ICON_DB

const TplConsoleZ::ICON_DB = 'db.ico'

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

◆ ICON_GHOSTSCRIPT

const TplConsoleZ::ICON_GHOSTSCRIPT = 'ghostscript.ico'

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

◆ ICON_GIT

const TplConsoleZ::ICON_GIT = 'git.ico'

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

◆ ICON_NGROK

const TplConsoleZ::ICON_NGROK = 'ngrok.ico'

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

◆ ICON_NODEJS

const TplConsoleZ::ICON_NODEJS = 'nodejs.ico'

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

◆ ICON_PEAR

const TplConsoleZ::ICON_PEAR = 'pear.ico'

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

◆ ICON_PERL

const TplConsoleZ::ICON_PERL = 'perl.ico'

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

◆ ICON_POWERSHELL

const TplConsoleZ::ICON_POWERSHELL = 'powershell.ico'

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

◆ ICON_PYTHON

const TplConsoleZ::ICON_PYTHON = 'python.ico'

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

◆ ICON_RUBY

const TplConsoleZ::ICON_RUBY = 'ruby.ico'

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

◆ ICON_YARN

const TplConsoleZ::ICON_YARN = 'yarn.ico'

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


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