Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

☁️ #53623

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 8 commits into from
Nov 22, 2024
Merged

☁️ #53623

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions 6 src/Illuminate/Console/Scheduling/CommandBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ protected function buildForegroundCommand(Event $event)
{
$output = ProcessUtils::escapeArgument($event->output);

return $this->ensureCorrectUser(
$event, $event->command.($event->shouldAppendOutput ? ' >> ' : ' > ').$output.' 2>&1'
);
return laravel_cloud()
? $this->ensureCorrectUser($event, $event->command.' 2>&1 | tee '.($event->shouldAppendOutput ? '-a ' : '').$output)
: $this->ensureCorrectUser($event, $event->command.($event->shouldAppendOutput ? ' >> ' : ' > ').$output.' 2>&1');
}

/**
Expand Down
6 changes: 5 additions & 1 deletion 6 src/Illuminate/Console/Scheduling/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,11 @@ protected function execute($container)
{
return Process::fromShellCommandline(
$this->buildCommand(), base_path(), null, null, null
)->run();
)->run(
laravel_cloud()
? fn ($type, $line) => fwrite($type === 'out' ? STDOUT : STDERR, $line)
: fn () => true
);
}

/**
Expand Down
4 changes: 1 addition & 3 deletions 4 src/Illuminate/Http/Middleware/TrustProxies.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@ protected function setTrustedProxyIpAddresses(Request $request)
{
$trustedIps = $this->proxies() ?: config('trustedproxy.proxies');

if (is_null($trustedIps) &&
(($_ENV['LARAVEL_CLOUD'] ?? false) === '1' ||
($_SERVER['LARAVEL_CLOUD'] ?? false) === '1')) {
if (is_null($trustedIps) && laravel_cloud()) {
$trustedIps = '*';
}

Expand Down
13 changes: 13 additions & 0 deletions 13 src/Illuminate/Support/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,19 @@ function object_get($object, $key, $default = null)
}
}

if (! function_exists('laravel_cloud')) {
/**
* Determine if the appliation is running on Laravel Cloud.
*
* @return bool
*/
function laravel_cloud()
{
return ($_ENV['LARAVEL_CLOUD'] ?? false) === '1' ||
($_SERVER['LARAVEL_CLOUD'] ?? false) === '1';
}
}

if (! function_exists('once')) {
/**
* Ensures a callable is only called once, and returns the result on subsequent calls.
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.