public static function realiseDirectory($path, $mode = 0755, $silent = true)
    {
        if (is_dir($path)) {
            return true;
        }

        try {
            $current_umask = umask(0);
            $success = @mkdir($path, intval($mode, 8), true);
            umask($current_umask);

            return $success;
        } catch (Exception $ex) {
            if ($silent === false) {
                throw new Exception(__('Unable to create path - %s', array($path)));
            }

            return false;
        }
    }
public static function realiseDirectory($path, $mode = 0755, $silent = true)
    {
        if (is_dir($path)) {
            return true;
        }

        try {
            $current_umask = umask(0);
            $success = @mkdir($path, intval($mode, 8), true);
            umask($current_umask);

            return $success;
        } catch (Exception $ex) {
            if ($silent === false) {
                throw new Exception(__('Unable to create path - %s', array($path)));
            }

            return false;
        }
    }
public static function realiseDirectory ( $ path , $ mode = 0755 , $ silent = true ) { if ( is_dir ( $ path ) ) { return true ; } try { $ current_umask = umask ( 0 ) ; $ success = @ mkdir ( $ path , intval ( $ mode , 8 ) , true ) ; umask ( $ current_umask ) ; return $ success ; } catch ( Exception $ ex ) { if ( $ silent === false ) { throw new Exception ( __ ( 'Unable to create path - %s' , array ( $ path ) ) ) ; } return false ; } }
Create all the directories as specified by the input path. If the current
directory already exists, this function will return true.

@param string $path
the path containing the directories to create.
@param string|integer $mode (optional)
the permissions (in octal) of the directories to create. Defaults to 0755
@param boolean $silent (optional)
true if an exception should be raised if an error occurs, false
otherwise. this defaults to true.
@throws Exception
@return boolean
Create all the directories as specified by the input path . If the current directory already exists this function will return true .