Returns list of core subsystems.
@return array
964048
protected static function fetch_subsystems() {
        global $CFG;

        // NOTE: Any additions here must be verified to not collide with existing add-on modules and subplugins!!!

        $info = array(
            'access'      => null,
            'admin'       => $CFG->dirroot.'/'.$CFG->admin,
            'analytics'   => $CFG->dirroot . '/analytics',
            'antivirus'   => $CFG->dirroot . '/lib/antivirus',
            'auth'        => $CFG->dirroot.'/auth',
            'availability' => $CFG->dirroot . '/availability',
            'backup'      => $CFG->dirroot.'/backup/util/ui',
            'badges'      => $CFG->dirroot.'/badges',
            'block'       => $CFG->dirroot.'/blocks',
            'blog'        => $CFG->dirroot.'/blog',
            'bulkusers'   => null,
            'cache'       => $CFG->dirroot.'/cache',
            'calendar'    => $CFG->dirroot.'/calendar',
            'cohort'      => $CFG->dirroot.'/cohort',
            'comment'     => $CFG->dirroot.'/comment',
            'competency'  => $CFG->dirroot.'/competency',
            'completion'  => $CFG->dirroot.'/completion',
            'countries'   => null,
            'course'      => $CFG->dirroot.'/course',
            'currencies'  => null,
            'customfield' => $CFG->dirroot.'/customfield',
            'dbtransfer'  => null,
            'debug'       => null,
            'editor'      => $CFG->dirroot.'/lib/editor',
            'edufields'   => null,
            'enrol'       => $CFG->dirroot.'/enrol',
            'error'       => null,
            'favourites'  => $CFG->dirroot . '/favourites',
            'filepicker'  => null,
            'fileconverter' => $CFG->dirroot.'/files/converter',
            'files'       => $CFG->dirroot.'/files',
            'filters'     => $CFG->dirroot.'/filter',
            //'fonts'       => null, // Bogus.
            'form'        => $CFG->dirroot.'/lib/form',
            'grades'      => $CFG->dirroot.'/grade',
            'grading'     => $CFG->dirroot.'/grade/grading',
            'group'       => $CFG->dirroot.'/group',
            'help'        => null,
            'hub'         => null,
            'imscc'       => null,
            'install'     => null,
            'iso6392'     => null,
            'langconfig'  => null,
            'license'     => null,
            'mathslib'    => null,
            'media'       => $CFG->dirroot.'/media',
            'message'     => $CFG->dirroot.'/message',
            'mimetypes'   => null,
            'mnet'        => $CFG->dirroot.'/mnet',
            //'moodle.org'  => null, // Not used any more.
            'my'          => $CFG->dirroot.'/my',
            'notes'       => $CFG->dirroot.'/notes',
            'pagetype'    => null,
            'pix'         => null,
            'plagiarism'  => $CFG->dirroot.'/plagiarism',
            'plugin'      => null,
            'portfolio'   => $CFG->dirroot.'/portfolio',
            'privacy'     => $CFG->dirroot . '/privacy',
            'question'    => $CFG->dirroot.'/question',
            'rating'      => $CFG->dirroot.'/rating',
            'repository'  => $CFG->dirroot.'/repository',
            'rss'         => $CFG->dirroot.'/rss',
            'role'        => $CFG->dirroot.'/'.$CFG->admin.'/roles',
            'search'      => $CFG->dirroot.'/search',
            'table'       => null,
            'tag'         => $CFG->dirroot.'/tag',
            'timezones'   => null,
            'user'        => $CFG->dirroot.'/user',
            'userkey'     => $CFG->dirroot.'/lib/userkey',
            'webservice'  => $CFG->dirroot.'/webservice',
        );

        return $info;
    }
1248441
public function findBundleClasses(): array
    {
        /** @var string[][] $bundleSets */
        $bundleSets = [];

        $modules = $this->packageRepository->findModules();
        foreach ($modules as $module) {
            $extra = $module->getExtra();
            $this->validateBundlesSectionInExtra($extra);
            if (empty($extra['phplist/core']['bundles'])) {
                continue;
            }

            $bundleSets[$module->getName()] = $extra['phplist/core']['bundles'];
        }

        return $bundleSets;
    }
