Define the list of coreSystem to init and/or run.

@return string[]
179783
protected function obtainAppSystemList(): array
    {
        $appSystemNS = '\BFW\Core\AppSystems\\';
        
        return [
            'options'        => $appSystemNS.'Options',
            'constants'      => $appSystemNS.'Constants',
            'composerLoader' => $appSystemNS.'ComposerLoader',
            'subjectList'    => $appSystemNS.'SubjectList',
            'config'         => $appSystemNS.'Config',
            'monolog'        => $appSystemNS.'Monolog',
            'request'        => $appSystemNS.'Request',
            'session'        => $appSystemNS.'Session',
            'errors'         => $appSystemNS.'Errors',
            'memcached'      => $appSystemNS.'Memcached',
            'moduleList'     => $appSystemNS.'ModuleList',
            'ctrlRouterLink' => $appSystemNS.'CtrlRouterLink'
        ];
    }
1236513
public static function get_runnable() {
		$packages = [];
		$packages[] = 'project';
		foreach (\Skeleton\Core\Skeleton::get_all() as $package) {
			$packages[] = $package->name;
		}
		$migrations = [];
		foreach ($packages as $package) {
			$migrations[$package] = \Skeleton\Database\Migration::get_between_versions($package, self::get_version($package), null);
		}

		$sorted_migrations = [];

		foreach ($migrations as $package_migrations) {
			foreach ($package_migrations as $migration) {
				$sorted_migrations[$migration->get_version()->format('YmdHis')] = $migration;
			}
		}
		ksort($sorted_migrations);

		return $sorted_migrations;
	}
899416
static function stateList()
    {
        $stateList =& $GLOBALS['eZPackageStateList'];
        if ( !isset( $stateList ) )
        {
            $stateList = array();
            $ini = eZINI::instance( 'package.ini' );
            $states = $ini->variable( 'PackageSettings', 'StateList' );
            foreach ( $states as $stateID => $stateName )
            {
                $stateList[] = array( 'name' => $stateName,
                                      'id' => $stateID);
            }
        }
        return $stateList;
    }
1361696
public function core() {
        $key = isset($this->params['key']) ? $this->params['key'] : null;
        $config = isset($this->params['config']) ? $this->params['config'] : 'default';

        if ($key) {
            $this->out(sprintf('Clearing %s in %s...', $key, $config));
            Cache::delete($key, $config);

        } else {
            $this->out(sprintf('Clearing all in %s...', $config));
            Cache::clear(false, $config);
        }

        $this->out('<info>Cache cleared!</info>');
    }
1219776
private function listOfKnownCpuArchitectures()
    {
        $arc = array_merge($this->listOfCpuArchitecturesX86(), $this->listOfCpuArchitecturesX64());
        ksort($arc);
        return $arc;
    }
454301
public function findAll()
    {
        $datasourceNodes = array();
        foreach ($this->getSystemConfiguration()->getDatasources() as $datasourceNode) {
            $datasourceNodes[$datasourceNode->getPrimaryKey()] = $datasourceNode;
        }

        return $datasourceNodes;
    }
520194
public static function getContainerStates()
    {
        return array(
            ContainerStateKeys::HALT,
            ContainerStateKeys::WAITING_FOR_INITIALIZATION,
            ContainerStateKeys::INITIALIZATION_SUCCESSFUL,
            ContainerStateKeys::DEPLOYMENT_SUCCESSFUL,
            ContainerStateKeys::SERVERS_STARTED_SUCCESSFUL,
            ContainerStateKeys::SHUTDOWN
        );
    }
