Get required ports based on services.

@return array
An array of unique ports required by defined services.
8210
public function requiredPorts()
    {
        $ports = [];

        foreach ($this->getServiceInstances() as $info) {
            if (!isset($info['instance'])) {
                continue;
            }
            $instance = $info['instance'];

            if ($instance instanceof ServiceInterface) {
                $ports = array_merge($ports, $instance->getHostPorts());
            }
        }
        $ports = array_unique($ports);

        return array_values($ports);
    }
222188
public function getPort(): ? int
    {
        if ( $this->port === null ) {
            return self::DEFAULT_PORTS[$this->scheme ?? ''] ?? null;
        }

        return $this->port;
    }
1053811
public static function getHttpTransports()
	{
		$names = array();
		$iterator = new \DirectoryIterator(__DIR__ . '/Transport');

		/*  @var  $file  \DirectoryIterator */
		foreach ($iterator as $file)
		{
			$fileName = $file->getFilename();

			// Only load for php files.
			if ($file->isFile() && $file->getExtension() == 'php')
			{
				$names[] = substr($fileName, 0, strrpos($fileName, '.'));
			}
		}

		return $names;
	}
857299
static function getConnections() {
		foreach (self::$parameters as $name => $params) {
			self::connect($name);
		}
		return self::$connections;
	}
590006
protected function getServiceByArgs($args) {
		$args = $this->normalizeArgs($args);
		$id   = $this->getIdByArgs($args);
		$args = $this->processArgs($args);
			
		if (! isset($this->servicesByArgs[$id])) {
			$this->servicesByArgs[$id] = $this->initService($args);
		}

		return $this->servicesByArgs[$id];
	}
1172404
public function getAll() {
        $system = array();

        $system['contact'] = $this->contact();
        $system['description'] = $this->description();
        $system['location'] = $this->location();
        $system['name'] = $this->name();
        //$system['services'] = $this->services();
        $system['uptime'] = $this->uptime();

        return $system;
    }
1293113
public function getPort()
    {
        if ($this->_port === null) {
            $this->_port = !$this->isSecureConnection() && isset($_SERVER['SERVER_PORT']) ? (int)$_SERVER['SERVER_PORT'] : 80;
        }
        return $this->_port;
    }
635487
public function getStatisticsServices():array
    {

        $services = $this->getAllServices();
        $counter = 0;
        $senable = 0;

        foreach ($services as $val) {
            if ($val->status == "enabled") {
                $senable++;
            }

            $counter++;
        }

        return (array("number" => $counter, "enabled" => $senable));
    }
897026
public function getPort()
    {
        if ($this->isSlave() && ! $this->port) {
            return $this->_master->getPort();
        }
        return $this->port;
    }
1248460
protected function getMissingEntities()
    {
        $modes = $this->getAllModes();
        $entrySubtypes = $this->getEntrySubtypes();
        
        $classes = array();
        foreach ($entrySubtypes as $service => $subtypes) {
            foreach ($modes as $mode) {
                foreach ($subtypes as $subtype) {
                    $classes[] = sprintf(
                        self::MODE_PATTERN,
                        $service,
                        $mode,
                        $service . $subtype . $mode
                    );
                }
            }
        }
        
        return $this->getMissingClasses($classes);
    }
