Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on May 15, 2024 via composer

php-http/multipart-stream-builder 1.3.0

A builder class that help you create a multipart stream
Package summary
Share
0
issues
1
license
2
MIT
Package created
18 Jul 2016
Version published
28 Apr 2023
Maintainers
4
Total deps
2
Direct deps
1
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
2 Packages, Including:
php-http/discovery@1.19.4
php-http/multipart-stream-builder@1.3.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

1
All Dependencies CSV
β“˜ This is a list of php-http/multipart-stream-builder 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
php-http/discovery1.19.4-MIT
prod

Visualizations

Frequently Asked Questions

What does php-http/multipart-stream-builder do?

The php-http/multipart-stream-builder is a useful tool that helps in creating multipart PSR-7 streams. The unique advantage of this package is that it allows you to create streams independently from any PSR-7 implementation. This becomes particularly beneficial in contexts where you need to handle multi-part form data in your PHP applications. The builder enables you to add binary data and fields to requests and handle complex content types like nested multiparts.

How do you use php-http/multipart-stream-builder?

To utilize the php-http/multipart-stream-builder in your project, you will first require the use of Composer. You can install the package using the following command on your terminal:

$ composer require php-http/multipart-stream-builder

Please remember that prerequisites include having PHP and Composer installed on your system.

Though not supplied in the document, a typical usage might look something like this:

use Http\Message\MultipartStream\MultipartStreamBuilder;
use Http\Message\StreamFactory\GuzzleStreamFactory;

// Create a stream factory.
$streamFactory = new GuzzleStreamFactory();

// Instantiate a MultipartStreamBuilder with that factory.
$builder = new MultipartStreamBuilder($streamFactory);

// Add a resource to the multipart stream.
$resource = fopen('/path/to/a/file', 'r');
$builder->addResource('file', $resource, ['filename' => 'filename.jpg']);

// Get the resulting stream.
$multipartStream = $builder->build();

// Get the boundary.
$boundary = $builder->getBoundary();

Please note that you need to add the necessary use statements and replace '/path/to/a/file' and 'filename.jpg' with actual data. Always configure and tweak the code according to your use case.

Where are the php-http/multipart-stream-builder docs?

The extensive documentation for the php-http/multipart-stream-builder can be found on the official documentation page. This documentation comprises comprehensive details about the package, including how to use it, various functionalities it offers and a host of examples to guide you through the entire process.