diff --git a/brain/utility/Setup.inc.php b/brain/utility/Setup.inc.php index 4018863..5f09f47 100644 --- a/brain/utility/Setup.inc.php +++ b/brain/utility/Setup.inc.php @@ -101,6 +101,7 @@ class SetUp $backup = $request->getUploadedFiles(); $file = $backup["backup-upload"]; + $size = $file->getSize(); $name = $file->getClientFileName(); //park it so it can be read @@ -128,11 +129,11 @@ class SetUp //move to appropriate spots /* - rename( - "../content/settings/settings.json", - "../config/settings.json" - ); - */ + rename( + "../content/settings/settings.json", + "../config/settings.json" + ); + */ //load up old config file $newConfig = json_decode( @@ -151,15 +152,22 @@ class SetUp rename("../content/settings/tags.json", "../config/tags.json"); - rename( - "../content/public/assets/images/blog", - "../public/assets/images/blog" - ); + //images path for blog and user + $blogImagePath = "../public/assets/images/blog"; + $userImagePath = "../public/assets/images/user"; - rename( - "../content/public/assets/images/user", - "../public/assets/images/user" - ); + //check to see if image dirs are empty, if not chill + if ($globs = glob($blogImagePath . "/*")) { + //directory not empty, relax + } else { + rename("../content/public/assets/images/blog", $blogImagePath); + } + + if ($globs = glob($userImagePath . "/*")) { + //directory not empty, relax + } else { + rename("../content/public/assets/images/user", $userImagePath); + } rename("../content/content/pages/", "../content/pages"); diff --git a/brain/views/dash/init.twig b/brain/views/dash/init.twig index 93c42c3..3187c54 100644 --- a/brain/views/dash/init.twig +++ b/brain/views/dash/init.twig @@ -28,7 +28,7 @@