403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /home/bitrix/ext_www/cvetdv.ru/bitrix/modules/acrit.cleanmaster/classes/general/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/cvetdv.ru/bitrix/modules/acrit.cleanmaster/classes/general/ccleanmodule.php
<?php

class CCleanModule extends TCleanMasterFunctions
{
	const MODULE_UPD_CACHE_PATH = "/bitrix/updates/";

	private $documentRoot;

	public function __construct()
	{
		$this->documentRoot = Bitrix\Main\Application::getDocumentRoot();
	}

	/**
	 * список всех имеющихся на диске модулей
	 * @return array
	 */
	public function getLocalModules($onlyMarketplace = false)
	{
		return $this->getUninstalledModules(false, false, false);
	}

	private function getUninstalledModules($onlyMarketplace = true, $onlyUninstalled = true, $getAgents = true)
	{
		$arModules = [];

		$folders = [
			"/local/modules",
			"/bitrix/modules",
		];
		foreach ($folders as $folder) {
			if (!is_dir($this->documentRoot . $folder)) {
				continue;
			}
			$handle = @opendir($this->documentRoot . $folder);
			if ($handle) {
				while (false !== ($dir = readdir($handle))) {
					if (
						!isset($arModules[$dir]) &&
						is_dir($this->documentRoot . $folder . "/" . $dir) &&
						$dir != "." && $dir != ".."
					) {
						if ($onlyMarketplace && strpos($dir, ".") === false) {
							continue;
						}
						$module_dir = $folder . "/" . $dir;
						ob_start();
						if ($info = CModule::CreateModuleObject($dir)) {
							if ($onlyUninstalled && $info->IsInstalled()) {
								continue;
							}
							$arModules[$dir]["IsInstalled"] = $info->IsInstalled();
							$arModules[$dir]["IsSystem"] = strpos($dir, ".") === false;
							$arModules[$dir]["DIR"] = $module_dir;
							if ($getAgents) {
								$arModules[$dir]['AGENTS'] = $this->GetModuleAgents($info->MODULE_ID);
							}
						}
						$ignore = ob_get_clean();
					}
				}
				closedir($handle);
			}
		}
		return $arModules;
	}

	public function ModulesDelete($deleteFiles = 'Y', $deleteFilesSys = 'N', $deleteAgents = 'Y')
	{
		$arModules = $this->getUninstalledModules($deleteFilesSys != 'Y');

		foreach ($arModules as $module_id => $value) {
			if ($deleteFiles == 'Y') {
				DeleteDirFilesEx($value['DIR']);
			}
			if ($deleteAgents == 'Y') {
				$this->DeleteModuleAgents($module_id);
			}
		}
	}

	/**
	 * Получаем данные для диагностики
	 *
	 * @param string $step
	 *
	 * @return bool
	 */
	public function GetDiagnosticData($step = false)
	{
		$arModules = $this->getUninstalledModules(false);

		foreach ($arModules as $module_id => $value) {
			$_SESSION['cleanmaster']['diagnostic']['module']['modules'][$module_id] = [
				'SIZE' => $this->GetDirSize($this->documentRoot . $value['DIR'] . '/'),
				'AGENTS' => count($value['AGENTS']),
				'IS_SYSTEM' => $value["IsSystem"]
			];
		}
		return false;
	}

	///////////////

	/**
	 * List of module's names
	 * @param bool $onlyMarketplace = true
	 * @return array
	 */
	public function getAllModules(bool $onlyMarketplace = true): array
	{
		$modules = $this->getUninstalledModules($onlyMarketplace, false, false);
		return array_keys($modules);
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit