Skip to content

CLI hangs when Packagist is unreachable during version check #113

@JoshSalway

Description

@JoshSalway

InteractsWithVersions::getLatestVersion() calls file_get_contents() against Packagist with no timeout and no error handling:

$package = json_decode(file_get_contents(
    'https://packagist.org/p2/laravel/forge-cli.json'
), true);

If Packagist is unreachable or slow, the CLI hangs indefinitely. There's also no handling for file_get_contents returning false.

Should add a timeout and a try-catch that falls back to the current version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions