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

BlueScreen: renderToFile() returns bool to indicate if file was written by current process #325

Merged
merged 1 commit into from Oct 9, 2018

Conversation

JanTvrdik
Copy link
Contributor

@JanTvrdik JanTvrdik commented Oct 9, 2018

  • bug fix / new feature? minor low-level feature
  • BC break? no
  • doc PR: too low-level to be worth documenting

I need to upload the bluescreen to remote storage (AWS S3 in my case). This is what I'm doing currently

$lockPath = "$localPath.lock";
$lockHandle = @fopen($lockPath, 'x');
if ($lockHandle === false) {
	return;
}

Tracy\Debugger::getBlueScreen()->renderToFile($exception, $localPath);
$this->remoteStorageDriver->upload($localPath);

@fclose($lockHandle);
@unlink($lockPath);

The proposed change would allow to simplify to code to

if (Tracy\Debugger::getBlueScreen()->renderToFile($exception, $localPath)) {
	$this->remoteStorageDriver->upload($localPath);
}

@dg dg merged commit 2cc4339 into nette:master Oct 9, 2018
3 checks passed
@JanTvrdik JanTvrdik deleted the patch-2 branch Oct 9, 2018
dg pushed a commit that referenced this issue Oct 24, 2018
dg pushed a commit that referenced this issue Nov 29, 2018
dg pushed a commit that referenced this issue Feb 5, 2019
dg pushed a commit that referenced this issue Feb 5, 2019
dg pushed a commit that referenced this issue Feb 5, 2019
dg pushed a commit that referenced this issue Feb 5, 2019
dg pushed a commit that referenced this issue Feb 10, 2019
dg pushed a commit that referenced this issue Feb 11, 2019
dg pushed a commit that referenced this issue Feb 11, 2019
dg pushed a commit that referenced this issue Feb 12, 2019
dg pushed a commit that referenced this issue Feb 14, 2019
dg pushed a commit that referenced this issue Feb 15, 2019
dg pushed a commit that referenced this issue Feb 15, 2019
dg pushed a commit that referenced this issue Feb 15, 2019
dg pushed a commit that referenced this issue Feb 17, 2019
dg pushed a commit that referenced this issue Feb 17, 2019
dg pushed a commit that referenced this issue Feb 17, 2019
dg pushed a commit that referenced this issue Feb 17, 2019
dg pushed a commit that referenced this issue Feb 17, 2019
dg pushed a commit that referenced this issue Feb 17, 2019
dg pushed a commit that referenced this issue Feb 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants