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

Use Rust FFI #12: Binary #332

Merged
merged 2 commits into from
Sep 12, 2023
Merged

Use Rust FFI #12: Binary #332

merged 2 commits into from
Sep 12, 2023

Conversation

tienvx
Copy link
Contributor

@tienvx tienvx commented Aug 21, 2023

Add binary file support with example.

This PR depends on #331. Please review it first.

@tienvx tienvx force-pushed the binary branch 4 times, most recently from 467aca1 to dbb79ec Compare August 21, 2023 15:02
$response
->setStatus(200)
->addHeader('Content-Type', 'image/jpeg')
->setBody(new Binary($imageContent, in_array(php_uname('m'), ['AMD64', 'arm64']) ? 'application/octet-stream' : 'image/jpeg'));
Copy link
Member

Choose a reason for hiding this comment

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

Related to pact-foundation/pact-reference#305 I presume

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think pact-foundation/pact-reference#171 is more precise

Copy link
Member

Choose a reason for hiding this comment

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

ahh yes, spot on 🔍

Copy link
Member

@YOU54F YOU54F left a comment

Choose a reason for hiding this comment

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

Looks good dude, I do like the separation of the examples by function, as it's not clear for example from pact-js v3 folder

https://github.com/pact-foundation/pact-js/tree/master/examples/v3

as to the fact the to-do consumer is the xml project (i know it says elsewhere but there folders could be desrcription). food for thought as we begin to align project examples to had a common scenario and reference to then have a sample test in each language)

@YOU54F YOU54F merged commit 19e95a1 into pact-foundation:ffi Sep 12, 2023
26 checks passed
@tienvx tienvx deleted the binary branch September 12, 2023 15:53
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