Download the PHP package dvictorjhg/braidphp without Composer

On this page you can find all versions of the php package dvictorjhg/braidphp. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package braidphp

BraidPHP

Latest Version on Packagist Monthly Downloads on Packagist Total Downloads on Packagist PHP Version Required CI Codecov Open Issues

BraidPHP is an attribute-driven PHP framework with module composition, routing, PSR HTTP messages, and a lightweight single-process TCP HTTP runtime. Dependency injection and provider storage are delegated to the standalone dvictorjhg/php-injector package.

Why to use?

Choose BraidPHP for small HTTP APIs or services where you want explicit module boundaries, attribute-declared controllers, constructor injection, and a request lifecycle you can read end to end. It combines those pieces without requiring a full-stack application framework or a separate server for local execution.

Characteristics Comparison

Characteristic BraidPHP Slim 4 Flight 3
Primary application style Attribute controllers and composed modules Programmatic routes and middleware Programmatic routes and service helpers
Module composition imports, providers, controllers, bootstrap Application-defined composition Application-defined composition
Dependency injection Standalone PHPInjector; constructor/action injection Optional PSR-11 container Service registration and optional DI integration
HTTP messages Bundled PSR-7 request, response, URI, stream PSR-7 via an implementation such as slim/psr7 Framework request/response classes
Middleware No pipeline included PSR-15 middleware pipeline Route middleware and hooks
Bundled HTTP runtime Blocking, single-process TCP listener Uses an external server/SAPI Uses an external server/SAPI

Prefer Slim when standardized middleware is central to your application, or Flight when route/helper-oriented simplicity is a better fit. BraidPHP's native listener handles one request at a time; it is not an async server or worker pool. Providers are process-global rather than request-scoped. These are constraints, not features to hide behind throughput numbers.

Representative HTTP Benchmarks

Measured freshly on 2026-10-19 with PHP 8.5.11, k6 2.3.0, Composer 2.10.3, and an AMD RYZEN AI MAX+ 392. Tool and benchmark dependency versions were checked against upstream stable releases before running. Median requests/second across three five-second samples after warmup, at 16 concurrent users, with the server and load generator on separate cores. All frameworks use the same optimized no-dev autoloader; OPcache is on, JIT and Xdebug are off. These are synthetic routing/response workloads, not real-world application capacity estimates.

For the shared-server comparison, every framework runs behind the same single-process PHP server and registers its routes per request. JSON is encoded per request; the parameter route returns its captured ID; expected 404 responses are checked as successes. With 100 routes, 97 unused parameterized routes are registered before the three measured handlers. Optional route caches are off.

Handler routes Framework, shared server Plaintext req/s (higher is better) JSON req/s (higher is better) Parameter req/s (higher is better) 404 req/s (higher is better) JSON p95 ms (lower is better)
3 BraidPHP 12,054 12,137 10,274 11,386 1.938
3 Slim 4.15.3 6,903 6,511 6,225 7,399 3.602
3 Flight 3.19.4 15,108 12,804 10,714 12,261 2.116
100 BraidPHP 7,203 7,801 6,768 6,956 3.072
100 Slim 4.15.3 2,668 2,764 2,745 2,956 7.878
100 Flight 3.19.4 2,939 2,753 2,821 1,942 8.140

Native-runtime results are a separate comparison: BraidPHP's App::listen() bootstraps once per process and uses its own HTTP parser/emitter instead of the PHP server. Its results include that lifecycle advantage and different logging.

Handler routes BraidPHP native plaintext req/s (higher is better) JSON req/s (higher is better) Parameter req/s (higher is better) 404 req/s (higher is better) JSON p95 ms (lower is better)
3 25,515 22,340 25,766 22,669 1.207
100 20,197 20,246 19,829 24,980 1.394

CPU And Memory

Server-process resources for the JSON workload at 16 users. CPU 100% means one core; CPU us/request is server CPU time divided by completed requests. CPU and mean RSS are medians across repeats; the sampled RSS peak is the maximum across repeats. These exclude the load generator and are not whole-host totals.

Lower resource cost is better for equivalent work and process history. CPU % alone is not a ranking: low utilization can also mean fewer requests are served.

Handler routes Application CPU % (context-dependent) CPU us/request (lower is better) Mean RSS MiB (lower is better) Max sampled RSS MiB (lower is better)
3 BraidPHP, shared server 87.3 72.2 47.5 49.6
3 Slim, shared server 89.8 140.1 45.8 46.5
3 Flight, shared server 84.2 66.3 49.2 52.4
100 BraidPHP, shared server 92.5 119.4 40.1 41.1
100 Slim, shared server 95.2 344.9 39.0 39.5
100 Flight, shared server 95.9 350.3 38.6 39.0
3 BraidPHP, native runtime 42.6 21.2 36.7 36.8
100 BraidPHP, native runtime 64.8 34.6 36.9 36.9

