comparison php/requestKey.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 9a201c63a0eb
children edd536f01e4b
comparison
equal deleted inserted replaced
3119:aa4503f8c630 3120:53d701288da5
55 } 55 }
56 if ($unique) { 56 if ($unique) {
57 $key = $tempKey; 57 $key = $tempKey;
58 } 58 }
59 } 59 }
60 60 $saveLocation = getSaveLocation();
61 $filename = "../saves/".$saveFilenamePrefix.$key.".xml"; 61 $filename = $saveLocation.$saveFilenamePrefix.$key.".xml";
62 $fileHandle = fopen($filename, 'w'); 62 $fileHandle = fopen($filename, 'w');
63 if ($fileHandle == FALSE) { 63 if ($fileHandle == FALSE) {
64 die("<response><state>ERROR</state><key>".$key."</key><message>Could not open file for writing</message></response>"); 64 die("<response><state>ERROR</state><key>".$key."</key><message>Could not open file for writing</message></response>");
65 } 65 }
66 fclose($fileHandle); 66 fclose($fileHandle);