protected function populateCommonDocs(string $padding, string $commondocs) : string
    {
        $output = '';

        if (is_dir($commondocs)) {
            $h = opendir($commondocs);
            while ($dir = readdir($h)) {
                $folder = $commondocs . DIRECTORY_SEPARATOR . $dir;
                if ($dir !== '.' && $dir !== '..' && is_dir($folder)) {
                    $output .= "\n"
                            . $padding . "Alias /$dir \"$folder\"\n"
                            . $padding . "<Directory \"$folder\">\n"
                            . $padding . "        AllowOverride All\n"
                            . $padding . "        Require all granted\n"
                            . $padding . "</Directory>\n"
                        ;
                }
            }
            closedir($h);
        }

        return $output;
    }
protected function populateCommonDocs(string $padding, string $commondocs) : string
    {
        $output = '';

        if (is_dir($commondocs)) {
            $h = opendir($commondocs);
            while ($dir = readdir($h)) {
                $folder = $commondocs . DIRECTORY_SEPARATOR . $dir;
                if ($dir !== '.' && $dir !== '..' && is_dir($folder)) {
                    $output .= "\n"
                            . $padding . "Alias /$dir \"$folder\"\n"
                            . $padding . "<Directory \"$folder\">\n"
                            . $padding . "        AllowOverride All\n"
                            . $padding . "        Require all granted\n"
                            . $padding . "</Directory>\n"
                        ;
                }
            }
            closedir($h);
        }

        return $output;
    }
protected function populateCommonDocs ( string $ padding , string $ commondocs ) : string { $ output = '' ; if ( is_dir ( $ commondocs ) ) { $ h = opendir ( $ commondocs ) ; while ( $ dir = readdir ( $ h ) ) { $ folder = $ commondocs . DIRECTORY_SEPARATOR . $ dir ; if ( $ dir !== '.' && $ dir !== '..' && is_dir ( $ folder ) ) { $ output .= "\n" . $ padding . "Alias /$dir \"$folder\"\n" . $ padding . "<Directory \"$folder\">\n" . $ padding . "        AllowOverride All\n" . $ padding . "        Require all granted\n" . $ padding . "</Directory>\n" ; } } closedir ( $ h ) ; } return $ output ; }
Populates all subfolders in commondocs folder as Alias Apache primitives.
@param string $padding Padding before each line
@param string $commondocs Common Docs base path to be populated
@return string Returns a well formed string of Apache primitives with all aliases or an empty string if
the folder is empty.
Populates all subfolders in commondocs folder as Alias Apache primitives .