1331059
public function standardFeatures(): array
    {
        return [
            'stdout.ansi' => function () {
                // @codeCoverageIgnoreStart
                if (DIRECTORY_SEPARATOR === '\\') {
                    return
                        0 >= version_compare(
                        '10.0.10586',
                        PHP_WINDOWS_VERSION_MAJOR .
                            '.' . PHP_WINDOWS_VERSION_MINOR .
                            '.' . PHP_WINDOWS_VERSION_BUILD
                        ) ||
                        false !== getenv('ANSICON') ||
                        'ON' === getenv('ConEmuANSI') ||
                        'xterm' === getenv('TERM') ||
                        false !== getenv('BABUN_HOME');
                }
                // @codeCoverageIgnoreEnd

                return function_exists('posix_isatty') && @posix_isatty(STDOUT);
            },

            'type.object' => function () {
                try {
                    $function =
                        new ReflectionFunction(function (object $a) {});
                    $parameters = $function->getParameters();
                    $result = null === $parameters[0]->getClass();
                    // @codeCoverageIgnoreStart
                } catch (ReflectionException $e) {
                    $result = false;
                }
                // @codeCoverageIgnoreEnd

                return $result;
            },
        ];
    }
718678
private function getInitializers(): array
    {
        if (empty($this->sortedInitializers)) {
            $this->sortedInitializers = $this->sortInitializers();
        }

        return $this->sortedInitializers;
    }
145282
public function middleware(): array
    {
        return [
            PhpEnvironment::class,
            EmitResponse::class,
            HandleExceptions::class,
            ReadConfigIni::class,
            UseDatabase::class,
            UseDebugbar::class,
            UpdateDatabaseSchema::class,
            UseCache::class,
            UseFilesystem::class,
            UseSession::class,
            UseTree::class,
            UseLocale::class,
            CheckForMaintenanceMode::class,
            UseTheme::class,
            DoHousekeeping::class,
            CheckCsrf::class,
            UseTransaction::class,
            BootModules::class,
            ModuleMiddleware::class,
            RequestRouter::class,
            NoRouteFound::class,
        ];
    }
773177
public function getMissingCoreModules()
    {
        $modules = array();

        foreach ($this->coreModules as $module) {
            if (!$this->isLoadedModule($module)) {
                array_push($modules, $module);
            }
        }

        return $modules;
    }
