app/Http/Controllers/SetupController.php
private function checkFolderIsWritable(string $data_dir): bool
    {
        $text1 = random_bytes(32);

        try {
            file_put_contents($data_dir . 'test.txt', $text1);
            $text2 = file_get_contents(WT_DATA_DIR . 'test.txt');
            unlink(WT_DATA_DIR . 'test.txt');
        } catch (Exception $ex) {
            return false;
        }

        return $text1 === $text2;
    }
private function checkFolderIsWritable(string $data_dir): bool
    {
        $text1 = random_bytes(32);

        try {
            file_put_contents($data_dir . 'test.txt', $text1);
            $text2 = file_get_contents(WT_DATA_DIR . 'test.txt');
            unlink(WT_DATA_DIR . 'test.txt');
        } catch (Exception $ex) {
            return false;
        }

        return $text1 === $text2;
    }
private function checkFolderIsWritable ( string $ data_dir ) : bool { $ text1 = random_bytes ( 32 ) ; try { file_put_contents ( $ data_dir . 'test.txt' , $ text1 ) ; $ text2 = file_get_contents ( WT_DATA_DIR . 'test.txt' ) ; unlink ( WT_DATA_DIR . 'test.txt' ) ; } catch ( Exception $ ex ) { return false ; } return $ text1 === $ text2 ; }
Check we can write to the data folder.

@param string $data_dir

@return bool
Check we can write to the data folder .