удаление мусора

This commit is contained in:
2025-12-19 15:44:58 +03:00
parent 61b7e2716e
commit c0c0a1b314

View File

@@ -627,9 +627,11 @@ class File extends \yii\db\ActiveRecord
$configs = Config::find()->andWhere(['module' => $this->module])->all();
foreach ($configs as $config)
{
if(file_exists($this->getFilePath($config->type, true)))
$oldFile = $this->getFilePath($config->type, true);
if(file_exists($oldFile))
{
$s3->upload($this->getFilePath($config->type), $this->getFilePath($config->type, true));
$s3->upload($this->getFilePath($config->type), $oldFile);
@unlink($oldFile);
}
}
}