844148
public function getMainComponents() {
    $base_path = $this->getBaseComponentPath();

    $filter = function (Extension $module) use ($base_path) {
      return dirname($module->getPath()) == $base_path;
    };

    return array_filter($this->getAll(), $filter);
  }
834223
public function getSubCatList()
    {
        if ($this->_oSubCatList === null) {
            $this->_oSubCatList = [];
            if ($this->hasVisibleSubCats()) {
                return $this->_oSubCatList;
            }
        }

        return $this->_oSubCatList;
    }
891784
public function getParentsList()
    {
        /** @var static $root */
        $root  = static::root();
        $items = [
            ['id' => '1', 'title' => 'Item Root'],
        ];
        $nodes = $root->descendants();
        if ($this->exists) {
            $nodes->where('navigation_id', $this->navigation_id)->where('id', '<>', $this->id);
        }

        foreach ($nodes->get() as $node) {
            foreach ($node->getDescendantsAndSelf()->toHierarchy() as $menu) {
                $this->appendMenu($menu, $items);
            }
        }

        return array_pluck($items, 'title', 'id');
    }
840232
public function getThirdPartyModules()
    {
        $coreModulesByName = $this->getCoreModulesByName();

        $thirdPartyModules = $this->all()->reject(
            function ($module) use ($coreModulesByName) {
                return array_key_exists($module->getLowerName(), $coreModulesByName->toArray());
            });

        return $thirdPartyModules->all();
    }
533515
public function findGeneralConfiguration(): array
    {
        /** @var array[] $configurationSets */
        $configurationSets = [[]];

        $modules = $this->packageRepository->findModules();
        foreach ($modules as $module) {
            $extra = $module->getExtra();
            $this->validateGeneralConfigurationSectionInExtra($extra);
            if (!isset($extra['phplist/core']['configuration'])) {
                continue;
            }

            $configurationSets[] = $extra['phplist/core']['configuration'];
        }

        return /** @scrutinizer ignore-call */ array_replace_recursive(...$configurationSets);
    }
1222883
public static function getSubscribedEvents()
    {
        return array(
            InstallerEvents::POST_DEPENDENCIES_SOLVING => array(
                array('checkCoreDependencies', 0)
            ),
            PackageEvents::POST_PACKAGE_INSTALL => array(
                array('installCore', 0)
            ),
            PackageEvents::PRE_PACKAGE_UPDATE => array(
                array('uninstallCore', 0)
            ),
            PackageEvents::POST_PACKAGE_UPDATE => array(
                array('installCore', 0)
            ),
            PackageEvents::PRE_PACKAGE_UNINSTALL => array(
                array('uninstallCore', 0)
            ),
        );
    }
1130524
public function getCoreModules()
    {
        $coreModulesByName = $this->getCoreModulesByName();

        $coreModules = $this->all()->filter(
            function ($module) use ($coreModulesByName) {
                return array_key_exists($module->getLowerName(), $coreModulesByName->toArray());
            });

        return $coreModules->all();
    }