RSS includes PHP, extensions, resident shared pages, and state retained from earlier workloads in the same process. It is not framework-only or private memory. The three-route run also executes one-user workloads before 16-user workloads; the 100-route run does not. Their RSS values are not an isolated route-count comparison. Sampling is approximately every 100ms and can miss brief peaks. Resource windows include k6 launch/exit but exclude server startup and warmup.

All 10,136,660 requests across 180 measured samples passed status, exact-body, and content-type checks; the three-route run also tested one concurrent user. Variability is material: three-route BraidPHP JSON ranged from 7,979 to 12,223 req/s on the shared server. p95 is the median of per-run HTTP percentiles and excludes connection setup. Connections are not reused, matching the native listener's behavior. Closed-loop load and short local samples do not prove production capacity, overload behavior, or universal framework superiority.

See the benchmark report for ranges, low-concurrency results, the plain-PHP control, and provenance, and the benchmark instructions to reproduce the measurements. Database work, injected service graphs, production FPM/worker deployments, private/heap memory, and keep-alive are not measured.

Documentation

Requirements

Installation

Verified Quick Start

Create one module, one provider, one controller, then start the TCP server:

Then request the route:

For the full empty-directory walkthrough, including composer.json, src/, and index.php, see the GitHub Pages first-app guide.

What The Package Includes

Runtime Caveats

Configure HTTP Limits

Pass HttpOptions to the application; no vendor edits or global settings are needed. Existing new App() and Request::fromResource($stream) calls retain the defaults. Options are immutable and invalid values throw InvalidArgumentException at construction.

Option Default Meaning
maxHeaderBytes 65_536 Entire request line and headers, including CRLF separators; at least 4 and at most PHP_INT_MAX - 2.
maxBodyBytes 8_388_608 Maximum declared body length; non-negative. Use 0 to reject nonempty bodies.
readTimeout 5.0 Finite positive seconds for the entire header and body read, not per chunk.
writeTimeout 5.0 Finite positive seconds for the entire response write.
backlog 128 Positive pending-connection queue size passed to the socket; subject to operating-system limits.

This complete example configures an application and uses the same options for direct parsing without opening a listening socket:

Expected output:

Bootstrap modules and call $app->listen(address: '127.0.0.1', port: '8000') in your application's front controller. RequestParser::fromResource() accepts the same optional options argument. HTTP options do not change provider scopes, route matching, or the single-process model. Configure PHP's error_log setting to choose where server-side errors are written.

Test Requests Without A Server

This complete example uses the checked-in application, so run it from a repository clone after composer install, not from a package-only installation:

Expected output:

See the complete JSON recipe for decoded path parameters, query validation, dependency injection, strict path matching, and exception handling.

Run The Example Application

From the repository root:

In a second terminal:

Development Commands

Customize Development Tools

Composer forwards arguments after --. The coverage checker defaults to build/test-results/clover.xml and 80%; supply both the report and a finite percentage between 0 and 100 to override them:

Use your own configuration paths with the same tool flags. Coverage output paths can be selected with vendor/bin/phpunit --coverage-clover /tmp/clover.xml; pass that report to the checker. Enable Xdebug coverage mode or PCOV for coverage runs. The CI gate and Codecov targets are separate settings, not runtime limits.

Containers

The repository includes a PHP image definition in docker/php/php.Dockerfile, a compose file in docker-compose.yml, and helper launchers in bin/podman-run.sh and bin/podman-run.ps1.

Typical local Podman flow:

The default .env values expose SERVER_PORT=8000 and set the base PHP image tag to php-8.5.11-cli-trixie. The Podman launcher appends the environment name, so its default development image is localhost/dvictorjhg/braidphp:php-8.5.11-cli-trixie-development.

Changelog

See CHANGELOG.md.

Contributing

See CODE_OF_CONDUCT.md, and AI_USE_POLICY.md.

Security

See SECURITY.md. Report vulnerabilities privately instead of opening a public issue.

Release / Publishing

The next release is 1.1.0. Finalize its dated entry in CITATION.cff and the English and Spanish documentation version labels aligned, and run every development command above. Review composer audit and inspect a composer archive build for source, licensing files, and unwanted local artifacts before tagging.

Publish PHPInjector 1.0.3 first, then create and push the annotated BraidPHP tag 1.1.0, publish the GitHub Release, and refresh Packagist. Composer derives the package version from the Git tag; do not add a version field to composer.json. Configuration defaults remain compatible with unconfigured calls; malformed request framing is now rejected and listener error details are logged instead of exposed to clients.

License And Attribution

BraidPHP is released under the Apache License 2.0. Preserve the license text, repository copyright, and attribution notices. See CITATION.cff for attribution details.


All versions of braidphp with dependencies

PHP Build Version
Package Version
Requires dvictorjhg/php-injector Version ^1.0.5
php Version ~8.4.27 || ^8.5.12
psr/http-factory Version ^1.1
psr/http-message Version ^2.0
psr/http-server-handler Version ^1.0
psr/http-server-middleware Version ^1.0
psr/log Version ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package dvictorjhg/braidphp contains the following files

Loading the files please wait ...