8000 Check against host name for CLI commands by joecwallace · Pull Request #736 · laravel/laravel · GitHub
[go: up one dir, main page]

Skip to content

Check against host name for CLI commands #736

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

Merged
merged 1 commit into from
Jun 3, 2012

Conversation

joecwallace
Copy link
Contributor

This is a duplicate of Pull Request #696 into develop branch instead of master.

@taylorotwell
Copy link
Member

Cool addition, will go ahead and merge. Any idea how this works on WIndows systems? Is gethostname pretty reliable?

taylorotwell added a commit that referenced this pull request Jun 3, 2012
Check  against host name for CLI commands
@taylorotwell taylorotwell merged commit 930a3e8 into laravel:develop Jun 3, 2012
@joecwallace
Copy link
Contributor Author

I don't know, honestly. Don't have easy access to Windows env. PHP.net comments show a couple of older issues; hopefully, they have been resolved. Google search doesn't turn up anything glaring in the first couple pages.

@ghost
Copy link
ghost commented Jun 3, 2012
<?php

$isWindows = ('win' === strtolower(substr(php_uname("s"), 0, 3)));

If you need to do something different for windows, that's always worked for me.

@joecwallace
Copy link
Contributor Author

We could also substitute php_uname('n') for gethostname(). That should work on Windows & *nix.

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.

3 participants
0