Mercurial > hg > webaudioevaluationtool
comparison php/test_write.php @ 3120:53d701288da5
Create new php config to allow saves to be stored outside of web scope
author | Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk> |
---|---|
date | Wed, 18 Jul 2018 16:47:07 +0100 |
parents | 260efd43fe52 |
children | 3e97bf9d24cf |
comparison
equal
deleted
inserted
replaced
3119:aa4503f8c630 | 3120:53d701288da5 |
---|---|
1 <?php | 1 <?php |
2 $file = "../saves/test-save.xml"; | 2 $saveLocation = getSaveLocation(); |
3 $file = $saveLocation."test-save.xml"; | |
3 $state = file_put_contents($file, "<xml></xml>"); | 4 $state = file_put_contents($file, "<xml></xml>"); |
4 if ($state == FALSE) { | 5 if ($state == FALSE) { |
5 echo "<response state=\"error\"><message>Could not open file</message></response>"; | 6 echo "<response state=\"error\"><message>Could not open file</message></response>"; |
6 } else { | 7 } else { |
7 unlink($file) or die("<response state=\"error\"><message>Could not open file</message></response>"); | 8 unlink($file) or die("<response state=\"error\"><message>Could not open file</message></response>"); |