AppserverIo\Appserver\Core\GenericDeployment::getDatasourceFiles PHP Method

getDatasourceFiles() protected method

Returns all datasource files we potentially use
protected getDatasourceFiles ( ) : array
return array
    protected function getDatasourceFiles()
    {
        // if we have a valid app base we will collect all datasources
        $datasourceFiles = array();
        if (is_dir($appBase = $this->getAppBase())) {
            // get all the global datasource files first
            $datasourceFiles = array_merge($datasourceFiles, $this->prepareDatasourceFiles($this->getDeploymentService()->globDir($appBase . DIRECTORY_SEPARATOR . '*-ds.xml', 0, false)));
            // iterate over all applications and collect the environment specific datasources
            foreach (glob($appBase . '/*', GLOB_ONLYDIR) as $webappPath) {
                // append the datasource files of the webapp
                $datasourceFiles = array_merge($datasourceFiles, $this->prepareDatasourceFiles($this->getDeploymentService()->globDir(AppEnvironmentHelper::getEnvironmentAwareGlobPattern($webappPath, '*-ds'))));
            }
        }
        // return the found datasource files
        return $datasourceFiles;
    }