Bearsampp 2025.8.29
Loading...
Searching...
No Matches
class.tpl.consolez.php
Go to the documentation of this file.
1<?php
2/*
3 * Copyright (c) 2021-2024 Bearsampp
4 * License: GNU General Public License version 3 or later; see LICENSE.txt
5 * Author: bear
6 * Website: https://bearsampp.com
7 * Github: https://github.com/Bearsampp
8 */
9
18{
19 const ICON_APP = 'app.ico';
20 const ICON_POWERSHELL = 'powershell.ico';
21 const ICON_PEAR = 'pear.ico';
22 const ICON_DB = 'db.ico';
23 const ICON_GHOSTSCRIPT = 'ghostscript.ico';
24 const ICON_GIT = 'git.ico';
25 const ICON_NODEJS = 'nodejs.ico';
26 const ICON_COMPOSER = 'composer.ico';
27 const ICON_PYTHON = 'python.ico';
28 const ICON_RUBY = 'ruby.ico';
29 const ICON_PERL = 'perl.ico';
30 const ICON_NGROK = 'ngrok.ico';
31
35 private function __construct()
36 {
37 }
38
46 public static function process()
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 }
60
69 private static function getConsoleSection()
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 }
108
117 private static function getAppearanceSection()
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 }
173
182 private static function getBehaviorSection()
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 }
202
211 private static function getHotkeysSection()
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 }
257
267 private static function getMouseSection()
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 }
279
308
320 private static function getTabCmdSection()
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 }
331
343 private static function getTabPowerShellSection()
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 }
359
371 private static function getTabPearSection()
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 }
387
399 private static function getTabMysqlSection()
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 }
417
429 private static function getTabMariadbSection()
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 }
447
459 private static function getTabPostgresqlSection()
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 }
479
491 private static function getTabGitSection()
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 }
507
520 private static function getTabNodejsSection()
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 }
536
548 private static function getTabComposerSection()
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 }
564
576 private static function getTabPythonSection()
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 }
592
604 private static function getTabRubySection()
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 }
620
632 private static function getTabPerlSection()
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 }
648
662 private static function getTabGhostscriptSection()
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 }
678
692 private static function getTabNgrokSection()
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 }
708
722 private static function getTab($title, $icon, $shell, $initDir)
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 }
735
744 private static function getIncrStr($size = 1)
745 {
746 $result = '';
747 for ($i = 0; $i <= $size; $i++) {
749 }
750 return $result;
751 }
752}
$result
global $bearsamppBins
global $bearsamppRoot
global $bearsamppCore
static getTabMysqlSection()
static getTabNgrokSection()
static getHotkeysSection()
static getTabRubySection()
static getTabPerlSection()
static getTab($title, $icon, $shell, $initDir)
static getTabPythonSection()
static getTabNodejsSection()
static getTabGitSection()
static getIncrStr($size=1)
static getTabPowerShellSection()
static getAppearanceSection()
static getTabPearSection()
static getTabPostgresqlSection()
static getBehaviorSection()
static getConsoleSection()
static getTabCmdSection()
static getTabMariadbSection()
static getTabComposerSection()
static getTabGhostscriptSection()
static getPowerShellPath()
const RETURN_TAB
Definition root.php:20