77 foreach ($paths as $path) {
98 $handle = @opendir($path);
103 while (
false !== ($file = readdir($handle))) {
104 if ($file ==
'.' || $file ==
'..' || in_array($file, $exclude)) {
107 if (is_dir($path .
'/' . $file)) {
115 $r = @unlink($path .
'/' . $file);
139 if (substr($path, strlen($path) - 1, 1) !=
'/') {
142 $files = glob($path .
'*', GLOB_MARK);
143 foreach ($files as $file) {
162 private static function findFile($startPath, $findFile)
166 $handle = @opendir($startPath);
171 while (
false !== ($file = readdir($handle))) {
172 if ($file ==
'.' || $file ==
'..') {
175 if (is_dir($startPath .
'/' . $file)) {
180 } elseif ($file == $findFile) {
200 return filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)
201 || filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6);
225 if (strtoupper(substr(PHP_OS, 0, 3)) !==
'WIN') {
227 if (function_exists(
'posix_geteuid')) {
228 return posix_geteuid() === 0;
237 if ($output !==
null) {
239 if (stripos($output,
'Access is denied') !==
false ||
240 stripos($output,
'System error 5') !==
false ||
241 stripos($output,
'Zugriff verweigert') !==
false) {
247 if (stripos($output,
'There are no entries') !==
false ||
248 stripos($output,
'These workstations') !==
false ||
249 preg_match(
'/\\\\\\\\/', $output)) {
256 if ($output !==
null && !empty($output)) {
258 if (stripos($output,
'S-1-16-12288') !==
false ||
259 stripos($output,
'S-1-5-32-544') !==
false) {
264 if (stripos($output,
'S-1-16-8192') !==
false) {
271 $testFile = getenv(
'SystemRoot') .
'\\Temp\\bearsampp_admin_test_' . uniqid() .
'.tmp';
272 $result = @file_put_contents($testFile,
'test');
292 '/^define\((.*?)' . $var .
'(.*?),/' =>
'define(\'' . $var .
'\',
' . (is_int($value) ? $value : '\
'' . $value .
'\'') .
');'
304 if (file_exists($path)) {
305 $lines = file($path);
306 $fp = fopen($path,
'w');
307 foreach ($lines as $nb => $line) {
308 $replaceDone =
false;
309 foreach ($replaceList as $regex => $replace) {
310 if (preg_match($regex, $line, $matches)) {
311 $countParams = preg_match_all(
'/{{(\d+)}}/', $replace, $paramsMatches);
312 if ($countParams > 0 && $countParams <= count($matches)) {
313 foreach ($paramsMatches[1] as $paramsMatch) {
314 $replace = str_replace(
'{{' . $paramsMatch .
'}}', $matches[$paramsMatch], $replace);
317 Log::trace(
'Replace in file ' . $path .
' :');
321 fwrite($fp, $replace . PHP_EOL);
347 $handle = @opendir($path);
352 $prefix = basename($path);
354 while (
false !== ($file = readdir($handle))) {
355 $filePath = $path .
'/' . $file;
356 if ($file !=
'.' && $file !=
'..' && is_dir($filePath) && $file !=
'current') {
357 if (strpos($file, $prefix) === 0) {
358 $version = substr($file, strlen($prefix));
379 list($usec, $sec) = explode(
' ', microtime());
381 return ((
float)$usec + (
float)$sec);
386 global $bearsamppRegistry;
389 $value = $bearsamppRegistry->getValue(
394 Log::debug(
'App reg key from registry: ' . $value);
399 $value .=
$bearsamppBins->getApache()->getSymlinkPath() .
'/bin;';
405 $value .=
$bearsamppBins->getPhp()->getSymlinkPath() .
'/imagick;';
410 if ($bearsamppTools->getComposer()->isEnable()) {
411 $value .= $bearsamppTools->getComposer()->getSymlinkPath() .
';';
412 $value .= $bearsamppTools->getComposer()->getSymlinkPath() .
'/vendor/bin;';
414 if ($bearsamppTools->getGhostscript()->isEnable()) {
415 $value .= $bearsamppTools->getGhostscript()->getSymlinkPath() .
'/bin;';
417 if ($bearsamppTools->getGit()->isEnable()) {
418 $value .= $bearsamppTools->getGit()->getSymlinkPath() .
'/bin;';
420 if ($bearsamppTools->getNgrok()->isEnable()) {
421 $value .= $bearsamppTools->getNgrok()->getSymlinkPath() .
';';
423 if ($bearsamppTools->getPerl()->isEnable()) {
424 $value .= $bearsamppTools->getPerl()->getSymlinkPath() .
'/perl/site/bin;';
425 $value .= $bearsamppTools->getPerl()->getSymlinkPath() .
'/perl/bin;';
426 $value .= $bearsamppTools->getPerl()->getSymlinkPath() .
'/c/bin;';
428 if ($bearsamppTools->getPython()->isEnable()) {
429 $value .= $bearsamppTools->getPython()->getSymlinkPath() .
'/bin;';
431 if ($bearsamppTools->getRuby()->isEnable()) {
432 $value .= $bearsamppTools->getRuby()->getSymlinkPath() .
'/bin;';
435 Log::debug(
'Generated app bins reg key: ' . $value);
450 global $bearsamppRegistry;
452 return $bearsamppRegistry->setStringValue(
467 global $bearsamppRegistry;
469 return $bearsamppRegistry->getValue(
485 global $bearsamppRegistry;
487 return $bearsamppRegistry->setStringValue(
502 global $bearsamppRegistry;
504 return $bearsamppRegistry->getValue(
520 global $bearsamppRegistry;
522 return $bearsamppRegistry->setExpandStringValue(
537 global $bearsamppRegistry;
539 return $bearsamppRegistry->getValue(
554 return $startupPath ? $startupPath .
'/' .
APP_TITLE .
'.lnk' :
false;
565 return $lnk ? file_exists($lnk) :
false;
578 if (!$shortcutPath) {
600 if (file_exists($startupLnkPath)) {
601 return @unlink($startupLnkPath);
615 if (is_dir(
'C:\Windows\System32\WindowsPowerShell')) {
616 return self::findFile(
'C:\Windows\System32\WindowsPowerShell',
'powershell.exe');
632 public static function findRepos($initPath, $startPath, $checkFile, $maxDepth = 1)
634 $depth = substr_count(str_replace($initPath,
'', $startPath),
'/');
637 $handle = @opendir($startPath);
642 while (
false !== ($file = readdir($handle))) {
643 if ($file ==
'.' || $file ==
'..') {
646 if (is_dir($startPath .
'/' . $file) && ($initPath == $startPath || $depth <= $maxDepth)) {
647 $tmpResults =
self::findRepos($initPath, $startPath .
'/' . $file, $checkFile, $maxDepth);
648 foreach ($tmpResults as $tmpResult) {
651 } elseif (is_file($startPath .
'/' . $checkFile) && !in_array($startPath,
$result)) {
670 $type = pathinfo($path, PATHINFO_EXTENSION);
671 $data = file_get_contents($path);
673 return 'data:image/' . $type .
';base64,' . base64_encode($data);
686 if ($direction ===
'to_utf8') {
702 return iconv(
'UTF-8',
'WINDOWS-1252//IGNORE', $data);
714 return iconv(
'WINDOWS-1252',
'UTF-8//IGNORE', $data);
746 foreach ($pids as $pid) {
766 $statusFile =
$bearsamppCore->getTmpPath() .
'/loading_status.txt';
767 file_put_contents($statusFile, json_encode([
'text' => $text]));
777 $statusFile =
$bearsamppCore->getTmpPath() .
'/loading_status.txt';
778 if (file_exists($statusFile)) {
779 @unlink($statusFile);
793 public static function getFilesToScan($path =
null, $useCache =
true, $forceRefresh =
false)
796 $cacheKey = md5(serialize($path));
799 if ($useCache && !$forceRefresh) {
801 if ($cachedResult !==
false) {
802 self::$fileScanStats[
'hits']++;
803 Log::debug(
'File scan cache HIT (saved expensive scan operation)');
804 return $cachedResult;
808 self::$fileScanStats[
'misses']++;
809 Log::debug(
'File scan cache MISS (performing full scan)');
816 foreach ($pathsToScan as $pathToScan) {
818 $findFiles =
self::findFiles($pathToScan[
'path'], $pathToScan[
'includes'], $pathToScan[
'recursive']);
819 foreach ($findFiles as $findFile) {
822 Log::debug($pathToScan[
'path'] .
' scanned in ' . round(self::getMicrotime() - $pathStartTime, 3) .
's');
825 $totalTime = round(self::getMicrotime() - $startTime, 3);
826 Log::info(
'Full file scan completed in ' . $totalTime .
's (' . count(
$result) .
' files found)');
849 if (self::$fileScanCache !==
null && isset(self::$fileScanCache[$cacheKey])) {
850 $cache = self::$fileScanCache[$cacheKey];
853 if (time() - $cache[
'timestamp'] < self::$fileScanCacheDuration) {
854 return $cache[
'data'];
856 self::$fileScanStats[
'invalidations']++;
857 unset(self::$fileScanCache[$cacheKey]);
866 $cacheFile =
$bearsamppRoot->getTmpPath() .
'/filescan_cache_' . $cacheKey .
'.dat';
868 if (file_exists($cacheFile)) {
869 $fileContents = @file_get_contents($cacheFile);
871 if ($fileContents ===
false) {
876 if (!self::verifyCacheIntegrity($fileContents, $cacheKey)) {
877 Log::warning(
'File scan cache integrity check failed for key: ' . $cacheKey .
'. Possible tampering detected.');
882 $cacheData = @unserialize($fileContents);
884 if ($cacheData !==
false && isset($cacheData[
'timestamp']) && isset($cacheData[
'data']) && isset($cacheData[
'hmac'])) {
886 if (time() - $cacheData[
'timestamp'] < self::$fileScanCacheDuration) {
888 if (self::$fileScanCache ===
null) {
889 self::$fileScanCache = [];
891 self::$fileScanCache[$cacheKey] = $cacheData;
893 return $cacheData[
'data'];
896 self::$fileScanStats[
'invalidations']++;
901 Log::warning(
'Invalid cache structure detected for key: ' . $cacheKey);
925 'timestamp' => time(),
931 if (self::$fileScanCache ===
null) {
932 self::$fileScanCache = [];
934 self::$fileScanCache[$cacheKey] = $cacheData;
938 $cacheFile =
$bearsamppRoot->getTmpPath() .
'/filescan_cache_' . $cacheKey .
'.dat';
939 @file_put_contents($cacheFile, serialize($cacheData), LOCK_EX);
940 Log::debug(
'File scan results cached to: ' . $cacheFile);
952 if (self::$cacheIntegrityKey ===
null) {
959 if (file_exists($keyFile)) {
960 $key = @file_get_contents($keyFile);
961 if ($key !==
false && strlen($key) === 64) {
962 self::$cacheIntegrityKey = $key;
963 return self::$cacheIntegrityKey;
969 self::$cacheIntegrityKey = bin2hex(random_bytes(32));
970 @file_put_contents($keyFile, self::$cacheIntegrityKey, LOCK_EX);
971 }
catch (Exception $e) {
972 Log::error(
'Failed to generate cache integrity key: ' . $e->getMessage());
974 self::$cacheIntegrityKey = hash(
'sha256', uniqid(
'bearsampp_cache_',
true));
979 self::$cacheIntegrityKey = bin2hex(random_bytes(32));
980 }
catch (Exception $e) {
981 self::$cacheIntegrityKey = hash(
'sha256', uniqid(
'bearsampp_cache_',
true));
986 return self::$cacheIntegrityKey;
1000 $message = serialize($data) . $cacheKey;
1001 return hash_hmac(
'sha256', $message, $key);
1014 $cacheData = @unserialize($fileContents);
1016 if ($cacheData ===
false || !isset($cacheData[
'hmac']) || !isset($cacheData[
'data'])) {
1023 return hash_equals($expectedHmac, $cacheData[
'hmac']);
1036 self::$fileScanCache =
null;
1041 $cacheFiles = glob($tmpPath .
'/filescan_cache_*.dat');
1043 if ($cacheFiles !==
false) {
1044 foreach ($cacheFiles as $cacheFile) {
1045 @unlink($cacheFile);
1047 Log::info(
'Cleared ' . count($cacheFiles) .
' file scan cache files');
1052 self::$fileScanStats = [
1055 'invalidations' => 0
1066 return self::$fileScanStats;
1078 if ($seconds > 0 && $seconds <= 86400) {
1079 self::$fileScanCacheDuration = $seconds;
1080 Log::debug(
'File scan cache duration set to ' . $seconds .
' seconds');
1091 return self::$fileScanCacheDuration;
1126 'includes' => array(
''),
1127 'recursive' =>
false
1133 'includes' => array(
''),
1134 'recursive' =>
false
1140 'includes' => array(
'openssl.cfg'),
1141 'recursive' =>
false
1147 'includes' => array(
'alias.conf'),
1148 'recursive' =>
false
1153 foreach ($folderList as $folder) {
1155 'path' =>
$bearsamppBins->getApache()->getRootPath() .
'/' . $folder,
1156 'includes' => array(
'.ini',
'.conf'),
1163 foreach ($folderList as $folder) {
1165 'path' =>
$bearsamppBins->getPhp()->getRootPath() .
'/' . $folder,
1166 'includes' => array(
'.php',
'.bat',
'.ini',
'.reg',
'.inc'),
1173 foreach ($folderList as $folder) {
1175 'path' =>
$bearsamppBins->getMysql()->getRootPath() .
'/' . $folder,
1176 'includes' => array(
'my.ini'),
1177 'recursive' =>
false
1183 foreach ($folderList as $folder) {
1185 'path' =>
$bearsamppBins->getMariadb()->getRootPath() .
'/' . $folder,
1186 'includes' => array(
'my.ini'),
1187 'recursive' =>
false
1190 $dataPath =
$bearsamppBins->getMariadb()->getRootPath() .
'/' . $folder .
'/data';
1191 if (is_dir($dataPath)) {
1193 'path' => $dataPath,
1194 'includes' => array(
'my.ini'),
1195 'recursive' =>
false
1202 foreach ($folderList as $folder) {
1204 'path' =>
$bearsamppBins->getPostgresql()->getRootPath() .
'/' . $folder,
1205 'includes' => array(
'.conf',
'.bat',
'.ber'),
1212 foreach ($folderList as $folder) {
1214 'path' =>
$bearsamppBins->getNodejs()->getRootPath() .
'/' . $folder .
'/etc',
1215 'includes' => array(
'npmrc'),
1219 'path' =>
$bearsamppBins->getNodejs()->getRootPath() .
'/' . $folder .
'/node_modules/npm',
1220 'includes' => array(
'npmrc'),
1221 'recursive' =>
false
1227 foreach ($folderList as $folder) {
1229 'path' => $bearsamppTools->getComposer()->getRootPath() .
'/' . $folder,
1230 'includes' => array(
'giscus.json'),
1231 'recursive' =>
false
1237 foreach ($folderList as $folder) {
1239 'path' => $bearsamppTools->getPowerShell()->getRootPath() .
'/' . $folder,
1240 'includes' => array(
'console.xml',
'.ini',
'.btm'),
1247 foreach ($folderList as $folder) {
1249 'path' => $bearsamppTools->getPython()->getRootPath() .
'/' . $folder .
'/bin',
1250 'includes' => array(
'.bat'),
1251 'recursive' =>
false
1254 'path' => $bearsamppTools->getPython()->getRootPath() .
'/' . $folder .
'/settings',
1255 'includes' => array(
'winpython.ini'),
1256 'recursive' =>
false
1262 foreach ($folderList as $folder) {
1264 'path' => $bearsamppTools->getRuby()->getRootPath() .
'/' . $folder .
'/bin',
1265 'includes' => array(
'!.dll',
'!.exe'),
1266 'recursive' =>
false
1282 private static function findFiles($startPath, $includes = array(
''), $recursive =
true)
1286 $handle = @opendir($startPath);
1291 while (
false !== ($file = readdir($handle))) {
1292 if ($file ==
'.' || $file ==
'..') {
1295 if (is_dir($startPath .
'/' . $file) && $recursive) {
1297 foreach ($tmpResults as $tmpResult) {
1300 } elseif (is_file($startPath .
'/' . $file)) {
1301 foreach ($includes as $include) {
1303 $include = ltrim($include,
'!');
1306 } elseif ($file != $include) {
1329 public static function changePath($filesToScan, $rootPath =
null)
1334 'countChangedOcc' => 0,
1335 'countChangedFiles' => 0
1338 $rootPath = $rootPath !=
null ? $rootPath :
$bearsamppRoot->getRootPath();
1344 foreach ($filesToScan as $fileToScan) {
1345 $tmpCountChangedOcc = 0;
1346 $fileContentOr = file_get_contents($fileToScan);
1347 $fileContent = $fileContentOr;
1350 preg_match(
'#' . $unixOldPath .
'#i', $fileContent, $unixMatches);
1351 if (!empty($unixMatches)) {
1352 $fileContent = str_replace($unixOldPath, $unixCurrentPath, $fileContent, $countChanged);
1353 $tmpCountChangedOcc += $countChanged;
1355 preg_match(
'#' . str_replace(
'\\',
'\\\\', $windowsOldPath) .
'#i', $fileContent, $windowsMatches);
1356 if (!empty($windowsMatches)) {
1357 $fileContent = str_replace($windowsOldPath, $windowsCurrentPath, $fileContent, $countChanged);
1358 $tmpCountChangedOcc += $countChanged;
1363 if (!empty($unixMatches)) {
1365 $tmpCountChangedOcc += $countChanged;
1368 if (!empty($windowsMatches)) {
1370 $tmpCountChangedOcc += $countChanged;
1373 if ($fileContentOr != $fileContent) {
1374 $result[
'countChangedOcc'] += $tmpCountChangedOcc;
1375 $result[
'countChangedFiles'] += 1;
1376 file_put_contents($fileToScan, $fileContent);
1380 Log::debug(
'changePath() completed: ' .
$result[
'countChangedFiles'] .
' files changed, ' .
$result[
'countChangedOcc'] .
' total occurrences');
1396 if (empty($responseData)) {
1397 Log::error(
'Cannot retrieve latest github info: empty result or error');
1402 $resultArray = json_decode($responseData,
true);
1404 if (isset($resultArray[
'tag_name']) && isset($resultArray[
'assets'][0][
'browser_download_url'])) {
1405 $tagName = $resultArray[
'tag_name'];
1406 $downloadUrl = $resultArray[
'assets'][0][
'browser_download_url'];
1407 $name = $resultArray[
'name'];
1408 Log::debug(
'Latest version tag name: ' . $tagName);
1412 return [
'version' => $tagName,
'html_url' => $downloadUrl,
'name' => $name];
1414 Log::error(
'Tag name, download URL, or name not found in the response');
1428 public static function getWebsiteUrl($path =
'', $fragment =
'', $utmSource =
true)
1433 if (!empty($path)) {
1434 $url .=
'/' . ltrim($path,
'/');
1437 $url = rtrim($url,
'/') .
'/?utm_source=bearsampp-' .
$bearsamppCore->getAppVersion();
1439 if (!empty($fragment)) {
1483 $data = get_headers($url,
true);
1484 if (isset($data[
'Content-Length'])) {
1485 $size = intval($data[
'Content-Length']);
1501 if ((!$unit && $size >= 1 << 30) || $unit ==
'GB') {
1502 return number_format($size / (1 << 30), 2) .
'GB';
1504 if ((!$unit && $size >= 1 << 20) || $unit ==
'MB') {
1505 return number_format($size / (1 << 20), 2) .
'MB';
1507 if ((!$unit && $size >= 1 << 10) || $unit ==
'KB') {
1508 return number_format($size / (1 << 10), 2) .
'KB';
1511 return number_format($size) .
' bytes';
1542 $context = stream_context_create(array(
1544 'verify_peer' =>
true,
1545 'verify_peer_name' =>
true,
1546 'allow_self_signed' =>
false,
1550 $fp = @stream_socket_client(($ssl ?
'ssl://' :
'') . $host .
':' .
$port, $errno, $errstr, 5, STREAM_CLIENT_CONNECT, $context);
1553 $result = explode(PHP_EOL, $out);
1558 $rebuildResult = array();
1562 $rebuildResult[] = $row;
1568 foreach (
$result as $header) {
1587 if (isset(
$result[
'error'])) {
1604 $localIP =
'127.0.0.1';
1607 $errorReporting = error_reporting();
1612 $connection = @fsockopen($localIP,
$port);
1615 error_reporting($errorReporting);
1617 if (is_resource($connection)) {
1618 fclose($connection);
1621 return $process !=
null ? $process :
'N/A';
1638 $isValidSyntax = filter_var($domainName, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME);
1640 return $isValidSyntax;
1657 if (method_exists($bin,
'initData')) {
1661 $name = $bin->getName();
1662 $service = $bin->getService();
1666 if ($isPortInUse ===
false) {
1667 if (!$service->isInstalled()) {
1669 if ($service->start()) {
1670 Log::info(sprintf(
'%s service successfully installed. (name: %s ; port: %s)', $name, $service->getName(),
$port));
1672 $bearsamppWinbinder->messageBoxInfo(
1681 $serviceErrorLog = sprintf(
'Error during the installation of %s service', $name);
1682 if (!empty($syntaxCheckCmd)) {
1683 $cmdSyntaxCheck = $bin->getCmdLineOutput($syntaxCheckCmd);
1684 if (!$cmdSyntaxCheck[
'syntaxOk']) {
1686 $serviceErrorLog .= sprintf(
' (conf errors detected : %s)', $cmdSyntaxCheck[
'content']);
1691 $bearsamppWinbinder->messageBoxError($serviceError, $boxTitle);
1695 Log::warning(sprintf(
'%s service already installed', $name));
1697 $bearsamppWinbinder->messageBoxWarning(
1705 } elseif ($service->isRunning()) {
1706 Log::warning(sprintf(
'%s service already installed and running', $name));
1708 $bearsamppWinbinder->messageBoxWarning(
1716 Log::error(sprintf(
'Port %s is used by an other application : %s',
$port, $isPortInUse));
1718 $bearsamppWinbinder->messageBoxError(
1739 Log::error(
'$service not an instance of Win32Service');
1744 if ($service->isInstalled()) {
1745 if ($service->delete()) {
1746 Log::info(sprintf(
'%s service successfully removed', $name));
1750 Log::error(sprintf(
'Error during the uninstallation of %s service', $name));
1755 Log::warning(sprintf(
'%s service does not exist', $name));
1770 public static function startService($bin, $syntaxCheckCmd, $showWindow =
false)
1774 if (method_exists($bin,
'initData')) {
1778 $name = $bin->getName();
1779 $service = $bin->getService();
1782 if (!$service->start()) {
1784 $serviceErrorLog = sprintf(
'Error while starting the %s service', $name);
1785 if (!empty($syntaxCheckCmd)) {
1786 $cmdSyntaxCheck = $bin->getCmdLineOutput($syntaxCheckCmd);
1787 if (!$cmdSyntaxCheck[
'syntaxOk']) {
1789 $serviceErrorLog .= sprintf(
' (conf errors detected : %s)', $cmdSyntaxCheck[
'content']);
1794 $bearsamppWinbinder->messageBoxError($serviceError, $boxTitle);
1814 if (empty($user) || !is_string($user)) {
1819 $user = rawurlencode($user);
1823 return "https://github.com/{$user}";
1826 if (empty($repo) || !is_string($repo)) {
1829 $repo = rawurlencode($repo);
1830 return "https://github.com/{$user}/{$repo}";
1833 if (empty($repo) || empty($branch) || empty($path) || !is_string($repo) || !is_string($branch) || !is_string($path)) {
1836 $repo = rawurlencode($repo);
1837 $branch = rawurlencode($branch);
1839 $path = ltrim($path,
'/');
1840 $segments = array_map(
'rawurlencode', explode(
'/', $path));
1841 $pathEncoded = implode(
'/', $segments);
1843 return "https://raw.githubusercontent.com/{$user}/{$repo}/{$branch}/{$pathEncoded}";
1871 $handle = @opendir($path);
1876 while (
false !== ($file = readdir($handle))) {
1877 $filePath = $path .
'/' . $file;
1878 if ($file !=
'.' && $file !=
'..' && is_dir($filePath) && $file !=
'current') {
1901 $tmpFile =
$bearsamppCore->getTmpPath() .
'/' . $caption .
'.txt';
1902 file_put_contents($tmpFile, $content);
1906 $bearsamppCore->getWinbinder()->exec($editor,
'"' . $tmpFile .
'"');
static getProcessUsingPort($port)
static shellExec(string $command)
const PATH_LIN_PLACEHOLDER
const PATH_WIN_PLACEHOLDER
static getApiJson($url, $headers=array())
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
static info($data, $file=null)
static debug($data, $file=null)
static warning($data, $file=null)
static trace($data, $file=null)
static error($data, $file=null)
const PROCESSOR_REG_SUBKEY
const PROCESSOR_REG_ENTRY
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($type='user', $user=APP_GITHUB_USER, $repo=null, $branch=null, $path=null)
static deleteFolder($path)
static getHeaders($host, $port, $ssl=false)
static removeService($service, $name)
static setFileScanCacheDuration($seconds)
static isValidPort($port)
static cp1252ToUtf8($data)
static setAppPathRegKey($value)
static imgToBase64($path)
static getVersionList($path)
static utf8ToCp1252($data)
static isValidDomainName($domainName)
static getLatestVersion($url)
static getFolderList($path)
static getAppBinsRegKey($fromRegistry=true)
static getAppPathRegKey()
static getGithubUserUrl()
static getChangelogUrl($utmSource=true)
static openFileContent($caption, $content)
static $cacheIntegrityKey
static getCacheIntegrityKey()
static getFileScanStats()
static getFileScanCacheDuration()
static humanFileSize($size, $unit='')
static clearLoadingText()
static $fileScanCacheDuration
static clearFileScanCache()
static changePath($filesToScan, $rootPath=null)
static getWebsiteUrl($path='', $fragment='', $utmSource=true)
static isPortInUse($port)
static generateCacheHMAC($data, $cacheKey)
static findFiles($startPath, $includes=array(''), $recursive=true)
static getFilesToScan($path=null, $useCache=true, $forceRefresh=false)
static replaceDefine($path, $var, $value)
static clearFolder($path, $exclude=array())
static convertEncoding($data, $direction='to_cp1252')
static setFileScanCache($cacheKey, $data)
static clearFolders($paths, $exclude=array())
static startService($bin, $syntaxCheckCmd, $showWindow=false)
static findFile($startPath, $findFile)
static getFileScanCache($cacheKey)
static updateLoadingText($text)
static enableLaunchStartup()
static getStartupLnkPath()
static setSysPathRegKey($value)
static replaceInFile($path, $replaceList)
static getSysPathRegKey()
static getPowerShellPath()
static getProcessorRegKey()
static setAppBinsRegKey($value)
static verifyCacheIntegrity($fileContents, $cacheKey)
static formatWindowsPath($path)
static formatUnixPath($path)
static contains($string, $search)
static startWith($string, $search)
static endWith($string, $search)
static createShortcut($shortcutPath, $targetPath, $workingDir='', $description='', $iconPath='')
static getSpecialFolderPath($folderName)