public function updateFileInfo()
{
$src = $this->src;
if ($this->cluster instanceof ClusterLocal) {
if (!\Yii::$app->request->hostInfo) {
return $this;
}
$src = \Yii::$app->request->hostInfo . $this->src;
}
//Елси это изображение
if ($this->isImage()) {
if (extension_loaded('gd')) {
list($width, $height, $type, $attr) = getimagesize($src);
$this->image_height = $height;
$this->image_width = $width;
}
}
$this->save();
return $this;
}