PHP 8.3.31
Preview: Factory.php Size: 732 B
/home/getspomw/royalsquad.us/vendor/psy/psysh/src/VersionUpdater/Downloader/Factory.php

<?php

/*
 * This file is part of Psy Shell.
 *
 * (c) 2012-2023 Justin Hileman
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Psy\VersionUpdater\Downloader;

use Psy\Exception\ErrorException;
use Psy\VersionUpdater\Downloader;

class Factory
{
    /**
     * @throws ErrorException If no downloaders can be used
     */
    public static function getDownloader(): Downloader
    {
        if (\extension_loaded('curl')) {
            return new CurlDownloader();
        } elseif (\ini_get('allow_url_fopen')) {
            return new FileDownloader();
        }
        throw new ErrorException('No downloader available.');
    }
}

Directory Contents

Dirs: 0 × Files: 3

Name Size Perms Modified Actions
2.25 KB lrw-rw-rw- 2025-09-17 06:53:38
Edit Download
732 B lrw-rw-rw- 2025-09-17 06:53:38
Edit Download
1.45 KB lrw-rw-rw- 2025-09-17 06:53:38
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).