Bearsampp 2025.8.29
Loading...
Searching...
No Matches
class.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
17class Tools
18{
22 const TYPE = 'tools';
23
27 private $composer;
28
32 private $bruno;
33
37 private $consolez;
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 Util::logInfo('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->getConsoleZ(),
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 return $this->bruno;
118 }
119
125 public function getComposer()
126 {
127 if ($this->composer == null) {
128 $this->composer = new ToolComposer('composer', self::TYPE);
129 }
130 return $this->composer;
131 }
132
138 public function getConsoleZ()
139 {
140 if ($this->consolez == null) {
141 $this->consolez = new ToolConsoleZ('consolez', self::TYPE);
142 }
143 return $this->consolez;
144 }
145
151 public function getGhostscript()
152 {
153 if ($this->ghostscript == null) {
154 $this->ghostscript = new ToolGhostscript('ghostscript', self::TYPE);
155 }
156 return $this->ghostscript;
157 }
158
164 public function getGit()
165 {
166 if ($this->git == null) {
167 $this->git = new ToolGit('git', self::TYPE);
168 }
169 return $this->git;
170 }
171
177 public function getGitGui()
178 {
179 if ($this->git == null) {
180 $this->git = new ToolGit('git-gui', self::TYPE);
181 }
182 return $this->git;
183 }
184
190 public function getNgrok()
191 {
192 if ($this->ngrok == null) {
193 $this->ngrok = new ToolNgrok('ngrok', self::TYPE);
194 }
195 return $this->ngrok;
196 }
197
203 public function getPerl()
204 {
205 if ($this->perl == null) {
206 $this->perl = new ToolPerl('perl', self::TYPE);
207 }
208 return $this->perl;
209 }
210
216 public function getPython()
217 {
218 if ($this->python == null) {
219 $this->python = new ToolPython('python', self::TYPE);
220 }
221 return $this->python;
222 }
223
229 public function getRuby()
230 {
231 if ($this->ruby == null) {
232 $this->ruby = new ToolRuby('ruby', self::TYPE);
233 }
234 return $this->ruby;
235 }
236}
__construct()
const TYPE
getComposer()
getConsoleZ()
getGhostscript()
static logInfo($data, $file=null)