Download the PHP package mitsuki/controller without Composer

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

Mitsuki Controller

Core controller layer for the Mitsuki Framework.

This package provides the base controller abstraction and the automatic controller discovery system used by the Mitsuki Router. It integrates seamlessly with the mitsuki/attributes package to build your routing table from PHP 8 Attributes.


โœจ Features


๐Ÿš€ Installation

Install via Composer:

Requires mitsuki/attributes for controller and route metadata.


๐Ÿ›  Usage

1๏ธโƒฃ BaseController

The BaseController provides convenient helper methods to create HTTP responses.

Available Helpers

response($body, int $status = 200, array $headers = []): Response

Creates a standard HTTP response.

json($data, int $status = 200, array $headers = []): JsonResponse

Creates a JSON response.


2๏ธโƒฃ ControllerResolver

The ControllerResolver is responsible for automatically discovering controllers inside your project.


๐Ÿ” How Controller Discovery Works

A class is considered a controller if:

  1. It is decorated with #[Controller]
  2. OR it contains at least one method decorated with #[Route]

The resolver:

  1. Recursively scans the provided root directory.
  2. Ignores:

    • Non-PHP files
    • Directories
    • The vendor/ directory
  3. Extracts the Fully Qualified Class Name (FQCN).
  4. Uses PHP ReflectionClass to inspect attributes.
  5. Returns a unique list of valid controllers.

๐Ÿ— Architecture

This keeps your routing system:


๐Ÿงช Testing

The package includes automated tests that verify:

Example test scenario:


๐Ÿ“ฆ Package Structure


๐Ÿค Contributing

To contribute:

  1. Fork the repository.
  2. Improve or extend the resolver logic.
  3. Add or update tests.
  4. Submit a Pull Request.

๐Ÿ“„ License

This project is licensed under the MIT License.


Maintained by Zgenius Matondo GitHub: https://github.com/zgeniuscoders


All versions of controller with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
mitsuki/http Version ^1.0
mitsuki/attributes Version ^1.0
mitsuki/contracts 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 mitsuki/controller contains the following files

Loading the files please wait ...