skeeks\cms\models\StorageFile::updateFileInfo PHP Method

updateFileInfo() public method

TODO: Переписать нормально Обновление информации о файле
public updateFileInfo ( )
    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;
    }