new branch windows

This commit is contained in:
Hash Borgir 2021-03-22 05:09:38 -06:00
parent 43d883559c
commit b3d62294e6
3 changed files with 20 additions and 12 deletions

View File

@ -84,12 +84,13 @@ option {
margin: 30px auto; margin: 30px auto;
padding: 10px; padding: 10px;
background: white; background: white;
font-family: "Exocet";
font-weight: 900;
} }
body { body {
background: black; background: black;
font-family: "Exocet";
font-weight: 900;
} }
footer, .options { footer, .options {

View File

@ -1,12 +1,14 @@
<?php <?php
if (!empty($_POST)) { if (!empty($_POST)) {
if (DIRECTORY_SEPARATOR === '/') { // write the d2um.conf file and replace \ with \\
file_put_contents("../d2um.conf", $_POST['path'].DIRECTORY_SEPARATOR); if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
} $path = str_replace('\\', '\\', $_POST['path']);
$path .= '\\data\\global\\excel\\';
file_put_contents("../d2um.conf", $path);
} else {
if (DIRECTORY_SEPARATOR === '\\') { file_put_contents("../d2um.conf", $_POST['path'].DIRECTORY_SEPARATOR);
file_put_contents("../d2um.conf", $_POST['path'].DIRECTORY_SEPARATOR.'data'.DIRECTORY_SEPARATOR.'global'.DIRECTORY_SEPARATOR.'excel'.DIRECTORY_SEPARATOR);
} }
header('Location: /'); header('Location: /');
} }

View File

@ -49,10 +49,15 @@ class saveFile {
// if dir doesn't exist, create it // if dir doesn't exist, create it
if (!is_dir($this->path.DIRECTORY_SEPARATOR."backup")) mkdir($this->path."backup", 0700); if (!is_dir($this->path.DIRECTORY_SEPARATOR."backup")) mkdir($this->path."backup", 0700);
// set new file location to copy to (backup) $oldfile = $this->path.$file;
$newfile = $this->path.DIRECTORY_SEPARATOR."backup".DIRECTORY_SEPARATOR.$file;
if (!copy($file, $newfile)) { if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
// set new file location to copy to (backup)
$newfile = $this->path."\\backup\\$file";
} else {
$newfile = $this->path."/backup/$file";
}
if (!copy($oldfile, $newfile)) {
echo "Failed to create backup of $file...\n"; echo "Failed to create backup of $file...\n";
} }
} }