Bearsampp 2026.3.26
API documentation
Loading...
Searching...
No Matches
class.tpl.app.tools.php
Go to the documentation of this file.
1<?php
2/*
3 *
4 * * Copyright (c) 2021-2024 Bearsampp
5 * * License: GNU General Public License version 3 or later; see LICENSE.txt
6 * * Website: https://bearsampp.com
7 * * Github: https://github.com/Bearsampp
8 *
9 */
10
19{
20 // Constants for menu and action identifiers
21 const MENU = 'tools';
22 const ACTION_GEN_SSL_CERTIFICATE = 'genSslCertificate';
23
31 public static function process()
32 {
33 global $bearsamppLang;
34
35 return TplApp::getMenu($bearsamppLang->getValue(Lang::TOOLS), self::MENU, get_called_class());
36 }
37
47 public static function getMenuTools()
48 {
50 $resultItems = $resultActions = '';
51
52 // Git
53 $tplGit = TplAppGit::process();
54 $resultItems .= $tplGit[TplApp::SECTION_CALL] . PHP_EOL;
55 $resultActions .= $tplGit[TplApp::SECTION_CONTENT] . PHP_EOL;
56
57 // Python
58 $tplPython = TplAppPython::process();
59 $resultItems .= $tplPython[TplApp::SECTION_CALL] . PHP_EOL;
60 $resultActions .= $tplPython[TplApp::SECTION_CONTENT] . PHP_EOL;
61
62 // Bruno postman IDE
63 $resultItems .= TplAestan::getItemExe(
64 $bearsamppLang->getValue(Lang::BRUNO),
65 $bearsamppTools->getBruno()->getExe(),
67 ) . PHP_EOL;
68
69 // Composer
70 $resultItems .= TplAestan::getItemPowerShell(
73 null,
74 $bearsamppTools->getPowerShell()->getTabTitleComposer(),
75 $bearsamppRoot->getWwwPath(),
76 null
77 ) . PHP_EOL;
78
79 // Ghostscript
80 $resultItems .= TplAestan::getItemPowerShell(
83 null,
84 $bearsamppTools->getPowerShell()->getTabTitleGhostscript(),
85 $bearsamppRoot->getWwwPath(),
86 null
87 ) . PHP_EOL;
88
89 // Ngrok
90 $resultItems .= TplAestan::getItemPowerShell(
91 $bearsamppLang->getValue(Lang::NGROK),
93 null,
94 $bearsamppTools->getPowerShell()->getTabTitleNgrok(),
95 $bearsamppRoot->getWwwPath(),
96 null
97 ) . PHP_EOL;
98
99 // Pear
100 $resultItems .= TplAestan::getItemPowerShell(
101 $bearsamppLang->getValue(Lang::PEAR),
103 null,
104 $bearsamppTools->getPowerShell()->getTabTitlePear(),
105 $bearsamppBins->getPhp()->getSymlinkPath() . '/pear',
106 null
107 ) . PHP_EOL;
108
109 // Perl
110 $resultItems .= TplAestan::getItemPowerShell(
111 $bearsamppLang->getValue(Lang::PERL),
113 null,
114 $bearsamppTools->getPowerShell()->getTabTitlePerl(),
115 $bearsamppRoot->getWwwPath(),
116 null
117 ) . PHP_EOL;
118
119 // Ruby
120 $resultItems .= TplAestan::getItemPowerShell(
121 $bearsamppLang->getValue(Lang::RUBY),
123 null,
124 $bearsamppTools->getPowerShell()->getTabTitleRuby(),
125 $bearsamppRoot->getWwwPath(),
126 null
127 ) . PHP_EOL;
128
129 // Line Separator
130 $resultItems .= TplAestan::getItemSeparator() . PHP_EOL;
131
132 // Console
133 $resultItems .= TplAestan::getItemPowerShell(
134 $bearsamppLang->getValue(Lang::CONSOLE),
136 ) . PHP_EOL;
137
138 // HostsEditor
139 $resultItems .= TplAestan::getItemExe(
141 $bearsamppCore->getHostsEditorExe(),
143 ) . PHP_EOL;
144
145 // Pwgen password manager
146 $resultItems .= TplAestan::getItemExe(
147 $bearsamppLang->getValue(Lang::PWGEN),
148 $bearsamppCore->getPwgenExe(),
150 ) . PHP_EOL;
151
152 // Generate SSL Certificate
153 $tplGenSslCertificate = TplApp::getActionMulti(
154 self::ACTION_GEN_SSL_CERTIFICATE, null,
156 false, get_called_class()
157 );
158 $resultItems .= $tplGenSslCertificate[TplApp::SECTION_CALL] . PHP_EOL;
159 $resultActions .= $tplGenSslCertificate[TplApp::SECTION_CONTENT];
160
161 return $resultItems . PHP_EOL . $resultActions;
162 }
163
169 public static function getActionGenSslCertificate()
170 {
172 }
173}
global $bearsamppBins
global $bearsamppLang
global $bearsamppRoot
global $bearsamppCore
const GEN_SSL_CERTIFICATE
const COMPOSER
const GHOSTSCRIPT
const RUBY
const BRUNO
const CONSOLE
const NGROK
const MENU_GEN_SSL_CERTIFICATE
const HOSTSEDITOR
const TOOLS
const PWGEN
const PEAR
const PERL
static getItemPowerShell($caption, $glyph, $id=null, $title=null, $initDir=null, $command=null)
static getItemExe($caption, $exe, $glyph, $params=null)
const GLYPH_POWERSHELL
const GLYPH_GHOSTSCRIPT
const GLYPH_HOSTSEDITOR
const GLYPH_SSL_CERTIFICATE
static getItemSeparator()
static getActionMulti($action, $args=array(), $item=array(), $disabled=false, $class=false)
static getMenu($caption, $menu, $class)
static getActionRun($action, $args=array(), $item=array(), $waitUntilTerminated=true)
const SECTION_CALL
const SECTION_CONTENT
static getActionGenSslCertificate()
const ACTION_GEN_SSL_CERTIFICATE