func detectConfFiles(dir string) ([]string, error) {
	var confFilesPaths []string
	confFiles, err := common.GetFilesByExt(dir, []string{confExt})
	if err != nil {
		logrus.Debugf("Could not find conf files %s", err)
		return confFilesPaths, err
	}
	for _, confFilePath := range confFiles {
		confFile, err := os.Open(confFilePath)
		if err != nil {
			logrus.Debugf("Could not open the conf file: %s", err)
			confFile.Close()
			continue
		}
		defer confFile.Close()
		_, err = gopache.Parse(confFile)
		if err != nil {
			logrus.Debugf("Error while parsing conf file : %s", err)
			continue
		}
		confFileRelPath, err := filepath.Rel(dir, confFilePath)
		if err != nil {
			logrus.Errorf("Unable to resolve apache config file path %s as rel path : %s", confFilePath, err)
			continue
		}
		confFilesPaths = append(confFilesPaths, confFileRelPath)
	}
	return confFilesPaths, nil
}
detectConfFiles detects if conf files are present or not
package dockerfile
import (
	"fmt"
	"os"
	"path/filepath"
	"strconv"
	"strings"
	gopache "github.com/Akash-Nayak/GopacheConfig"
	"github.com/konveyor/move2kube/common"
	"github.com/konveyor/move2kube/environment"
	"github.com/konveyor/move2kube/qaengine"
	"github.com/konveyor/move2kube/types/qaengine/commonqa"
	transformertypes "github.com/konveyor/move2kube/types/transformer"
	"github.com/konveyor/move2kube/types/transformer/artifacts"
	"github.com/sirupsen/logrus"
)
const (
	phpExt      = ".php"
	virtualHost = "VirtualHost"
	confExt     = ".conf"
)
type PHPDockerfileGenerator struct {
	Config transformertypes.Transformer
	Env    *environment.Environment
}
type PhpTemplateConfig struct {
	ConfFile     string
	ConfFilePort int32
}
func (t *PHPDockerfileGenerator) Init(tc transformertypes.Transformer, env *environment.Environment) (err error) {
	t.Config = tc
	t.Env = env
	return nil
}
func (t *PHPDockerfileGenerator) GetConfig() (transformertypes.Transformer, *environment.Environment) {
	return t.Config, t.Env
}
func (t *PHPDockerfileGenerator) BaseDirectoryDetect(dir string) (namedServices map[string]transformertypes.ServicePlan, unnamedServices []transformertypes.TransformerPlan, err error) {
	return nil, nil, nil
}
func parseConfFile(confFilePath string) (int32, error) {
	var port int32
	confFile, err := os.Open(confFilePath)
	if err != nil {
		logrus.Errorf("Could not open the apache config file: %s", err)
		return port, err
	}
	defer confFile.Close()
	root, err := gopache.Parse(confFile)
	if err != nil {
		logrus.Errorf("Error while parsing apache config file : %s", err)
		return port, err
	}
	match, err := root.FindOne(virtualHost)
	if err != nil {
		logrus.Debugf("Could not find the VirtualHost in apache config file: %s", err)
		return port, err
	}
	tokens := strings.Split(match.Content, ":")
	if len(tokens) > 1 {
		detectedPort, err := strconv.ParseInt(tokens[1], 10, 32)
		if err != nil {
			logrus.Errorf("Error while converting the port from string to int : %s", err)
			return port, err
		}
		return int32(detectedPort), nil
	}
	return port, err
}