Download the PHP package grifart/nette-scoped-di without Composer

On this page you can find all versions of the php package grifart/nette-scoped-di. 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 nette-scoped-di

Nette Scoped Depenedency Injection Container

Split your app dependency injection container into well-defined scopes and enforce relationships between them.

On the edge between monolith and microservices

This approach stays in the middle of monolith and microservices.

From architectonical perspective it is equavalent to microservices approach. There is clear boundary and interface between model and app.

Technically you save tons of hours of maintainace cost of managing microservices. Because there is still one app, but with many independent modules. They have clear boundaries and explicitly defined dependencies. And when you break this boundary, you get an exception.

So if needed you can easily turn already defined modules into microservices later. Only part that is missing here is a serialization & networking stack. This can be easily solved by adding RPC layer between modules that are extracted into microservices.

More resources:

Example

You have a model where you want to expose access only to a few facades. So you export them from the model container into the app container, and the app then can only access those exported services. This means that app can no longer ignore ACL rules or directly access a database.

Registering the model into a user DI container

For the model container, you must create a DI extension to register all the services exported from the model to the user's application (UI/API/CLI/...) part of the app.

In the user DI container, register this newly created extension:

Exporting a service from the model container

Requiring a dependency of the model container

When the model container needs a dependency (EmailSender), it can require it by defining the service torso.

Then tell the DI that the outer container MUST provide the EmailSender.

The outer container then registers the service, and you are done.

Danger zone

Sometimes, you need to break the pattern of being insulated from the model. See danger zone.

Contributing

This repository is fork of mangoweb-backend/nette-di-scope.

Primary development place is gitlab.grifart.cz. master is automatically replicated back to github:grifart/nette-di-scope.

Submitting contribution into fork

Internal contributions

Use GitLab and open merge request, target: master. After merge it will be automatically propagated to GitHub.

External contributions

External developers: Use GitHub, open pull request targeting our master master.

Internal reviewer and maintainer of pull request:

Recommended git remotes setup


All versions of nette-scoped-di with dependencies

PHP Build Version
Package Version
Requires php Version ~7.1 || ^8.0
nette/di Version ~3.0
nette/bootstrap 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 grifart/nette-scoped-di contains the following files

Loading the files please wait ....