public function get_rootpath() {
        global $CFG;
        $subdir = clean_param(trim($this->subdir, '/'), PARAM_PATH);
        $path = $CFG->dataroot . '/repository/' . $this->subdir . '/';
        if ((empty($this->subdir) && !is_numeric($this->subdir)) || $subdir != $this->subdir || !is_dir($path)) {
            throw new repository_exception('The instance is not properly configured, invalid path.');
        }
        return $path;
    }
public function get_rootpath() {
        global $CFG;
        $subdir = clean_param(trim($this->subdir, '/'), PARAM_PATH);
        $path = $CFG->dataroot . '/repository/' . $this->subdir . '/';
        if ((empty($this->subdir) && !is_numeric($this->subdir)) || $subdir != $this->subdir || !is_dir($path)) {
            throw new repository_exception('The instance is not properly configured, invalid path.');
        }
        return $path;
    }
public function get_rootpath ( ) { global $ CFG ; $ subdir = clean_param ( trim ( $ this -> subdir , '/' ) , PARAM_PATH ) ; $ path = $ CFG -> dataroot . '/repository/' . $ this -> subdir . '/' ; if ( ( empty ( $ this -> subdir ) && ! is_numeric ( $ this -> subdir ) ) || $ subdir != $ this -> subdir || ! is_dir ( $ path ) ) { throw new repository_exception ( 'The instance is not properly configured, invalid path.' ) ; } return $ path ; }
Return the rootpath of this repository instance.

Trim() is a necessary step to ensure that the subdirectory is not '/'.

@return string path
@throws repository_exception If the subdir is unsafe, or invalid.
Return the rootpath of this repository instance .