protected function realpath($folder)
    {
        $separator = (string) DIRECTORY_SEPARATOR;

        $search = array('\\', '/', (string) '\\\\');

        $path = str_replace($search, $separator, $folder);

        file_exists($path) || mkdir((string) $path);

        $exists = in_array(substr($path, -1), $search);

        return $exists ? $path : $path . $separator;
    }
protected function realpath($folder)
    {
        $separator = (string) DIRECTORY_SEPARATOR;

        $search = array('\\', '/', (string) '\\\\');

        $path = str_replace($search, $separator, $folder);

        file_exists($path) || mkdir((string) $path);

        $exists = in_array(substr($path, -1), $search);

        return $exists ? $path : $path . $separator;
    }
protected function realpath ( $ folder ) { $ separator = ( string ) DIRECTORY_SEPARATOR ; $ search = array ( '\\' , '/' , ( string ) '\\\\' ) ; $ path = str_replace ( $ search , $ separator , $ folder ) ; file_exists ( $ path ) || mkdir ( ( string ) $ path ) ; $ exists = in_array ( substr ( $ path , - 1 ) , $ search ) ; return $ exists ? $ path : $ path . $ separator ; }
Replaces the slashes with the DIRECTORY_SEPARATOR.
Also creates the directory if it doesn't exists.

@param  string $folder
@return string
Replaces the slashes with the DIRECTORY_SEPARATOR . Also creates the directory if it doesn t exists .