53 public static function cleanArgv($name, $type =
'text')
55 if (isset($_SERVER[
'argv'])) {
56 if ($type ==
'text') {
57 return (isset($_SERVER[
'argv'][$name]) && !empty($_SERVER[
'argv'][$name])) ? trim($_SERVER[
'argv'][$name]) :
'';
58 } elseif ($type ==
'numeric') {
59 return (isset($_SERVER[
'argv'][$name]) && is_numeric($_SERVER[
'argv'][$name])) ? intval($_SERVER[
'argv'][$name]) :
'';
60 } elseif ($type ==
'boolean') {
61 return (isset($_SERVER[
'argv'][$name])) ? true :
false;
62 } elseif ($type ==
'array') {
63 return (isset($_SERVER[
'argv'][$name]) && is_array($_SERVER[
'argv'][$name])) ? $_SERVER[
'argv'][$name] : array();
80 if (is_string($name)) {
81 if ($type ==
'text') {
82 return (isset($_GET[$name]) && !empty($_GET[$name])) ? stripslashes($_GET[$name]) :
'';
83 } elseif ($type ==
'numeric') {
84 return (isset($_GET[$name]) && is_numeric($_GET[$name])) ? intval($_GET[$name]) :
'';
85 } elseif ($type ==
'boolean') {
86 return (isset($_GET[$name])) ? true :
false;
87 } elseif ($type ==
'array') {
88 return (isset($_GET[$name]) && is_array($_GET[$name])) ? $_GET[$name] : array();
105 if (is_string($name)) {
106 if ($type ==
'text') {
107 return (isset($_POST[$name]) && !empty($_POST[$name])) ? stripslashes(trim($_POST[$name])) :
'';
108 } elseif ($type ==
'number') {
109 return (isset($_POST[$name]) && is_numeric($_POST[$name])) ? intval($_POST[$name]) :
'';
110 } elseif ($type ==
'float') {
111 return (isset($_POST[$name]) && is_numeric($_POST[$name])) ? floatval($_POST[$name]) :
'';
112 } elseif ($type ==
'boolean') {
113 return (isset($_POST[$name])) ? true :
false;
114 } elseif ($type ==
'array') {
115 return (isset($_POST[$name]) && is_array($_POST[$name])) ? $_POST[$name] : array();
116 } elseif ($type ==
'content') {
117 return (isset($_POST[$name]) && !empty($_POST[$name])) ? trim($_POST[$name]) :
'';
134 if (!empty($string) && !empty($search)) {
135 $result = stripos($string, $search);
157 if ($string ===
null || $string ===
'') {
161 $length = strlen($search);
163 return (substr($string, 0, $length) === $search);
177 public static function endWith($string, $search)
179 $length = strlen($search);
180 $start = $length * -1;
182 return (substr($string, $start) === $search);
193 public static function random($length = 32, $withNumeric =
true)
195 $characters =
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
197 $characters .=
'0123456789';
201 for ($i = 0; $i < $length; $i++) {
202 $randomString .= $characters[rand(0, strlen($characters) - 1)];
205 return $randomString;
219 foreach ($paths as $path) {
240 $handle = @opendir($path);
245 while (
false !== ($file = readdir($handle))) {
246 if ($file ==
'.' || $file ==
'..' || in_array($file, $exclude)) {
249 if (is_dir($path .
'/' . $file)) {
257 $r = @unlink($path .
'/' . $file);
281 if (substr($path, strlen($path) - 1, 1) !=
'/') {
284 $files = glob($path .
'*', GLOB_MARK);
285 foreach ($files as $file) {
304 private static function findFile($startPath, $findFile)
308 $handle = @opendir($startPath);
313 while (
false !== ($file = readdir($handle))) {
314 if ($file ==
'.' || $file ==
'..') {
317 if (is_dir($startPath .
'/' . $file)) {
322 } elseif ($file == $findFile) {
342 return filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)
343 || filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6);
368 '/^define\((.*?)' . $var .
'(.*?),/' =>
'define(\'' . $var .
'\',
' . (is_int($value) ? $value : '\
'' . $value .
'\'') .
');'
380 if (file_exists($path)) {
381 $lines = file($path);
382 $fp = fopen($path,
'w');
383 foreach ($lines as $nb => $line) {
384 $replaceDone =
false;
385 foreach ($replaceList as $regex => $replace) {
386 if (preg_match($regex, $line, $matches)) {
387 $countParams = preg_match_all(
'/{{(\d+)}}/', $replace, $paramsMatches);
388 if ($countParams > 0 && $countParams <= count($matches)) {
389 foreach ($paramsMatches[1] as $paramsMatch) {
390 $replace = str_replace(
'{{' . $paramsMatch .
'}}', $matches[$paramsMatch], $replace);
397 fwrite($fp, $replace . PHP_EOL);
422 $handle = @opendir($path);
427 while (
false !== ($file = readdir($handle))) {
428 $filePath = $path .
'/' . $file;
429 if ($file !=
'.' && $file !=
'..' && is_dir($filePath) && $file !=
'current') {
430 $result[] = str_replace(basename($path),
'', $file);
447 list($usec, $sec) = explode(
' ', microtime());
449 return ((
float)$usec + (
float)$sec);
454 global $bearsamppRegistry;
457 $value = $bearsamppRegistry->getValue(
467 $value .=
$bearsamppBins->getApache()->getSymlinkPath() .
'/bin;';
473 $value .=
$bearsamppBins->getPhp()->getSymlinkPath() .
'/imagick;';
478 if ($bearsamppTools->getComposer()->isEnable()) {
479 $value .= $bearsamppTools->getComposer()->getSymlinkPath() .
';';
480 $value .= $bearsamppTools->getComposer()->getSymlinkPath() .
'/vendor/bin;';
482 if ($bearsamppTools->getGhostscript()->isEnable()) {
483 $value .= $bearsamppTools->getGhostscript()->getSymlinkPath() .
'/bin;';
485 if ($bearsamppTools->getGit()->isEnable()) {
486 $value .= $bearsamppTools->getGit()->getSymlinkPath() .
'/bin;';
488 if ($bearsamppTools->getNgrok()->isEnable()) {
489 $value .= $bearsamppTools->getNgrok()->getSymlinkPath() .
';';
491 if ($bearsamppTools->getPerl()->isEnable()) {
492 $value .= $bearsamppTools->getPerl()->getSymlinkPath() .
'/perl/site/bin;';
493 $value .= $bearsamppTools->getPerl()->getSymlinkPath() .
'/perl/bin;';
494 $value .= $bearsamppTools->getPerl()->getSymlinkPath() .
'/c/bin;';
496 if ($bearsamppTools->getPython()->isEnable()) {
497 $value .= $bearsamppTools->getPython()->getSymlinkPath() .
'/bin;';
499 if ($bearsamppTools->getRuby()->isEnable()) {
500 $value .= $bearsamppTools->getRuby()->getSymlinkPath() .
'/bin;';
518 global $bearsamppRegistry;
520 return $bearsamppRegistry->setStringValue(
535 global $bearsamppRegistry;
537 return $bearsamppRegistry->getValue(
553 global $bearsamppRegistry;
555 return $bearsamppRegistry->setStringValue(
570 global $bearsamppRegistry;
572 return $bearsamppRegistry->getValue(
588 global $bearsamppRegistry;
590 return $bearsamppRegistry->setExpandStringValue(
605 global $bearsamppRegistry;
607 return $bearsamppRegistry->getValue(
631 return file_exists(self::getStartupLnkPath());
654 if (file_exists($startupLnkPath)) {
655 return @unlink($startupLnkPath);
669 private static function log($data, $type, $file =
null)
697 '[' . date(
'Y-m-d H:i:s', time()) .
'] # ' .
APP_TITLE .
' ' .
$bearsamppCore->getAppVersion() .
' # ' . $type .
': ' . $data . PHP_EOL,
724 $separator =
'========================================================================================' . PHP_EOL;
725 foreach ($logs as $log) {
726 if (!file_exists($log)) {
729 $logContent = @file_get_contents($log);
730 if ($logContent !==
false && !self::endWith($logContent, $separator)) {
731 file_put_contents($log, $separator, FILE_APPEND);
743 public static function logTrace($data, $file =
null)
745 self::log($data, self::LOG_TRACE, $file);
755 public static function logDebug($data, $file =
null)
757 self::log($data, self::LOG_DEBUG, $file);
767 public static function logInfo($data, $file =
null)
781 self::log($data, self::LOG_WARNING, $file);
791 public static function logError($data, $file =
null)
793 self::log($data, self::LOG_ERROR, $file);
823 if (is_dir(
'C:\Windows\System32\WindowsPowerShell')) {
824 return self::findFile(
'C:\Windows\System32\WindowsPowerShell',
'powershell.exe');
840 public static function findRepos($initPath, $startPath, $checkFile, $maxDepth = 1)
842 $depth = substr_count(str_replace($initPath,
'', $startPath),
'/');
845 $handle = @opendir($startPath);
850 while (
false !== ($file = readdir($handle))) {
851 if ($file ==
'.' || $file ==
'..') {
854 if (is_dir($startPath .
'/' . $file) && ($initPath == $startPath || $depth <= $maxDepth)) {
855 $tmpResults =
self::findRepos($initPath, $startPath .
'/' . $file, $checkFile, $maxDepth);
856 foreach ($tmpResults as $tmpResult) {
859 } elseif (is_file($startPath .
'/' . $checkFile) && !in_array($startPath,
$result)) {
878 return str_replace(
'/',
'\\', $path);
890 return str_replace(
'\\',
'/', $path);
902 $type = pathinfo($path, PATHINFO_EXTENSION);
903 $data = file_get_contents($path);
905 return 'data:image/' . $type .
';base64,' . base64_encode($data);
917 return iconv(
'UTF-8',
'WINDOWS-1252//IGNORE', $data);
929 return iconv(
'WINDOWS-1252',
'UTF-8//IGNORE', $data);
949 foreach ($pids as $pid) {
967 foreach ($pathsToScan as $pathToScan) {
969 $findFiles =
self::findFiles($pathToScan[
'path'], $pathToScan[
'includes'], $pathToScan[
'recursive']);
970 foreach ($findFiles as $findFile) {
973 self::logDebug($pathToScan[
'path'] .
' scanned in ' . round(self::getMicrotime() - $startTime, 3) .
's');
1011 'includes' => array(
''),
1012 'recursive' =>
false
1018 'includes' => array(
''),
1019 'recursive' =>
false
1025 'includes' => array(
'openssl.cfg'),
1026 'recursive' =>
false
1032 'includes' => array(
'alias.conf'),
1033 'recursive' =>
false
1038 foreach ($folderList as $folder) {
1040 'path' =>
$bearsamppBins->getApache()->getRootPath() .
'/' . $folder,
1041 'includes' => array(
'.ini',
'.conf'),
1048 foreach ($folderList as $folder) {
1050 'path' =>
$bearsamppBins->getPhp()->getRootPath() .
'/' . $folder,
1051 'includes' => array(
'.php',
'.bat',
'.ini',
'.reg',
'.inc'),
1058 foreach ($folderList as $folder) {
1060 'path' =>
$bearsamppBins->getMysql()->getRootPath() .
'/' . $folder,
1061 'includes' => array(
'my.ini'),
1062 'recursive' =>
false
1068 foreach ($folderList as $folder) {
1070 'path' =>
$bearsamppBins->getMariadb()->getRootPath() .
'/' . $folder,
1071 'includes' => array(
'my.ini'),
1072 'recursive' =>
false
1078 foreach ($folderList as $folder) {
1080 'path' =>
$bearsamppBins->getPostgresql()->getRootPath() .
'/' . $folder,
1081 'includes' => array(
'.ber',
'.conf',
'.bat'),
1088 foreach ($folderList as $folder) {
1090 'path' =>
$bearsamppBins->getNodejs()->getRootPath() .
'/' . $folder .
'/etc',
1091 'includes' => array(
'npmrc'),
1095 'path' =>
$bearsamppBins->getNodejs()->getRootPath() .
'/' . $folder .
'/node_modules/npm',
1096 'includes' => array(
'npmrc'),
1097 'recursive' =>
false
1103 foreach ($folderList as $folder) {
1105 'path' => $bearsamppTools->getComposer()->getRootPath() .
'/' . $folder,
1106 'includes' => array(
'giscus.json'),
1107 'recursive' =>
false
1113 foreach ($folderList as $folder) {
1115 'path' => $bearsamppTools->getConsoleZ()->getRootPath() .
'/' . $folder,
1116 'includes' => array(
'console.xml',
'.ini',
'.btm'),
1123 foreach ($folderList as $folder) {
1125 'path' => $bearsamppTools->getPython()->getRootPath() .
'/' . $folder .
'/bin',
1126 'includes' => array(
'.bat'),
1127 'recursive' =>
false
1130 'path' => $bearsamppTools->getPython()->getRootPath() .
'/' . $folder .
'/settings',
1131 'includes' => array(
'winpython.ini'),
1132 'recursive' =>
false
1138 foreach ($folderList as $folder) {
1140 'path' => $bearsamppTools->getRuby()->getRootPath() .
'/' . $folder .
'/bin',
1141 'includes' => array(
'!.dll',
'!.exe'),
1142 'recursive' =>
false
1158 private static function findFiles($startPath, $includes = array(
''), $recursive =
true)
1162 $handle = @opendir($startPath);
1167 while (
false !== ($file = readdir($handle))) {
1168 if ($file ==
'.' || $file ==
'..') {
1171 if (is_dir($startPath .
'/' . $file) && $recursive) {
1173 foreach ($tmpResults as $tmpResult) {
1176 } elseif (is_file($startPath .
'/' . $file)) {
1177 foreach ($includes as $include) {
1178 if (self::startWith($include,
'!')) {
1179 $include = ltrim($include,
'!');
1180 if (self::startWith($file,
'.') && !self::endWith($file, $include)) {
1182 } elseif ($file != $include) {
1185 } elseif (self::endWith($file, $include) || $file == $include || empty($include)) {
1205 public static function changePath($filesToScan, $rootPath =
null)
1210 'countChangedOcc' => 0,
1211 'countChangedFiles' => 0
1214 $rootPath = $rootPath !=
null ? $rootPath :
$bearsamppRoot->getRootPath();
1220 foreach ($filesToScan as $fileToScan) {
1221 $tmpCountChangedOcc = 0;
1222 $fileContentOr = file_get_contents($fileToScan);
1223 $fileContent = $fileContentOr;
1226 preg_match(
'#' . $unixOldPath .
'#i', $fileContent, $unixMatches);
1227 if (!empty($unixMatches)) {
1228 $fileContent = str_replace($unixOldPath, $unixCurrentPath, $fileContent, $countChanged);
1229 $tmpCountChangedOcc += $countChanged;
1231 preg_match(
'#' . str_replace(
'\\',
'\\\\', $windowsOldPath) .
'#i', $fileContent, $windowsMatches);
1232 if (!empty($windowsMatches)) {
1233 $fileContent = str_replace($windowsOldPath, $windowsCurrentPath, $fileContent, $countChanged);
1234 $tmpCountChangedOcc += $countChanged;
1239 if (!empty($unixMatches)) {
1241 $tmpCountChangedOcc += $countChanged;
1244 if (!empty($windowsMatches)) {
1246 $tmpCountChangedOcc += $countChanged;
1249 if ($fileContentOr != $fileContent) {
1250 $result[
'countChangedOcc'] += $tmpCountChangedOcc;
1251 $result[
'countChangedFiles'] += 1;
1252 file_put_contents($fileToScan, $fileContent);
1275 $resultArray = json_decode(
$result,
true);
1276 if (isset($resultArray[
'tag_name']) && isset($resultArray[
'assets'][0][
'browser_download_url'])) {
1277 $tagName = $resultArray[
'tag_name'];
1278 $downloadUrl = $resultArray[
'assets'][0][
'browser_download_url'];
1279 $name = $resultArray[
'name'];
1284 return [
'version' => $tagName,
'html_url' => $downloadUrl,
'name' => $name];
1314 public static function getWebsiteUrl($path =
'', $fragment =
'', $utmSource =
true)
1319 if (!empty($path)) {
1320 $url .=
'/' . ltrim($path,
'/');
1323 $url = rtrim($url,
'/') .
'/?utm_source=bearsampp-' .
$bearsamppCore->getAppVersion();
1325 if (!empty($fragment)) {
1356 $data = get_headers($url,
true);
1357 if (isset($data[
'Content-Length'])) {
1358 $size = intval($data[
'Content-Length']);
1374 if ((!$unit && $size >= 1 << 30) || $unit ==
'GB') {
1375 return number_format($size / (1 << 30), 2) .
'GB';
1377 if ((!$unit && $size >= 1 << 20) || $unit ==
'MB') {
1378 return number_format($size / (1 << 20), 2) .
'MB';
1380 if ((!$unit && $size >= 1 << 10) || $unit ==
'KB') {
1381 return number_format($size / (1 << 10), 2) .
'KB';
1384 return number_format($size) .
' bytes';
1408 if (function_exists(
'curl_version')) {
1415 $rebuildResult = array();
1419 $rebuildResult[] = $row;
1425 foreach (
$result as $header) {
1448 $context = stream_context_create(array(
1450 'verify_peer' =>
false,
1451 'verify_peer_name' =>
false,
1452 'allow_self_signed' =>
true,
1456 $fp = @fopen($url,
'r',
false, $context);
1458 $meta = stream_get_meta_data($fp);
1459 $result = isset($meta[
'wrapper_data']) ? $meta[
'wrapper_data'] :
$result;
1482 curl_setopt($ch, CURLOPT_RETURNTRANSFER,
true);
1483 curl_setopt($ch, CURLOPT_VERBOSE,
true);
1484 curl_setopt($ch, CURLOPT_HEADER,
true);
1485 curl_setopt($ch, CURLOPT_URL, $url);
1486 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,
false);
1494 $responseHeaders = explode(
"\r\n\r\n",
$response, 2);
1495 if (!isset($responseHeaders[0]) || empty($responseHeaders[0])) {
1499 return explode(
"\n", $responseHeaders[0]);
1518 $context = stream_context_create(array(
1520 'verify_peer' =>
false,
1521 'verify_peer_name' =>
false,
1522 'allow_self_signed' =>
true,
1526 $fp = @stream_socket_client(($ssl ?
'ssl://' :
'') . $host .
':' .
$port, $errno, $errstr, 5, STREAM_CLIENT_CONNECT, $context);
1529 $result = explode(PHP_EOL, $out);
1534 $rebuildResult = array();
1538 $rebuildResult[] = $row;
1544 foreach (
$result as $header) {
1564 curl_setopt($ch, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2);
1565 curl_setopt($ch, CURLOPT_RETURNTRANSFER,
true);
1566 curl_setopt($ch, CURLOPT_VERBOSE,
true);
1567 curl_setopt($ch, CURLOPT_URL, $url);
1568 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,
false);
1569 curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
1570 $data = curl_exec($ch);
1571 if (curl_errno($ch)) {
1589 $localIP =
'127.0.0.1';
1592 $errorReporting = error_reporting();
1597 $connection = @fsockopen($localIP,
$port);
1600 error_reporting($errorReporting);
1602 if (is_resource($connection)) {
1603 fclose($connection);
1606 return $process !=
null ? $process :
'N/A';
1621 return preg_match(
'/^([a-z\d](-*[a-z\d])*)(\.([a-z\d](-*[a-z\d])*))*$/i', $domainName)
1622 && preg_match(
'/^.{1,253}$/', $domainName)
1623 && preg_match(
'/^[^\.]{1,63}(\.[^\.]{1,63})*$/', $domainName);
1635 return ctype_alnum($string);
1651 $name = $bin->getName();
1652 $service = $bin->getService();
1656 if ($isPortInUse ===
false) {
1657 if (!$service->isInstalled()) {
1659 if ($service->start()) {
1660 self::logInfo(sprintf(
'%s service successfully installed. (name: %s ; port: %s)', $name, $service->getName(),
$port));
1662 $bearsamppWinbinder->messageBoxInfo(
1671 $serviceErrorLog = sprintf(
'Error during the installation of %s service', $name);
1672 if (!empty($syntaxCheckCmd)) {
1673 $cmdSyntaxCheck = $bin->getCmdLineOutput($syntaxCheckCmd);
1674 if (!$cmdSyntaxCheck[
'syntaxOk']) {
1676 $serviceErrorLog .= sprintf(
' (conf errors detected : %s)', $cmdSyntaxCheck[
'content']);
1681 $bearsamppWinbinder->messageBoxError($serviceError, $boxTitle);
1687 $bearsamppWinbinder->messageBoxWarning(
1695 } elseif ($service->isRunning()) {
1696 self::logWarning(sprintf(
'%s service already installed and running', $name));
1698 $bearsamppWinbinder->messageBoxWarning(
1706 self::logError(sprintf(
'Port %s is used by an other application : %s', $name));
1708 $bearsamppWinbinder->messageBoxError(
1734 if ($service->isInstalled()) {
1735 if ($service->delete()) {
1736 self::logInfo(sprintf(
'%s service successfully removed', $name));
1740 self::logError(sprintf(
'Error during the uninstallation of %s service', $name));
1760 public static function startService($bin, $syntaxCheckCmd, $showWindow =
false)
1763 $name = $bin->getName();
1764 $service = $bin->getService();
1767 if (!$service->start()) {
1769 $serviceErrorLog = sprintf(
'Error while starting the %s service', $name);
1770 if (!empty($syntaxCheckCmd)) {
1771 $cmdSyntaxCheck = $bin->getCmdLineOutput($syntaxCheckCmd);
1772 if (!$cmdSyntaxCheck[
'syntaxOk']) {
1774 $serviceErrorLog .= sprintf(
' (conf errors detected : %s)', $cmdSyntaxCheck[
'content']);
1779 $bearsamppWinbinder->messageBoxError($serviceError, $boxTitle);
1797 $part = !empty($part) ?
'/' . $part :
null;
1811 $part = !empty($part) ?
'/' . $part :
null;
1825 $file = !empty($file) ?
'/' . $file :
null;
1841 $handle = @opendir($path);
1846 while (
false !== ($file = readdir($handle))) {
1847 $filePath = $path .
'/' . $file;
1848 if ($file !=
'.' && $file !=
'..' && is_dir($filePath) && $file !=
'current') {
1871 $nssmEnvPathsFile =
$bearsamppRoot->getRootPath() .
'/nssmEnvPaths.dat';
1873 if (is_file($nssmEnvPathsFile)) {
1874 $paths = explode(PHP_EOL, file_get_contents($nssmEnvPathsFile));
1875 foreach ($paths as $path) {
1876 $path = trim($path);
1877 if (stripos($path,
':') ===
false) {
1880 if (is_dir($path)) {
1907 if (!is_dir($folderPath)) {
1908 mkdir($folderPath, 0777,
true);
1912 file_put_contents($filepath, $content);
1914 $bearsamppWinbinder->exec(
$bearsamppConfig->getNotepad(),
'"' . $filepath .
'"');
1926 $stringfile =
$bearsamppCore->getResourcesPath() .
'/string.dat';
1927 $encryptedFile =
$bearsamppCore->getResourcesPath() .
'/github.dat';
1928 $method =
'AES-256-CBC';
1931 $stringPhrase = @file_get_contents($stringfile);
1932 if ($stringPhrase ===
false) {
1933 Util::logDebug(
"Failed to read the file at path: {$stringfile}");
1938 $stringKey = convert_uudecode($stringPhrase);
1941 $encryptedData = file_get_contents($encryptedFile);
1942 if ($encryptedData ===
false) {
1943 Util::logDebug(
"Failed to read the file at path: {$encryptedFile}");
1949 $data = base64_decode($encryptedData);
1950 if ($data ===
false) {
1951 Util::logDebug(
"Failed to decode the data from path: {$encryptedFile}");
1957 $ivLength = openssl_cipher_iv_length($method);
1958 $iv = substr($data, 0, $ivLength);
1959 $encrypted = substr($data, $ivLength);
1962 $decrypted = openssl_decrypt($encrypted, $method, $stringKey, 0, $iv);
1963 if ($decrypted ===
false) {
1964 Util::logDebug(
"Decryption failed for data from path: {$encryptedFile}");
1984 'Accept: application/vnd.github+json',
1985 'Authorization: Token ' . $Token,
1987 'X-GitHub-Api-Version: 2022-11-28'
2001 $connected = @fsockopen(
'www.google.com', 80);
static getProcessUsingPort($port)
const PATH_LIN_PLACEHOLDER
const PATH_WIN_PLACEHOLDER
const START_SERVICE_ERROR
const START_SERVICE_TITLE
const INSTALL_SERVICE_TITLE
const STARTUP_SERVICE_SYNTAX_ERROR
const SERVICE_INSTALL_ERROR
const SERVICE_ALREADY_INSTALLED
const PROCESSOR_REG_SUBKEY
const PROCESSOR_REG_ENTRY
static logError($data, $file=null)
static findRepos($initPath, $startPath, $checkFile, $maxDepth=1)
static installService($bin, $port, $syntaxCheckCmd, $showWindow=false)
static getWebsiteUrlNoUtm($path='', $fragment='')
static disableLaunchStartup()
static getRemoteFilesize($url, $humanFileSize=true)
static getGithubUrl($part=null)
static deleteFolder($path)
static logInitClass($classInstance)
static getHeaders($host, $port, $ssl=false)
static removeService($service, $name)
static logTrace($data, $file=null)
static isValidPort($port)
static cleanArgv($name, $type='text')
static cp1252ToUtf8($data)
static setAppPathRegKey($value)
static logInfo($data, $file=null)
static imgToBase64($path)
static contains($string, $search)
static getVersionList($path)
static getHttpHeaders($pingUrl)
static utf8ToCp1252($data)
static isValidDomainName($domainName)
static getLatestVersion($url)
static getFolderList($path)
static getAppBinsRegKey($fromRegistry=true)
static getAppPathRegKey()
static getGithubRawUrl($file)
static getChangelogUrl($utmSource=true)
static getFilesToScan($path=null)
static openFileContent($caption, $content)
static logDebug($data, $file=null)
static isAlphanumeric($string)
static logReloadClass($classInstance)
static startWith($string, $search)
static getGithubUserUrl($part=null)
static humanFileSize($size, $unit='')
static random($length=32, $withNumeric=true)
static endWith($string, $search)
static formatWindowsPath($path)
static changePath($filesToScan, $rootPath=null)
static getWebsiteUrl($path='', $fragment='', $utmSource=true)
static formatUnixPath($path)
static isPortInUse($port)
static cleanGetVar($name, $type='text')
static findFiles($startPath, $includes=array(''), $recursive=true)
static replaceDefine($path, $var, $value)
static clearFolder($path, $exclude=array())
static setupCurlHeaderWithToken()
static clearFolders($paths, $exclude=array())
static getFopenHttpHeaders($url)
static startService($bin, $syntaxCheckCmd, $showWindow=false)
static cleanPostVar($name, $type='text')
static findFile($startPath, $findFile)
static getCurlHttpHeaders($url)
static log($data, $type, $file=null)
static enableLaunchStartup()
static getStartupLnkPath()
static setSysPathRegKey($value)
static replaceInFile($path, $replaceList)
static getSysPathRegKey()
static getPowerShellPath()
static getProcessorRegKey()
static checkInternetState()
static setAppBinsRegKey($value)
static logWarning($data, $file=null)
static createShortcut($savePath)
static getStartupPath($file=null)
const APP_GITHUB_USERAGENT