42279
public function getServices()
    {
        $this->container = parent::getServices();
        $this->container['db'] = function ($c) {
            $db = new Db();
            $db->setCredentials($this->getDbConfig());
            $type = 'mysqli';
            if(class_exists('Pdo')) {
                $type = 'pdo';
            }
            
            $db->setAccessType($type);
            return $db;
        };
        
        $this->container['encrypt'] = function ($c) {
            $encrypt = new Encrypt();
            $new_key = $c['platform']->getEncryptionKey();
            $encrypt->setKey($new_key);
            return $encrypt;
        };
        
        $this->container['lang'] = function ($c) {
            $lang = new Language();
            if (is_array($this->getLangPath())) {
                foreach ($this->getLangPath() as $path) {
                    $lang->init($path);
                }
            } elseif ($this->getLangPath() != '') {
                $lang->init($this->getLangPath());
            }
            return $lang;
        };
        
        $this->container['validate'] = function ($c) {
            $validate = new Validate();
            $validate->setRegex($this->container['regex']);
            return $validate;
        };
        
        $this->container['files'] = function ($c) {
            $file = new Files();
            return $file;
        };
        
        $this->container['errors'] = function ($c) {
            $errors = new Errors();
            $errors->setValidation($c['validate']);
            return $errors;
        };
        
        $this->container['license'] = function ($c) {
            $license = new License();
            return $license;
        };
        
        $this->container['email'] = function ($c) {
            
            $email = new Email();
            $email->setView($c['view']);
            $email->setLang($c['lang']);
            return $email;
        };
        
        $this->container['view'] = function ($c) {
            $view = new View();
            $helpers = array(
                'file_size' => function ($text) {
                    return $this->container['view_helpers']->m62FileSize($text, false);
                },
                'lang' => function ($text) {
                    return $this->container['view_helpers']->m62Lang($text);
                },
                'date_time' => function ($text, $html = true) {
                    return $this->container['view_helpers']->m62DateTime($text, false);
                },
                'relative_time' => function ($date) {
                    return $this->container['view_helpers']->m62RelativeDateTime($date);
                },
                'encode' => function ($text) {
                    return $this->container['view_helpers']->m62Encode($text);
                },
                'decode' => function ($text) {
                    return $this->container['view_helpers']->m62Decode($text);
                }
            );
            
            $view->addHelper('m62', $helpers);
            return $view;
        };
        
        $this->container['regex'] = function ($c) {
            $regex = new Regex();
            return $regex;
        };
        
        $this->container['shell'] = function ($c) {
            $shell = new Shell();
            return $shell;
        };
        
        $this->container['console'] = function ($c) {
            $console = new Console();
            $console->setLang($c['lang']);
            return $console;
        };
        
        return $this->container;
    }
891331
protected function _getServices($services)
    {
        if ($services) {
            foreach ($services as $index => $service) {
                if (!$this->_di->has($service)) {
                    if ($this->_di->has($service . 'Mongodb')) {
                        $services[$index] = $service . 'Mongodb';
                    } elseif ($this->_di->has($service . '_mongodb')) {
                        $services[$index] = $service . '_mongodb';
                    } else {
                        $this->console->warn(['`:service` service is not exists: ignoring', 'service' => $service]);
                        unset($services[$index]);
                    }
                }
            }
        } else {
            $services = [];
            foreach ($this->configure->components as $service => $config) {
                $config = json_encode($config, JSON_UNESCAPED_SLASHES);
                if (preg_match('#mongodb://#', $config)) {
                    $services[] = $service;
                }
            }
        }

        return $services;
    }
252704
protected function getWebsocketConnections(): array
    {
        return array_filter(iterator_to_array($this->server->connections), function ($fd) {
            return $this->server->isEstablished($fd);
        });
    }
1076007
public function getAllServices():\stdClass
    {
        $file = JL::open(FEnv::get("framework.config.core.services.file"));
        foreach ($file as $one => $value) {
            $value->edit_save = $this->generateRoute(
                "iumio_manager_services_manager_edit_save_service",
                array("servicename" => $one),
                null,
                true
            );

            $value->edit = $this->generateRoute(
                "iumio_manager_services_manager_edit",
                array("servicename" => $one),
                null,
                true
            );

            $value->remove = $this->generateRoute(
                "iumio_manager_services_manager_remove_service",
                array("servicename" => $one),
                null,
                true
            );
        }
        return ($file);
    }
335719
public function getPort()
    {
        $port = parent::getPort();

        if (JUri::getInstance()->isSsl() || ($this->isSecure() && in_array($port, ['80', '8080']))) {
            $port = '443';
        }

        return $port;
    }
1283265
public function getRequired() : array {
        $required = [];

        foreach($this->required as $component) {
            $required[$component] = $this->getTargetBranch($component);
        }

        return $required;
    }
960680
public function getPort()
    {
        return $this->port === null || $this->isDefaultPort($this->scheme, $this->port) ? null : $this->port;
    }