2024.8.23
Loading...
Searching...
No Matches
ActionCheckPort Class Reference

Public Member Functions

 __construct ($args)
 

Detailed Description

Class ActionCheckPort

This class is responsible for checking the port status of various services (Apache, MySQL, MariaDB, PostgreSQL, Filezilla, Mailhog, Mailpit, Memcached, Xlight) based on the provided arguments.

Definition at line 16 of file class.action.checkPort.php.

Constructor & Destructor Documentation

◆ __construct()

ActionCheckPort::__construct ( $args)

Constructor for ActionCheckPort.

Parameters
array$argsAn array of arguments where:
  • $args[0] is the name of the service (e.g., Apache, MySQL).
  • $args[1] is the port number to check.
  • $args[2] (optional) indicates if SSL should be used.

@global object $bearsamppBins Global object containing instances of various services.

Definition at line 28 of file class.action.checkPort.php.

29 {
30 global $bearsamppBins;
31
32 // Check if the required arguments are provided and not empty
33 if ( isset( $args[0] ) && !empty( $args[0] ) && isset( $args[1] ) && !empty( $args[1] ) ) {
34 // Determine if SSL is to be used
35 $ssl = isset( $args[2] ) && !empty( $args[2] );
36
37 // Check the port for the specified service
38 if ( $args[0] == $bearsamppBins->getApache()->getName() ) {
39 $bearsamppBins->getApache()->checkPort( $args[1], $ssl, true );
40 }
41 elseif ( $args[0] == $bearsamppBins->getMysql()->getName() ) {
42 $bearsamppBins->getMysql()->checkPort( $args[1], true );
43 }
44 elseif ( $args[0] == $bearsamppBins->getMariadb()->getName() ) {
45 $bearsamppBins->getMariadb()->checkPort( $args[1], true );
46 }
47 elseif ( $args[0] == $bearsamppBins->getPostgresql()->getName() ) {
48 $bearsamppBins->getPostgresql()->checkPort( $args[1], true );
49 }
50 elseif ( $args[0] == $bearsamppBins->getFilezilla()->getName() ) {
51 $bearsamppBins->getFilezilla()->checkPort( $args[1], $ssl, true );
52 }
53 elseif ( $args[0] == $bearsamppBins->getMailhog()->getName() ) {
54 $bearsamppBins->getMailhog()->checkPort( $args[1], true );
55 }
56 elseif ( $args[0] == $bearsamppBins->getMailpit()->getName() ) {
57 $bearsamppBins->getMailpit()->checkPort( $args[1], true );
58 }
59 elseif ( $args[0] == $bearsamppBins->getMemcached()->getName() ) {
60 $bearsamppBins->getMemcached()->checkPort( $args[1], true );
61 }
62 elseif ( $args[0] == $bearsamppBins->getXlight()->getName() ) {
63 $bearsamppBins->getXlight()->checkPort( $args[1], true );
64 }
65 }
66 }
global $bearsamppBins

References $bearsamppBins.


The documentation for this class was generated from the following file: