mirror of
https://gitlab.com/hashborgir/d2tools.git
synced 2024-11-30 04:26:03 +00:00
new branch windows
This commit is contained in:
parent
43d883559c
commit
b3d62294e6
@ -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 {
|
||||||
|
@ -1,13 +1,15 @@
|
|||||||
<?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\\';
|
||||||
if (DIRECTORY_SEPARATOR === '\\') {
|
file_put_contents("../d2um.conf", $path);
|
||||||
file_put_contents("../d2um.conf", $_POST['path'].DIRECTORY_SEPARATOR.'data'.DIRECTORY_SEPARATOR.'global'.DIRECTORY_SEPARATOR.'excel'.DIRECTORY_SEPARATOR);
|
} else {
|
||||||
}
|
|
||||||
|
file_put_contents("../d2um.conf", $_POST['path'].DIRECTORY_SEPARATOR);
|
||||||
|
}
|
||||||
header('Location: /');
|
header('Location: /');
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
@ -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);
|
||||||
|
|
||||||
|
$oldfile = $this->path.$file;
|
||||||
|
|
||||||
|
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
||||||
// set new file location to copy to (backup)
|
// set new file location to copy to (backup)
|
||||||
$newfile = $this->path.DIRECTORY_SEPARATOR."backup".DIRECTORY_SEPARATOR.$file;
|
$newfile = $this->path."\\backup\\$file";
|
||||||
|
} else {
|
||||||
if (!copy($file, $newfile)) {
|
$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";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user