src/Koldy/Filesystem/Directory.php
public static function mkdir(string $path, $chmod = null): void
    {
        if (!is_dir($path)) {
            if ($chmod === null) {
                $chmod = Application::getConfig('application')->getArrayItem('filesystem', 'default_chmod', 0644);
            }

            if (!mkdir($path, $chmod, true)) {
                throw new FilesystemException("Can not create directory on path={$path}");
            }
        }
    }
public static function mkdir(string $path, $chmod = null): void
    {
        if (!is_dir($path)) {
            if ($chmod === null) {
                $chmod = Application::getConfig('application')->getArrayItem('filesystem', 'default_chmod', 0644);
            }

            if (!mkdir($path, $chmod, true)) {
                throw new FilesystemException("Can not create directory on path={$path}");
            }
        }
    }
public static function mkdir ( string $ path , $ chmod = null ) : void { if ( ! is_dir ( $ path ) ) { if ( $ chmod === null ) { $ chmod = Application :: getConfig ( 'application' ) -> getArrayItem ( 'filesystem' , 'default_chmod' , 0644 ) ; } if ( ! mkdir ( $ path , $ chmod , true ) ) { throw new FilesystemException ( "Can not create directory on path={$path}" ) ; } } }
Create the target directory recursively if needed

@param string $path
@param int $chmod default 0644

@return void
@throws Exception
@throws \Koldy\Config\Exception
@throws \Koldy\Exception
@example $chmod 0777, 0755, 0700
Create the target directory recursively if needed