Download the PHP package citomni/http without Composer

On this page you can find all versions of the php package citomni/http. 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 http

CitOmni HTTP

Slim, deterministic HTTP delivery for CitOmni apps. Zero "magic", PSR-4 all the way, PHP 8.2+, tiny boot, predictable overrides.


Highlights


Green by design

CitOmni's "Green by design" claim is empirically validated at the framework level.

The core runtime achieves near-floor CPU and memory costs per request on commodity shared infrastructure, sustaining hundreds of RPS per worker with extremely low footprint.

See the full test report here: CitOmni Docs → /reports/2025-10-02-capacity-and-green-by-design.md


Requirements


Install

Your app's composer.json must PSR-4 map your code:

Then:


Quick start

/public/index.php (minimal front controller):

Folder layout (app):


Configuration (last wins)

Vendor HTTP baseline lives in \CitOmni\Http\Boot\Config::CFG. At runtime, the app builds config as:

  1. Vendor HTTP baseline
  2. Provider CFGs (if any; listed in /config/providers.php)
  3. App base cfg /config/citomni_http_cfg.php
  4. App env overlay /config/citomni_http_cfg.{env}.php (optional)

Merge rules:

Deep access via read-only wrapper:

Example /config/citomni_http_cfg.php

Per-env overlays (optional)

/config/citomni_http_cfg.stage.php

/config/citomni_http_cfg.prod.php

Base URL policy

Reverse proxy & base URL

If you run behind Nginx/Apache/Cloudflare, configure http.trust_proxy and http.trusted_proxies correctly. Only include trusted proxy IPs/CIDR blocks.

Config:

Nginx (example):

If you publish under a sub-path (e.g. https://example.com/app), make sure your base_url includes that path, or set CITOMNI_PUBLIC_ROOT_URL accordingly. The router handles base-prefix stripping correctly either way.


Routes

Keep routes inline under cfg['routes'] or load them from a separate PHP file.

Placeholders available:

Custom error pages

Override 403/404/405/500 in cfg['routes']:

Template variables provided to errorPage:


Controllers

Healthcheck

A minimal route for load balancers/uptime checks:


Templating with View (helpers & examples)

View renders LiteView templates from either your app (/templates) or a vendor "layer" like citomni/auth. It also exposes a small set of globals and closures you can call directly in templates.

Controller -> render (passes 3 vars)

Corresponding template snippet (public/home.html)

Using Template helpers (LiteView syntax)

LiteView syntax: {{ ... }} prints escaped, {{{ ... }}} prints raw. Control structures use {% ... %} and comments use {# ... #}. Find more examples in the documentation inside the View-service.

Globals & closures available in templates

Closures:

Notes & tips


Services

Baseline map shipped by this package:

Extend/override in /config/services.php:

Use anywhere:

Note: log, mailer, and connection are provided by citomni/infrastructure and are not part of the HTTP baseline. This package only references them when present.


Request / Response quick notes

Request

Response

Session / Cookie

View

Security

Nonce

Maintenance

WebhooksAuth

Client signing example (PHP)

If you enable bind_context, the client must build the canonical string exactly as documented (METHOD, PATH, QUERY, sha256(body) on separate lines).


CSRF example (controller + view)

Controller (POST handler):

Form (LiteView template):


Providers (optional)

Providers export their own config/services and are explicitly whitelisted:

/config/providers.php

Providers merge between vendor baseline and app overrides (last wins).


Error handling

If present, Kernel installs \CitOmni\Http\Exception\ErrorHandler using config under cfg['error_handler'] (not runtime args). It supports:


Maintenance mode

Flag file (app-owned): /var/flags/maintenance.php returns:

HTTP will emit 503 with Retry-After; allow-listed IPs bypass maintenance.


Compiled caches (optional, recommended for prod)

Pre-merge and cache:

Warm from code:

Writes are atomic (tmp + rename), with best-effort OPcache invalidation.


Security checklist


Performance tips


Dev utilities


Backwards compatibility


FAQ

Q: Should I auto-detect base URL in prod? A: No. Dev -> auto-detect; stage/prod -> set absolute URL in citomni_http_cfg.{env}.php or define CITOMNI_PUBLIC_ROOT_URL.

Q: Can I add per-service options? A: Yes. All services accept __construct(App $app, array $options = []). Put options in /config/services.php.

Q: Where do role/text helpers come from? A: View exposes helpers that call services if present (role, txt). If those services aren't installed, the helpers gracefully fallback.


Troubleshooting

"Base URL is wrong behind proxy" Set http.trust_proxy=true, fill trusted_proxies, and ensure your proxy sets X-Forwarded-* headers.

"Headers already sent" Don't echo/var_dump before using Response methods. See response_errors.json (requires a log service).

"CSRF fails on POST" Ensure the hidden input <input name="csrf_token"> exists and matches security.csrf_field_name.

"Nonce storage failed" webhooks.nonce_dir (or var/nonces) must exist and be writable by the PHP process.


Contributing


Coding & Documentation Conventions

All CitOmni projects follow the shared conventions documented here: CitOmni Coding & Documentation Conventions


License

CitOmni HTTP is open-source under the MIT License.
See: LICENSE.

Trademark notice: "CitOmni" and the CitOmni logo are trademarks of Lars Grove Mortensen.
You may not use the CitOmni name or logo to imply endorsement or affiliation without prior written permission.
For details, see the project NOTICE.


Trademarks

"CitOmni" and the CitOmni logo are trademarks of Lars Grove Mortensen.
You may make factual references to "CitOmni", but do not modify the marks, create confusingly similar logos,
or imply sponsorship, endorsement, or affiliation without prior written permission.
Do not register or use "citomni" (or confusingly similar terms) in company names, domains, social handles, or top-level vendor/package names.
For details, see the project's NOTICE.


Author

Developed by Lars Grove Mortensen © 2012-present Contributions and pull requests are welcome!


Built with ❤️ on the CitOmni philosophy: low overhead, high performance, and ready for anything.


All versions of http with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
citomni/kernel Version ^1.0
larsgmortensen/liteview Version ^1.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 citomni/http contains the following files

Loading the files please wait ...