Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Merge Herd fork back in #1435

Closed
wants to merge 1 commit into from
Closed

Conversation

mattstauffer
Copy link
Collaborator

No description provided.

@mattstauffer
Copy link
Collaborator Author

Current version of this introduces two concepts: the Context class, and its two children, Herd and Standalone.

You can ask at any point for an instance of Context:

$context = resolve(Context::class);

if ($context->isHerd()) {
    // Do something
}

Or you can ask for the currently bound context:

echo sprintf(
    "You are currently using %s",
    resolve(Context::class)->name(), // If you're on Herd, returns an instance of `Herd`, so name is "Laravel Herd"
);


public static function isHerd()
{
return true; // @todo implement
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should work in the release version: basename($_SERVER['SCRIPT_NAME']) == 'herd.phar'

Not sure what the solution is for non-release version.

@mattstauffer
Copy link
Collaborator Author

Closing due to a lack of interest. @mpociot let me know if this is ever something you want to pursue in the future.

@driesvints driesvints deleted the mes/herd-friendly branch June 3, 2024 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants