application/Espo/Core/Utils/File/Manager.php
public function mkdir($path, $permission = null, $recursive = false)
    {
        $fullPath = $this->concatPaths($path);

        if (file_exists($fullPath) && is_dir($path)) {
            return true;
        }

        $defaultPermissions = $this->getPermissionUtils()->getDefaultPermissions();

        if (!isset($permission)) {
            $permission = (string) $defaultPermissions['dir'];
            $permission = base_convert($permission, 8, 10);
        }

        try {
            $result = mkdir($fullPath, $permission, true);

            if (!empty($defaultPermissions['user'])) {
                $this->getPermissionUtils()->chown($fullPath);
            }

            if (!empty($defaultPermissions['group'])) {
                $this->getPermissionUtils()->chgrp($fullPath);
            }
        } catch (\Exception $e) {
            $GLOBALS['log']->critical('Permission denied: unable to create the folder on the server - '.$fullPath);
        }

        return isset($result) ? $result : false;
    }
public function mkdir($path, $permission = null, $recursive = false)
    {
        $fullPath = $this->concatPaths($path);

        if (file_exists($fullPath) && is_dir($path)) {
            return true;
        }

        $defaultPermissions = $this->getPermissionUtils()->getDefaultPermissions();

        if (!isset($permission)) {
            $permission = (string) $defaultPermissions['dir'];
            $permission = base_convert($permission, 8, 10);
        }

        try {
            $result = mkdir($fullPath, $permission, true);

            if (!empty($defaultPermissions['user'])) {
                $this->getPermissionUtils()->chown($fullPath);
            }

            if (!empty($defaultPermissions['group'])) {
                $this->getPermissionUtils()->chgrp($fullPath);
            }
        } catch (\Exception $e) {
            $GLOBALS['log']->critical('Permission denied: unable to create the folder on the server - '.$fullPath);
        }

        return isset($result) ? $result : false;
    }
public function mkdir ( $ path , $ permission = null , $ recursive = false ) { $ fullPath = $ this -> concatPaths ( $ path ) ; if ( file_exists ( $ fullPath ) && is_dir ( $ path ) ) { return true ; } $ defaultPermissions = $ this -> getPermissionUtils ( ) -> getDefaultPermissions ( ) ; if ( ! isset ( $ permission ) ) { $ permission = ( string ) $ defaultPermissions [ 'dir' ] ; $ permission = base_convert ( $ permission , 8 , 10 ) ; } try { $ result = mkdir ( $ fullPath , $ permission , true ) ; if ( ! empty ( $ defaultPermissions [ 'user' ] ) ) { $ this -> getPermissionUtils ( ) -> chown ( $ fullPath ) ; } if ( ! empty ( $ defaultPermissions [ 'group' ] ) ) { $ this -> getPermissionUtils ( ) -> chgrp ( $ fullPath ) ; } } catch ( \ Exception $ e ) { $ GLOBALS [ 'log' ] -> critical ( 'Permission denied: unable to create the folder on the server - ' . $ fullPath ) ; } return isset ( $ result ) ? $ result : false ; }
Create a new dir

@param  string | array $path
@param  int $permission - ex. 0755
@param  bool $recursive

@return bool
Create a new dir