Download the PHP package gacela-project/container without Composer

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

Gacela Container

GitHub Build Status Latest Version PHP Version Require Psalm Type-coverage Status MIT Software License

A minimalistic, PSR-11 compliant dependency injection container with automatic constructor injection and zero configuration.

Features

Installation

Requires PHP >= 8.3.

Hello World

Need interfaces, singletons, attributes, or a compiled cache? See the docs below.

How it compares

Gacela Pimple Laravel PHP-DI Symfony
PSR-11 โœ… wrapper โœ… โœ… โœ…
Autowiring with zero config โœ… โŒ โœ… โœ… needs config
Framework-independent โœ… โœ… pulls illuminate/contracts โœ… โœ…
Lifetimes as attributes #[Singleton] #[Factory] #[Lazy] โŒ โŒ #[Inject] only #[Autoconfigure]
Property injection โœ… #[Inject] โŒ โŒ โœ… via config
Lazy services โœ… native lazy objects (PHP 8.4+), attribute or lazy(), no proxy class โŒ โŒ โœ… via proxy library โœ…
Compiled resolution โœ… plans + generated factories โŒ โŒ โœ… โœ…
Reflection shared across sibling containers โœ… PlanCache, in-process โŒ โŒ via APCu cache n/a โ€” dumped once
Child/scope containers โœ… inherits without copying โŒ โŒ โŒ โŒ
Contextual bindings โœ… โŒ โœ… definitions โœ…
Tags โœ… list or keyed map โŒ โœ… โŒ โœ…
Resolution hooks โœ… afterResolving() โŒ โœ… โŒ โŒ
Invoke any callable โœ… resolve() โŒ โœ… call() โœ… call() โŒ
Circular dependencies โœ… named exception + path โŒ โœ… โœ… โœ… at compile time
Introspection โœ… stats(), dependency tree, compileReport(), typo hints โŒ โŒ limited โœ… via console
Array access โœ… โœ… โœ… โŒ โŒ
Definitions as data โœ… arrays, PHP + JSON + YAML files โŒ โŒ โœ… โœ…
YAML definition files โœ… optional, via symfony/yaml โ€” never a hard dependency โŒ โŒ โœ… โœ…
XML definition files โŒ by design โ€” parse it and load() the array โŒ โŒ โŒ โœ…
Build-time validation โœ… validate(), gacela-container validate โŒ โŒ โŒ โœ… via compiler passes
Compiler passes / extensions โŒ by design โ€” packages expose definitions instead โŒ โŒ โŒ โœ…

Use this if you want Pimple's footprint with real autowiring, or Laravel's container API without Laravel โ€” plus lazy services, per-request scopes, and a compiled cache that skips reflection entirely.

Look elsewhere if you need XML definitions or compiler-pass style extension points. Both are deliberate boundaries rather than a backlog โ€” XML has no canonical mapping to a definition array short of inventing a schema (#139), and passes operate on a definition set an autowiring container mostly does not have (#140) โ€” the two things passes are actually reached for are covered instead: validate() gives the build-time feedback, and a package registers services by exposing definitions for load(). Each issue records the reasoning and what would change it. YAML is supported, as a suggest โ€” install symfony/yaml and loadFile() reads it; the runtime requirement is still psr/container alone.

Documentation

Guide What's inside
Getting Started Installation, basic usage, how resolution works
Bindings & Registration Constructor bindings, bind()/singleton(), contextual bindings, aliasing
Definitions as Data load()/loadFile(): wiring from arrays, PHP, JSON and YAML files
Resolving Services get(), make(), getOrFail(), resolve(), transient vs. shared
PHP 8 Attributes #[Inject], #[Singleton], #[Factory], #[Lazy]
Managing Services Factories, extending, protecting closures, introspection
Scopes Child containers: inherited registration, per-request lifetimes
Performance & Compilation warmUp(), compiled cache, generated factories, validate(), the CLI
Cookbook Recipes: testing, config, plugins, decorating, debugging
Error Handling Every exception, what causes it, how to fix it
Best Practices Recommended patterns
API Reference Full method, static, and attribute reference
Backward Compatibility What semver covers here, and what it does not
Upgrade Guide Migrating to 2.0, and 0.10.0 to 1.0.0

Real-World Example

See how it's used in the Gacela Framework.

Testing

License

MIT License. See LICENSE file for details.


All versions of container with dependencies

PHP Build Version
Package Version
Requires php Version >=8.3
psr/container Version ^1.1 || ^2.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 gacela-project/container contains the following files

Loading the files please wait ...