удаление мусора
This commit is contained in:
6
File.php
6
File.php
@@ -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