удаление мусора
This commit is contained in:
1 parent
61b7e2716e
commit
c0c0a1b314
1 file changed
+4
-2
@@ -627,9 +627,11 @@ class File extends \yii\db\ActiveRecord
|
|||||||
$configs = Config::find()->andWhere(['module' => $this->module])->all();
|
$configs = Config::find()->andWhere(['module' => $this->module])->all();
|
||||||
foreach ($configs as $config)
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user