Download the PHP package cubadevops/flexi without Composer

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

Flexi Framework

Flexi is a modular PHP framework designed to facilitate the development of scalable and maintainable applications. It leverages Dependency Injection (DI), a flexible routing system, CQRS and an event-driven architecture.

Table of Contents

Features

Structure

Installation

You can install Flexi Framework using Composer:

This command creates a minimal ready boilerplate application in the my-app directory.

Steps after install

To get started with Flexi Framework, ensure you:

After setup, browse to the URL of your application to see the welcome page. If you use the default configuration with Docker, you can access the application at http://localhost:8080.

Module Management

Flexi features an automatic module discovery system that makes managing modules simple and efficient.

Available Commands

Creating a New Module

That's it! Your module is now installed and ready to use. Changes to module code are immediately reflected thanks to symlinks.

How It Works

  1. Each module has its own composer.json defining its package name and dependencies
  2. The modules:sync command scans the modules/ directory and auto-discovers modules
  3. Composer creates symlinks from vendor/cubadevops/flexi-module-* to modules/*
  4. All dependencies are managed centrally by Composer
  5. Modules can be versioned, published to Git repositories, and shared across projects

For detailed documentation, see:

Configuration

Configuration for Flexi is managed through JSON files. These files define services, routes, events, queries, and commands used within your application.

Services

Services are defined in the services.json file located in the Config directory. This file outlines how each service should be instantiated, either directly or via factory methods.

Example

Note:

Routes

Routes are defined in the routes.json file. Each route specifies the HTTP method, path, and the controller that should handle the request.

Example

Note:

Events and Listeners

Events and listeners are defined in the listeners.json file. This file maps events to their corresponding listeners.

Example

Note:

Queries

Queries are defined in the queries.json file. Each query handler is mapped to a specific DTO and an optional CLI alias.

Example

Note:

Commands

Commands are defined similarly to queries in the commands.json file.

Example

Note:

Usage

Router

The Router class is responsible for managing routes and dispatching requests to the appropriate controllers.

Example Usage

Event System

The event system in Flexi is based on the EventBus pattern. Events are dispatched to listeners which can handle them accordingly.

Example

CQRS

Flexi implements the CQRS pattern with separate handling for commands and queries.

Command Example

Query Example

Controllers and Response

The response is a PSR-7 response object that can be returned from a controller or middleware. Controllers that extend the Flexi\Infrastructure\Classes\HttpHandler have an easy way to build responses using the createResponse method. If you don't extend the HttpHandler you can use a factory that implements Psr\Http\Message\ResponseFactoryInterface interface to build the response. Flexi uses the GuzzleHttp\Psr7\HttpFactory as default factory.

The HttpHandler abstract class implements a Template Method pattern that automatically manages the middleware chain execution. Controllers only need to implement the process() method with their specific business logic, while the framework handles middleware orchestration automatically.

Basic Controller Example

Controller with Dependencies and Business Logic

Controller with Template Rendering

Key Points

Middlewares

Middlewares are classes that can be executed before the controller. They can modify the request, response or stop the execution chain. Middlewares should implement the Psr\Http\Server\MiddlewareInterface interface.

Middleware Implementation Example

Testing

Flexi includes a comprehensive test suite using PHPUnit. Tests use a separate environment configuration to ensure isolation from development and production environments.

Running Tests

Test Environment

Tests automatically use .env.testing configuration file with test-specific settings:

To customize test environment:

  1. Copy .env.testing.example to .env.testing
  2. Modify values as needed
  3. Tests will automatically use these values

For more details, see tests/README.md.

Writing Tests

Documentation

The documentation is available online at https://flexi.cubadevops.com (Under construction and not yet available).

Contributing

Contributions are welcome! Please submit a pull request or open an issue to discuss any changes you would like to make.

License

Flexi is open-source software licensed under the MIT license.


All versions of flexi with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
ext-json Version *
ext-pcntl Version *
cubadevops/upgrader Version ^1.6
flexi/contracts Version >=4.1.0
guzzlehttp/guzzle Version ^7.7
symfony/error-handler Version ^5.4
vlucas/phpdotenv Version ^5.5
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 cubadevops/flexi contains the following files

Loading the files please wait ...