Download the PHP package jblaak/php-modules without Composer

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

PHP Modules

Declare clear dependencies within your application by defining which modules have access to other parts of your application.

Installation

This package will soon be published on Packagist, however it is still in development.

Features

Run module checks on your codebase using the test command

Generate a dependency graph, make sure you have installed GraphViz for this.

Defining modules

Your modules.php file in the root of your project will be where your configuration will live. This file should return an instance of PhpModules\Lib\Modules.

Let's say we have a module in the namespace App\Http that depends on App\Persistence, we can define this as follows:

It is by design that you can't create cyclic dependencies since this is the thing that we are trying to avoid with this design pattern.

Strict modules

Explicitly define which classes are exported from your modules. Most modules will have an explicit public api which internally might have a lot of helper classes and other logic. For example a App\Persistence module might have a App\Persistence\PersistedUser and App\Persistence\UserRepository as public api but might want to hide the App\Persistence\Drivers\MySQLDriver to prevent other modules meddling with database configurations.

Define strict modules using Module::strict:

Mark classes as public using the #[Exposed] attribute:

Working with external dependencies or legacy codebases

Even though it is encouraged to try and be as explicit as possible in defining your dependencies, external dependencies (such as frameworks) or legacy codebases require a lot of configuration to get started.

To allow importing from parts of your application not yet defined as a module, or external libraries we can add ->allowUndefinedModules() to our Modules configuration.

For example, your App\Persistence layer might depend on Laravel's Eloquent (if you're into such thing) without you having to explicitly declare it:


All versions of php-modules with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
nikic/php-parser Version ^4
graphp/graphviz Version ^0.2.2
phpstan/phpdoc-parser Version ^1
symfony/console Version ^6
ondram/ci-detector Version ^4
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 jblaak/php-modules contains the following files

Loading the files please wait ...