public function getVirtualHostsAsArray()
    {

        // prepare the array containing the virtual host configuration
        $virtualHosts = array();

        // iterate hosts
        /** @var \AppserverIo\Appserver\Core\Api\Node\VirtualHostNode $virtualHost */
        foreach ($this->getVirtualHosts() as $virtualHost) {
            // explode the virtual host names
            $virtualHostNames = explode(' ', $virtualHost->getName());

            // Some virtual hosts might have an extensionType to expand their name attribute, check for that
            if ($virtualHost->hasInjector()) {
                $virtualHostNames = array_merge($virtualHostNames, explode(' ', $virtualHost->getInjection()));
            }

            // prepare the virtual hosts
            foreach ($virtualHostNames as $virtualHostName) {
                // set all virtual hosts params per key for faster matching later on
                $virtualHosts[trim($virtualHostName)] = array(
                    'params' => $virtualHost->getParamsAsArray(),
                    'headers' => $virtualHost->getHeadersAsArray(),
                    'rewriteMaps' => $virtualHost->getRewriteMapsAsArray(),
                    'rewrites' => $virtualHost->getRewritesAsArray(),
                    'environmentVariables' => $virtualHost->getEnvironmentVariablesAsArray(),
                    'accesses' => $virtualHost->getAccessesAsArray(),
                    'locations' => $virtualHost->getLocationsAsArray(),
                    'authentications' => $virtualHost->getAuthenticationsAsArray(),
                    'analytics' => $virtualHost->getAnalyticsAsArray()
                );
            }
        }

        // return the virtual host configuration
        return $virtualHosts;
    }
public function getVirtualHostsAsArray()
    {

        // prepare the array containing the virtual host configuration
        $virtualHosts = array();

        // iterate hosts
        /** @var \AppserverIo\Appserver\Core\Api\Node\VirtualHostNode $virtualHost */
        foreach ($this->getVirtualHosts() as $virtualHost) {
            // explode the virtual host names
            $virtualHostNames = explode(' ', $virtualHost->getName());

            // Some virtual hosts might have an extensionType to expand their name attribute, check for that
            if ($virtualHost->hasInjector()) {
                $virtualHostNames = array_merge($virtualHostNames, explode(' ', $virtualHost->getInjection()));
            }

            // prepare the virtual hosts
            foreach ($virtualHostNames as $virtualHostName) {
                // set all virtual hosts params per key for faster matching later on
                $virtualHosts[trim($virtualHostName)] = array(
                    'params' => $virtualHost->getParamsAsArray(),
                    'headers' => $virtualHost->getHeadersAsArray(),
                    'rewriteMaps' => $virtualHost->getRewriteMapsAsArray(),
                    'rewrites' => $virtualHost->getRewritesAsArray(),
                    'environmentVariables' => $virtualHost->getEnvironmentVariablesAsArray(),
                    'accesses' => $virtualHost->getAccessesAsArray(),
                    'locations' => $virtualHost->getLocationsAsArray(),
                    'authentications' => $virtualHost->getAuthenticationsAsArray(),
                    'analytics' => $virtualHost->getAnalyticsAsArray()
                );
            }
        }

        // return the virtual host configuration
        return $virtualHosts;
    }
public function getVirtualHostsAsArray ( ) { // prepare the array containing the virtual host configuration $ virtualHosts = array ( ) ; // iterate hosts /** @var \AppserverIo\Appserver\Core\Api\Node\VirtualHostNode $virtualHost */ foreach ( $ this -> getVirtualHosts ( ) as $ virtualHost ) { // explode the virtual host names $ virtualHostNames = explode ( ' ' , $ virtualHost -> getName ( ) ) ; // Some virtual hosts might have an extensionType to expand their name attribute, check for that if ( $ virtualHost -> hasInjector ( ) ) { $ virtualHostNames = array_merge ( $ virtualHostNames , explode ( ' ' , $ virtualHost -> getInjection ( ) ) ) ; } // prepare the virtual hosts foreach ( $ virtualHostNames as $ virtualHostName ) { // set all virtual hosts params per key for faster matching later on $ virtualHosts [ trim ( $ virtualHostName ) ] = array ( 'params' => $ virtualHost -> getParamsAsArray ( ) , 'headers' => $ virtualHost -> getHeadersAsArray ( ) , 'rewriteMaps' => $ virtualHost -> getRewriteMapsAsArray ( ) , 'rewrites' => $ virtualHost -> getRewritesAsArray ( ) , 'environmentVariables' => $ virtualHost -> getEnvironmentVariablesAsArray ( ) , 'accesses' => $ virtualHost -> getAccessesAsArray ( ) , 'locations' => $ virtualHost -> getLocationsAsArray ( ) , 'authentications' => $ virtualHost -> getAuthenticationsAsArray ( ) , 'analytics' => $ virtualHost -> getAnalyticsAsArray ( ) ) ; } } // return the virtual host configuration return $ virtualHosts ; }
Returns the virtual hosts as an associative array

@return array The array with the sorted virtual hosts
Returns the virtual hosts as an associative array