Bearsampp 2026.9.23
Loading...
Searching...
No Matches
class.tools.php
Go to the documentation of this file.
1<?php
2/*
3 *
4 * * Copyright (c) 2021-2026 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
17class Tools
18{
22 const TYPE = 'tools';
23
27 private $composer;
28
32 private $bruno;
33
37 private $powershell;
38
42 private $ghostscript;
43
47 private $git;
48
52 private $ngrok;
53
57 private $perl;
58
62 private $python;
63
67 private $ruby;
68
72 public function __construct()
73 {
74 }
75
79 public function update()
80 {
81 Log::info('Update tools config');
82 foreach ($this->getAll() as $tool) {
83 $tool->update();
84 }
85 }
86
92 public function getAll()
93 {
94 return array(
95 $this->getBruno(),
96 $this->getComposer(),
97 $this->getPowerShell(),
98 $this->getGhostscript(),
99 $this->getGit(),
100 $this->getNgrok(),
101 $this->getPerl(),
102 $this->getPython(),
103 $this->getRuby(),
104 );
105 }
106
112 public function getBruno()
113 {
114 if ($this->bruno == null) {
115 $this->bruno = new ToolBruno('bruno', self::TYPE);
116 }
117
118 return $this->bruno;
119 }
120
126 public function getComposer()
127 {
128 if ($this->composer == null) {
129 $this->composer = new ToolComposer('composer', self::TYPE);
130 }
131
132 return $this->composer;
133 }
134
140 public function getPowerShell()
141 {
142 if ($this->powershell == null) {
143 $this->powershell = new ToolPowerShell('powershell', self::TYPE);
144 }
145
146 return $this->powershell;
147 }
148
154 public function getGhostscript()
155 {
156 if ($this->ghostscript == null) {
157 $this->ghostscript = new ToolGhostscript('ghostscript', self::TYPE);
158 }
159
160 return $this->ghostscript;
161 }
162
168 public function getGit()
169 {
170 if ($this->git == null) {
171 $this->git = new ToolGit('git', self::TYPE);
172 }
173
174 return $this->git;
175 }
176
182 public function getGitGui()
183 {
184 if ($this->git == null) {
185 $this->git = new ToolGit('git-gui', self::TYPE);
186 }
187
188 return $this->git;
189 }
190
196 public function getNgrok()
197 {
198 if ($this->ngrok == null) {
199 $this->ngrok = new ToolNgrok('ngrok', self::TYPE);
200 }
201
202 return $this->ngrok;
203 }
204
210 public function getPerl()
211 {
212 if ($this->perl == null) {
213 $this->perl = new ToolPerl('perl', self::TYPE);
214 }
215
216 return $this->perl;
217 }
218
224 public function getPython()
225 {
226 if ($this->python == null) {
227 $this->python = new ToolPython('python', self::TYPE);
228 }
229
230 return $this->python;
231 }
232
238 public function getRuby()
239 {
240 if ($this->ruby == null) {
241 $this->ruby = new ToolRuby('ruby', self::TYPE);
242 }
243
244 return $this->ruby;
245 }
246}
247
static info($data, $file=null)
__construct()
getPowerShell()
const TYPE
getComposer()
getGhostscript()