roundcubemail/program/lib/Roundcube/rcube_config.php
public function resolve_paths($file, $use_env = true)
    {
        $files    = array();
        $abs_path = rcube_utils::is_absolute_path($file);

        foreach ($this->paths as $basepath) {
            $realpath = $abs_path ? $file : realpath($basepath . '/' . $file);

            // check if <file>-env.ini exists
            if ($realpath && $use_env && !empty($this->env)) {
                $envfile = preg_replace('/\.(inc.php)$/', '-' . $this->env . '.\\1', $realpath);
                if (is_file($envfile)) {
                    $realpath = $envfile;
                }
            }

            if ($realpath) {
                $files[] = $realpath;

                // no need to continue the loop if an absolute file path is given
                if ($abs_path) {
                    break;
                }
            }
        }

        return $files;
    }
public function resolve_paths($file, $use_env = true)
    {
        $files    = array();
        $abs_path = rcube_utils::is_absolute_path($file);

        foreach ($this->paths as $basepath) {
            $realpath = $abs_path ? $file : realpath($basepath . '/' . $file);

            // check if <file>-env.ini exists
            if ($realpath && $use_env && !empty($this->env)) {
                $envfile = preg_replace('/\.(inc.php)$/', '-' . $this->env . '.\\1', $realpath);
                if (is_file($envfile)) {
                    $realpath = $envfile;
                }
            }

            if ($realpath) {
                $files[] = $realpath;

                // no need to continue the loop if an absolute file path is given
                if ($abs_path) {
                    break;
                }
            }
        }

        return $files;
    }
public function resolve_paths ( $ file , $ use_env = true ) { $ files = array ( ) ; $ abs_path = rcube_utils :: is_absolute_path ( $ file ) ; foreach ( $ this -> paths as $ basepath ) { $ realpath = $ abs_path ? $ file : realpath ( $ basepath . '/' . $ file ) ; // check if <file>-env.ini exists if ( $ realpath && $ use_env && ! empty ( $ this -> env ) ) { $ envfile = preg_replace ( '/\.(inc.php)$/' , '-' . $ this -> env . '.\\1' , $ realpath ) ; if ( is_file ( $ envfile ) ) { $ realpath = $ envfile ; } } if ( $ realpath ) { $ files [ ] = $ realpath ; // no need to continue the loop if an absolute file path is given if ( $ abs_path ) { break ; } } } return $ files ; }
Helper method to resolve absolute paths to the given config file.
This also takes the 'env' property into account.

@param string  $file    Filename or absolute file path
@param boolean $use_env Return -$env file path if exists

@return array List of candidates in config dir path(s)
Helper method to resolve absolute paths to the given config file . This also takes the env property into account .