Commit 0b8c9927 authored by Dainis Abols's avatar Dainis Abols
Browse files

4.0.1

parent 36846001
...@@ -71,7 +71,7 @@ class FileMigrationWizard implements UpgradeWizardInterface, ChattyInterface, Lo ...@@ -71,7 +71,7 @@ class FileMigrationWizard implements UpgradeWizardInterface, ChattyInterface, Lo
* *
* @var string * @var string
*/ */
protected $targetPath = '_migrated/'; protected $targetPath = 'user_upload/';
/** /**
* @return string Unique identifier of this updater * @return string Unique identifier of this updater
...@@ -208,26 +208,9 @@ class FileMigrationWizard implements UpgradeWizardInterface, ChattyInterface, Lo ...@@ -208,26 +208,9 @@ class FileMigrationWizard implements UpgradeWizardInterface, ChattyInterface, Lo
$fileUid = null; $fileUid = null;
$sourcePath = Environment::getPublicPath() . '/' . $item; $sourcePath = Environment::getPublicPath() . '/' . $item;
$strippedPath = str_replace("fileadmin/user_upload/", "", $item); $strippedPath = str_replace("fileadmin/user_upload/", "", $item);
$targetDirectory = Environment::getPublicPath() . '/' . $fileadminDirectory . $this->targetPath;
$targetPath = $targetDirectory . $strippedPath;
// Remove file name
$temp = explode("/", $strippedPath);
array_pop($temp);
$subdir = implode("/", $temp);
$subdir = $targetDirectory . $subdir;
// maybe the file was already moved, so check if the original file still exists // maybe the file was already moved, so check if the original file still exists
if (file_exists($sourcePath) && !is_dir($sourcePath)) { if (file_exists($sourcePath) && !is_dir($sourcePath)) {
if (!is_dir($targetDirectory)) {
GeneralUtility::mkdir_deep($targetDirectory);
}
// Create subdirectory
if (!is_dir($subdir)) {
GeneralUtility::mkdir_deep($subdir);
}
// see if the file already exists in the storage // see if the file already exists in the storage
$fileSha1 = sha1_file($sourcePath); $fileSha1 = sha1_file($sourcePath);
...@@ -247,9 +230,6 @@ class FileMigrationWizard implements UpgradeWizardInterface, ChattyInterface, Lo ...@@ -247,9 +230,6 @@ class FileMigrationWizard implements UpgradeWizardInterface, ChattyInterface, Lo
// the file exists, the file does not have to be moved again // the file exists, the file does not have to be moved again
if (is_array($existingFileRecord)) { if (is_array($existingFileRecord)) {
$fileUid = $existingFileRecord['uid']; $fileUid = $existingFileRecord['uid'];
} else {
// just move the file (no duplicate)
rename($sourcePath, $targetPath);
} }
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
## Version ## Version
4.0.0 4.0.1
## Dependencies ## Dependencies
......
{ {
"name": "luitd/lu-nabamusic", "name": "luitd/lu-nabamusic",
"version": "4.0.0", "version": "4.0.1",
"description": "Radio NABA plugin used for live stream, song tops and much more", "description": "Radio NABA plugin used for live stream, song tops and much more",
"type": "typo3-cms-extension", "type": "typo3-cms-extension",
"keywords": [ "keywords": [
......
...@@ -13,7 +13,7 @@ $EM_CONF[$_EXTKEY] = [ ...@@ -13,7 +13,7 @@ $EM_CONF[$_EXTKEY] = [
'modify_tables' => '', 'modify_tables' => '',
'clearCacheOnLoad' => 1, 'clearCacheOnLoad' => 1,
'lockType' => '', 'lockType' => '',
'version' => '4.0.0', 'version' => '4.0.1',
'constraints' => [ 'constraints' => [
'depends' => [ 'depends' => [
'typo3' => '10.0.0-10.9.99', 'typo3' => '10.0.0-10.9.99',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment