public static function makePath( $validate = true, $forceCreate = false )
    {
        $_arguments = func_get_args();
        $_validate = $_path = null;

        foreach ( $_arguments as $_part )
        {
            if ( is_bool( $_part ) )
            {
                $_validate = $_part;
                continue;
            }

            $_path .= DIRECTORY_SEPARATOR . trim( $_part, DIRECTORY_SEPARATOR . ' ' );
        }

        if ( !is_dir( $_path = realpath( $_path ) ) )
        {
            if ( $_validate && !$forceCreate )
            {
                return false;
            }

            if ( $forceCreate )
            {
                if ( false === @mkdir( $_path, 0, true ) )
                {
                    throw new UtilityException( 'The result path "' . $_path . '" could not be created.' );
                }
            }
        }

        return $_path;
    }
public static function makePath( $validate = true, $forceCreate = false )
    {
        $_arguments = func_get_args();
        $_validate = $_path = null;

        foreach ( $_arguments as $_part )
        {
            if ( is_bool( $_part ) )
            {
                $_validate = $_part;
                continue;
            }

            $_path .= DIRECTORY_SEPARATOR . trim( $_part, DIRECTORY_SEPARATOR . ' ' );
        }

        if ( !is_dir( $_path = realpath( $_path ) ) )
        {
            if ( $_validate && !$forceCreate )
            {
                return false;
            }

            if ( $forceCreate )
            {
                if ( false === @mkdir( $_path, 0, true ) )
                {
                    throw new UtilityException( 'The result path "' . $_path . '" could not be created.' );
                }
            }
        }

        return $_path;
    }
public static function makePath ( $ validate = true , $ forceCreate = false ) { $ _arguments = func_get_args ( ) ; $ _validate = $ _path = null ; foreach ( $ _arguments as $ _part ) { if ( is_bool ( $ _part ) ) { $ _validate = $ _part ; continue ; } $ _path .= DIRECTORY_SEPARATOR . trim ( $ _part , DIRECTORY_SEPARATOR . ' ' ) ; } if ( ! is_dir ( $ _path = realpath ( $ _path ) ) ) { if ( $ _validate && ! $ forceCreate ) { return false ; } if ( $ forceCreate ) { if ( false === @ mkdir ( $ _path , 0 , true ) ) { throw new UtilityException ( 'The result path "' . $ _path . '" could not be created.' ) ; } } } return $ _path ; }
Builds a path from arguments and validates existence.

@param bool $validate    If true, will check path with is_dir.
@param bool $forceCreate If true, and result path doesn't exist, it will be created

@throws UtilityException
@return bool|null|string
Builds a path from arguments and validates existence .