fixes for restore from backup file
This commit is contained in:
parent
6279ad4730
commit
382c314af0
5 changed files with 14 additions and 11 deletions
|
@ -60,13 +60,13 @@ class DocTools
|
|||
public static function deleteFolder($path)
|
||||
{
|
||||
if (!empty($path) && is_dir($path)) {
|
||||
$dir = new RecursiveDirectoryIterator(
|
||||
$dir = new \RecursiveDirectoryIterator(
|
||||
$path,
|
||||
RecursiveDirectoryIterator::SKIP_DOTS
|
||||
\RecursiveDirectoryIterator::SKIP_DOTS
|
||||
); //upper dirs are not included,otherwise DISASTER HAPPENS :)
|
||||
$files = new RecursiveIteratorIterator(
|
||||
$dir,
|
||||
RecursiveIteratorIterator::CHILD_FIRST
|
||||
\RecursiveIteratorIterator::CHILD_FIRST
|
||||
);
|
||||
foreach ($files as $f) {
|
||||
if (is_file($f)) {
|
||||
|
|
|
@ -4,7 +4,7 @@ namespace brain\utility
|
|||
|
||||
use Psr\Http\Message\UploadedFileInterface;
|
||||
|
||||
define("MAXIMUM_FILESIZE", "10485760"); //10 MB
|
||||
//define("MAXIMUM_FILESIZE", "10485760"); //10 MB
|
||||
class FileUploader
|
||||
{
|
||||
public static function uploadFile(string $directory, $file)
|
||||
|
|
|
@ -106,6 +106,7 @@ class SetUp
|
|||
|
||||
$backup = $request->getUploadedFiles();
|
||||
$file = $backup["backup-upload"];
|
||||
//NOTE: If this fails check 'post_max_size' in php.ini
|
||||
$size = $file->getSize();
|
||||
$name = $file->getClientFileName();
|
||||
|
||||
|
@ -113,7 +114,7 @@ class SetUp
|
|||
$file->moveTo("../content" . "/" . $name);
|
||||
|
||||
//open it and get files to verify user
|
||||
$zip = new ZipArchive();
|
||||
$zip = new \ZipArchive();
|
||||
if ($zip->open("../content" . "/" . $name) === true) {
|
||||
$folks = json_decode($zip->getFromName("settings/folks.json"), true);
|
||||
$found = find($folks, ["handle" => $body["restore_member_handle"]]);
|
||||
|
|
|
@ -1199,8 +1199,11 @@ const API_ACCESS_BAD = 'apiUseNotAuthorized';
|
|||
method = REQUEST_TYPE_POST;
|
||||
type = CONTENT_TYPE_FORM;
|
||||
data = new FormData(form);
|
||||
var result, err;
|
||||
return;
|
||||
this._request(url, event, method, type, data).then((result)=>{
|
||||
resolve(result);
|
||||
}).catch((err)=>{
|
||||
reject(err);
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
|
@ -1770,7 +1773,7 @@ class PostEditor {
|
|||
exports.default = PostEditor;
|
||||
PostEditor.uploadFiles = [];
|
||||
|
||||
},{"../../libraries/FipamoAdminAPI":"6M96o","./MaintenanceManager":"kY7L1","../events/DataEvent":"edzJV","../actions/PageActions":"5t6eY","../events/EditorEvent":"dW8iq","../ui/TextEditor":"bMFpA","../ui/Notifications":"fmUxI","@parcel/transformer-js/src/esmodule-helpers.js":"ciiiV","../ui/FileManager":"kp4D5"}],"5t6eY":[function(require,module,exports) {
|
||||
},{"../../libraries/FipamoAdminAPI":"6M96o","./MaintenanceManager":"kY7L1","../events/DataEvent":"edzJV","../actions/PageActions":"5t6eY","../events/EditorEvent":"dW8iq","../ui/TextEditor":"bMFpA","../ui/Notifications":"fmUxI","../ui/FileManager":"kp4D5","@parcel/transformer-js/src/esmodule-helpers.js":"ciiiV"}],"5t6eY":[function(require,module,exports) {
|
||||
var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js");
|
||||
parcelHelpers.defineInteropFlag(exports);
|
||||
var _stringUtils = require("../utils/StringUtils");
|
||||
|
@ -2035,7 +2038,7 @@ class TextEditor extends _eventEmitterDefault.default {
|
|||
}
|
||||
exports.default = TextEditor;
|
||||
|
||||
},{"../events/DataEvent":"edzJV","caret-pos":"9lzNv","../events/EventEmitter":"cbFNs","../events/EditorEvent":"dW8iq","@parcel/transformer-js/src/esmodule-helpers.js":"ciiiV","prismjs/components/prism-core":"cps8h","prismjs/components/prism-markup":"dIns2","prismjs/components/prism-markdown":"gqRFx"}],"9lzNv":[function(require,module,exports) {
|
||||
},{"../events/DataEvent":"edzJV","caret-pos":"9lzNv","../events/EventEmitter":"cbFNs","../events/EditorEvent":"dW8iq","prismjs/components/prism-core":"cps8h","prismjs/components/prism-markup":"dIns2","prismjs/components/prism-markdown":"gqRFx","@parcel/transformer-js/src/esmodule-helpers.js":"ciiiV"}],"9lzNv":[function(require,module,exports) {
|
||||
var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js");
|
||||
parcelHelpers.defineInteropFlag(exports);
|
||||
parcelHelpers.export(exports, "getOffset", ()=>getOffset1
|
||||
|
@ -5576,7 +5579,7 @@ class FileManager {
|
|||
}
|
||||
exports.default = FileManager;
|
||||
|
||||
},{"sortablejs":"fLJM6","../utils/DataUtils":"lpIyf","@parcel/transformer-js/src/esmodule-helpers.js":"ciiiV","./Notifications.js":"fmUxI"}],"fLJM6":[function(require,module,exports) {
|
||||
},{"sortablejs":"fLJM6","../utils/DataUtils":"lpIyf","./Notifications.js":"fmUxI","@parcel/transformer-js/src/esmodule-helpers.js":"ciiiV"}],"fLJM6":[function(require,module,exports) {
|
||||
var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js");
|
||||
parcelHelpers.defineInteropFlag(exports);
|
||||
parcelHelpers.export(exports, "MultiDrag", ()=>MultiDragPlugin
|
||||
|
|
|
@ -102,7 +102,6 @@ class MaintenanceManager {
|
|||
method = REQUEST_TYPE_POST;
|
||||
type = CONTENT_TYPE_FORM;
|
||||
data = new FormData(form);
|
||||
return;
|
||||
this._request(url, event, method, type, data)
|
||||
.then(result => {
|
||||
resolve(result);
|
||||
|
|
Loading…
Reference in a new issue