Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/mautic.corals.io/app/bundles/CoreBundle/Helper/Update/Github/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/mautic.corals.io/app/bundles/CoreBundle/Helper/Update/Github/Release.php
<?php

namespace Mautic\CoreBundle\Helper\Update\Github;

use Mautic\CoreBundle\Helper\Update\Exception\UpdatePackageNotFoundException;
use Mautic\CoreBundle\Release\Metadata;

class Release
{
    /**
     * @var string
     */
    private $version;

    private string $downloadUrl;

    /**
     * @var string
     */
    private $announcementUrl;

    private string $stability;

    private Metadata $metadata;

    /**
     * @throws UpdatePackageNotFoundException
     */
    public function __construct(array $release, Metadata $metadata)
    {
        $this->version         = $release['tag_name'];
        $this->downloadUrl     = $this->parseUpdatePackage($release['assets']);
        $this->announcementUrl = $metadata->getAnnouncementUrl() ?: $release['html_url'];
        $this->stability       = $metadata->getStability();
        $this->metadata        = $metadata;
    }

    public function getVersion(): string
    {
        return $this->version;
    }

    public function getDownloadUrl(): string
    {
        return $this->downloadUrl;
    }

    public function getAnnouncementUrl(): string
    {
        return $this->announcementUrl;
    }

    public function getStability(): string
    {
        return $this->stability;
    }

    public function getMetadata(): Metadata
    {
        return $this->metadata;
    }

    /**
     * @throws UpdatePackageNotFoundException
     */
    private function parseUpdatePackage(array $assets): string
    {
        foreach ($assets as $asset) {
            if (str_contains($asset['name'], 'update.zip')) {
                return $asset['browser_download_url'];
            }
        }

        throw new UpdatePackageNotFoundException();
    }
}

Spamworldpro Mini