1209388
public function getServices()
    {

        // Time?
        if (!empty($this->settings['timer'])) {
            $t = new Timer('Services');
        }

        // We allowed?
        if (empty($this->settings['show']['services']) || !is_array($this->settings['services']) || count($this->settings['services']) == 0) {
            return [];
        }

        // Temporarily keep statuses here
        $statuses = [];

        $this->settings['services']['executables'] = (array) $this->settings['services']['executables'];
        $this->settings['services']['pidFiles'] = (array) $this->settings['services']['pidFiles'];

        // Convert paths of executables to PID files
        $pids = [];
        $do_process_search = false;
        if (count($this->settings['services']['executables']) > 0) {
            $potential_paths = @glob('/proc/*/cmdline');
            if (is_array($potential_paths)) {
                $num_paths = count($potential_paths);
                $do_process_search = true;
            }
        }

        // Should we go ahead and do the PID search based on executables?
        if ($do_process_search) {
            // Precache all process cmdlines
            for ($i = 0; $i < $num_paths; ++$i) {
                $cmdline_cache[$i] = explode("\x00", Common::getContents($potential_paths[$i]));
            }

            // Go through the list of executables to search for
            foreach ($this->settings['services']['executables'] as $service => $exec) {
                // Go through pid file list. for loops are faster than foreach
                for ($i = 0; $i < $num_paths; ++$i) {
                    $cmdline = $cmdline_cache[$i];
                    $match = false;
                    if (is_array($exec)) {
                        $match = true;
                        foreach ($exec as $argn => $argv) {
                            if (isset($cmdline[$argn]) && $cmdline[$argn] != $argv) {
                                $match = false;
                            }
                        }
                    } elseif ($cmdline[0] == $exec) {
                        $match = true;
                    }
                    // If this one matches, stop here and save it
                    if ($match) {
                        // Get pid out of path to cmdline file
                        $pids[$service] = substr($potential_paths[$i], 6 /*strlen('/proc/')*/,
                                                strpos($potential_paths[$i], '/', 7) - 6);
                        break;
                    }
                }
            }
        }

        // PID files
        foreach ($this->settings['services']['pidFiles'] as $service => $file) {
            $pid = Common::getContents($file, false);
            if ($pid != false && is_numeric($pid)) {
                $pids[$service] = $pid;
            }
        }

        // Deal with PIDs
        foreach ($pids as $service => $pid) {
            $path = '/proc/'.$pid.'/status';
            $status_contents = Common::getContents($path, false);
            if ($status_contents == false) {
                $statuses[$service] = array('state' => 'Down', 'threads' => 'N/A', 'pid' => $pid);
                continue;
            }

            // Attempt getting info out of it
            if (!preg_match_all('/^(\w+):\s+(\w+)/m', $status_contents, $status_matches, PREG_SET_ORDER)) {
                continue;
            }

            // Initially set these as pointless
            $state = false;
            $threads = false;
            $mem = false;

            // Go through
            for ($i = 0, $num = count($status_matches); $i < $num; ++$i) {

                // What have we here?
                switch ($status_matches[$i][1]) {

                    // State section
                    case 'State':
                        switch ($status_matches[$i][2]) {
                            case 'D': // blocked on disk IO
                            case 'S':
                                $state = 'Up (Sleeping)';
                            break;
                            case 'Z':
                                $state = 'Zombie';
                            break;
                            // running
                            case 'R':
                                $state = 'Up (Running)';
                            break;
                            // stopped
                            case 'T':
                                $state = 'Up (Stopped)';
                            break;
                        }
                    break;

                    // Mem usage
                    case 'VmRSS':
                        if (is_numeric($status_matches[$i][2])) {
                            $mem = $status_matches[$i][2] * 1024;
                        } // Measured in kilobytes; we want bytes
                    break;

                    // Thread count
                    case 'Threads':
                        if (is_numeric($status_matches[$i][2])) {
                            $threads = $status_matches[$i][2];
                        }

                        // Thread count should be last. Stop here to possibly save time assuming we have the other values
                        if ($state !== false && $mem !== false && $threads !== false) {
                            break;
                        }
                    break;
                }
            }

            // Save info
            $statuses[$service] = array(
                'state' => $state ? $state : '?',
                'threads' => $threads,
                'pid' => $pid,
                'memory_usage' => $mem,
            );
        }

        return $statuses;
    }
742998
public function getExecTasks(): array
    {
        $data = [];
        $runTimeTableTasks = $this->getRunTimeTable()->table;
        if (\count($runTimeTableTasks) <= 0) {
            return $data;
        }

        $min = date('YmdHi');

        foreach ($runTimeTableTasks as $key => $value) {
            if ($value['minute'] == $min) {
                if (time() == $value['sec'] && $value['runStatus'] == self::NORMAL) {
                    $data[] = [
                        'key'        => $key,
                        'taskClass'  => $value['taskClass'],
                        'taskMethod' => $value['taskMethod'],
                    ];
                }
            }
        }

        foreach ($data as $item) {
            $this->startTask($item['key']);
        }

        return $data;
    }
1083368
public function initActionGet() : array
    {
        $rem = $this->di->get("remserver");
        $rem->init();
        $json = [
            "message" => "The session is initiated with the default dataset(s).",
            "dataset" => $rem->getDefaultDataset(),
        ];
        return [$json];
    }
950221
public function getSettings() : array
    {
        $cmd = new ListSettings($this->repo->getRoot());
        $res = $this->runner->run($cmd, new ListSettings\MapSettings());

        return $res->getFormattedOutput();
    }
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',
            ],
        ];
    }
442591
public static function getKernelClasses()
    {
        $classes = [];
        //
        $namespace = "Vinala\Kernel\Console\Commands";
        //
        foreach (get_declared_classes() as $value) {
            if (\Strings::contains($value, $namespace)) {
                $classes[] = $value;
            }
        }

        return $classes;
    }