public function getDir($directory)
    {
        $directory = str_replace('/', DS, $directory);
        if (strpos($directory, $this->getBaseDir()) === false || !file_exists($directory)) {
            $directory = $this->getBaseDir() . DS . ltrim($directory, DS);
        }
        return $directory;
    }
public function getDir($directory)
    {
        $directory = str_replace('/', DS, $directory);
        if (strpos($directory, $this->getBaseDir()) === false || !file_exists($directory)) {
            $directory = $this->getBaseDir() . DS . ltrim($directory, DS);
        }
        return $directory;
    }
public function getDir ( $ directory ) { $ directory = str_replace ( '/' , DS , $ directory ) ; if ( strpos ( $ directory , $ this -> getBaseDir ( ) ) === false || ! file_exists ( $ directory ) ) { $ directory = $ this -> getBaseDir ( ) . DS . ltrim ( $ directory , DS ) ; } return $ directory ; }
Return dir based on the base dir.

@param string $directory

@return string
Return dir based on the base dir .