893197
public function getSubs()
    {
        
        $r = self::getDbConnection()->query('
        	SELECT A.*, B.level 
        	FROM dir_data A, dir_structure B, dir_structure C
        	WHERE A.id=B.data_id and C.data_id='.$this->id.' and B.lft BETWEEN C.lft and C.rght');
        	
		$result = [];
			
        while ($f = $r->fetch()) {
            $c = Catalog::fetch($f);
            $result[] = $c->prototype->id;
        }
                    
        return $result;
    }
681762
protected function getComponents()
    {
        // Get user name
        $user = $this->localStorage->get('notifier.name');
        if (!$user) {
            $user = $this->command->ask('Who is deploying ?') ?: 'Someone';
            $this->localStorage->set('notifier.name', $user);
        }

        // Get what was deployed
        $repository = $this->credentials->getCurrentRepository();
        $connection = $this->connections->getCurrentConnectionKey();

        return [
            'user' => $user,
            'branch' => $repository->branch,
            'handle' => $connection->toHandle(),
            'host' => $connection->host,
            'repository' => $repository->getName(),
        ];
    }
1194898
public function getDocSubPackages()
    {
        $package = self::DOC_SUB_PACKAGE_STRUCTS;
        if ($this->isRestriction()) {
            $package = self::DOC_SUB_PACKAGE_ENUMERATIONS;
        } elseif ($this->isArray()) {
            $package = self::DOC_SUB_PACKAGE_ARRAYS;
        }
        return [
            $package,
        ];
    }
831609
private function getCpu(): array
	{
		$result = [];
		$cpuInfo = $this->readFile('/proc/cpuinfo');
		if ($cpuInfo) {
			$processors = preg_split('/\s?\n\s?\n/', trim($cpuInfo));
			$procname = null;
			foreach ($processors as $processor) {
				$cpu = new Obj;
				$proc = null;
				$arch = null;
				$details = preg_split("/\n/", $processor, -1, PREG_SPLIT_NO_EMPTY);
				foreach ($details as $detail) {
					$arrBuff = preg_split('/\s*:\s*/', trim($detail));
					if (count($arrBuff) == 2) {
						switch (strtolower($arrBuff[0])) {
							case 'processor':
								$proc = trim($arrBuff[1]);
								if (is_numeric($proc)) {
									if ($procname !== null && strlen($procname) > 0) {
										$cpu->model = $procname;
									}
								} else {
									$procname = $proc;
									$cpu->model = $procname;
								}
								break;
							case 'model name':
							case 'cpu model':
							case 'cpu type':
							case 'cpu':
								$cpu->model = $arrBuff[1];
								break;
							case 'cpu mhz':
							case 'clock':
								if ($arrBuff[1] > 0) { //openSUSE fix
									$cpu->speed = $arrBuff[1] * 1000 * 1000;
								}
								break;
							case 'cycle frequency [hz]':
								$cpu->speed = $arrBuff[1] * 1000 * 1000;
								break;
							case 'cpu0clktck':
								$cpu->speed = hexdec($arrBuff[1] * 1000 * 1000);
								break;
							case 'l2 cache':
							case 'cache size':
								$cpu->cache = ((float) preg_replace("/[a-zA-Z]/", "", $arrBuff[1])) * 1024;
								break;
							case 'initial bogomips':
							case 'bogomips':
							case 'cpu0bogo':
								$cpu->bogomips = $arrBuff[1];
								break;
							case 'i size':
							case 'd size':
								if ($cpu->cache === null) {
									$cpu->cache = $arrBuff[1] * 1024;
								} else {
									$cpu->cache = $cpu->cache + ($arrBuff[1] * 1024);
								}
								break;
							case 'cpu architecture':
								$arch = trim($arrBuff[1]);
								break;
						}
					}
				}

				// sparc64 specific code follows
				// This adds the ability to display the cache that a CPU has
				// Originally made by Sven Blumenstein <bazik@gentoo.org> in 2004
				// Modified by Tom Weustink <freshy98@gmx.net> in 2004
				$sparclist = array('SUNW,UltraSPARC@0,0', 'SUNW,UltraSPARC-II@0,0', 'SUNW,UltraSPARC@1c,0', 'SUNW,UltraSPARC-IIi@1c,0', 'SUNW,UltraSPARC-II@1c,0', 'SUNW,UltraSPARC-IIe@0,0');
				foreach ($sparclist as $name) {
					$str = $this->readFile('/proc/openprom/' . $name . '/ecache-size');
					if ($str) {
						$cpu->cache = base_convert($str, 16, 10);
					}
				}

				// sparc64 specific code ends
				// XScale detection code
				if (($arch === "5TE") && ($cpu->bogomips != null)) {
					$cpu->speed = $cpu->bogomips; //BogoMIPS are not BogoMIPS on this CPU, it's the speed
					$cpu->bogomips = null; // no BogoMIPS available, unset previously set BogoMIPS
				}

				if ($proc != null) {
					if (!is_numeric($proc)) {
						$proc = 0;
					}
					// variable speed processors specific code follows
					if ($str = $this->readFile('/sys/devices/system/cpu/cpu' . $proc . '/cpufreq/cpuinfo_cur_freq')) {
						$cpu->speed = ((float) $str) * 1000;
					} elseif ($str = $this->readFile('/sys/devices/system/cpu/cpu' . $proc . '/cpufreq/scaling_cur_freq')) {
						$cpu->speed = ((float) $str) * 1000;
					}
					if ($str = $this->readFile('/sys/devices/system/cpu/cpu' . $proc . '/cpufreq/cpuinfo_max_freq')) {
						$cpu->speedMax = ((float) $str) * 1000;
					}
					if ($str = $this->readFile('/sys/devices/system/cpu/cpu' . $proc . '/cpufreq/cpuinfo_min_freq')) {
						$cpu->speedMin = ((float) $str) * 1000;
					}
					if ($str = $this->readFile('/proc/acpi/thermal_zone/THRM/temperature')) {
						$cpu->temperature = substr($str, 25, 2);
					}
				}

				$cpu->usage = null;
				$result[] = $cpu;
			}


			// CPU usage
			$command = "grep 'cpu' /proc/stat";
			$cpuStats1 = $this->readCommandAsArray($command, "\n");
			sleep(1);
			$cpuStats2 = $this->readCommandAsArray($command, "\n");

			$counter = 0;
			for ($i = 0; $i < count($cpuStats1); $i++) {
				if (preg_match('/cpu[0-9]{1,2}/', $cpuStats1[$i]) > 0) {
					$stats1 = explode(' ', $cpuStats1[$i]);
					$stats2 = explode(' ', $cpuStats2[$i]);

					$prevIdle = $stats1[4] + $stats1[5];
					$idle = $stats2[4] + $stats2[5];
					$prevNonIdle = $stats1[1] + $stats1[2] + $stats1[3] + $stats1[6] + $stats1[7] + $stats1[8];
					$nonIdle = $stats2[1] + $stats2[2] + $stats2[3] + $stats2[6] + $stats2[7] + $stats2[8];
					$prevTotal = $prevIdle + $prevNonIdle;
					$total = $idle + $nonIdle;

					$result[$counter++]->usage = (float) (($total - $prevTotal) - ($idle - $prevIdle)) / ($total - $prevTotal) * 100;
				}
			}
		}
		return $result;
	}
111811
protected function getSubTypes()
    {
        $subTypes = [];

        foreach ($this->types as $type) {
            if (substr($type,-2) === '[]') {
                $subTypes[] = substr($type, 0, -2);
            }
        }

        return $subTypes;
    }
1026210
protected function getComponents()
    {
        if ($this->_components === null) {
            if ($this->_string === null) {
                return [];
            }
            $this->_components = $this->parseUri($this->_string);
        }
        return $this->_components;
    }
1232024
public function coreComponents() {
        return [
            'naming' => [
                'class' => '\cza\base\components\utils\Naming',
            ],
            'password' => [
                'class' => '\cza\base\components\utils\Password',
            ],
            'folderOrganizer' => [
                'class' => '\cza\base\components\utils\FolderOrganizer',
                'uploadTempPath' => isset(Yii::$app->params['config']['upload']['tempPath']) ? Yii::$app->params['config']['upload']['tempPath'] : '@app/web/uploads/temp',
                'uploadStorePath' => isset(Yii::$app->params['config']['upload']['storePath']) ? Yii::$app->params['config']['upload']['storePath'] : '@app/web/uploads/store',
            ],
            'wechatHelper' => [
                'class' => '\cza\base\components\utils\WechatHelper',
            ],
            'simpleHTMLDOM' => [
                'class' => '\cza\base\vendor\utils\SimpleHTMLDOM\SimpleHTMLDOM',
            ],
        ];
    }
698197
public function getAll()
    {
        $result = [
            self::ENTRY_ID           => $this->_id,
            self::ENTRY_NAME         => $this->_name,
            self::ENTRY_WAIT_SYNC    => $this->_waitForSync,
            self::ENTRY_JOURNAL_SIZE => $this->_journalSize,
            self::ENTRY_IS_SYSTEM    => $this->_isSystem,
            self::ENTRY_IS_VOLATILE  => $this->_isVolatile,
            self::ENTRY_TYPE         => $this->_type,
            self::ENTRY_STATUS       => $this->_status,
            self::ENTRY_KEY_OPTIONS  => $this->_keyOptions
        ];

        if (null !== $this->_numberOfShards) {
            $result[self::ENTRY_NUMBER_OF_SHARDS] = $this->_numberOfShards;
        }
        
        if (null !== $this->_replicationFactor) {
            $result[self::ENTRY_REPLICATION_FACTOR] = $this->_replicationFactor;
        }
        
        if (null !== $this->_shardingStrategy) {
            $result[self::ENTRY_SHARDING_STRATEGY] = $this->_shardingStrategy;
        }

        if (is_array($this->_shardKeys)) {
            $result[self::ENTRY_SHARD_KEYS] = $this->_shardKeys;
        }

        return $result;
    }