Download the PHP package dr2gsistemas/xpress without Composer

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

Xpress - Router REST API para PHP 8.4

Xpress es un router ligero para crear APIs REST con PHP 8.4, inspirado en la sintaxis de Express.js para Node.js. Utiliza atributos PHP para definir rutas de forma limpia y declarativa.

Características

Requisitos

Instalación

CLI - Herramienta de Línea de Comandos

Xpress incluye un CLI para ayudarte con la configuración y desarrollo.

Comandos Disponibles

Comando Descripción
xpress htaccess Genera archivo .htaccess para Apache
xpress serve Inicia servidor de desarrollo PHP
xpress init Inicializa estructura de proyecto
xpress route:list Lista rutas registradas
xpress help Muestra ayuda

Generar .htaccess

Archivo .htaccess generado:

Iniciar Servidor de Desarrollo

Salida:

Inicializar Proyecto

Crea:

Listar Rutas

Uso Básico

1. Instalación con Composer y estructura del proyecto

2. Punto de entrada (public/index.php)

3. Definir rutas (src/routes.php)

Controladores con Atributos

Estructura de controlador

Registrar controladores

Middlewares

Middleware de autenticación

Middleware de logging

Middleware de rate limiting

Middleware CORS

Usar middlewares

Grupos de Rutas

Grupo con middlewares compartidos

API Reference

XRouter

XRequest

XResponse

Funciones Helper

Ejemplo Completo de API

Probar la API

Testing

Patrón Result

Xpress incluye un patrón Result para manejar respuestas de forma funcional, inspirado en Rust y Haskell. Permite retornar éxito o error de manera uniforme y encadenable.

XResult

XError - Helpers de Códigos HTTP

Métodos de XResult

Encadenamiento Funcional

Convertir a Response

Trait XResultController

Usa el trait en controladores para helpers integrados:

Helpers de Result

Ejemplo Completo con Result

Compatibilidad hacia atrás

Los controladores pueden retornar XResponse directamente si no usan el patrón Result:

Códigos de Estado HTTP

Código Nombre Uso común
200 OK Respuesta exitosa
201 Created Recurso creado
204 No Content Eliminado sin contenido
400 Bad Request Datos inválidos del cliente
401 Unauthorized Sin autenticación
403 Forbidden Sin permisos
404 Not Found Recurso no existe
409 Conflict Conflicto de datos
422 Unprocessable Entity Validación fallida
429 Too Many Requests Rate limit excedido
500 Internal Server Error Error del servidor

Licencia

MIT License - ver archivo LICENSE para más detalles.

Contributing

  1. Fork el repositorio
  2. Crea una rama para tu feature (git checkout -b feature/nueva-funcion)
  3. Commit tus cambios (git commit -am 'Agregar nueva función')
  4. Push a la rama (git push origin feature/nueva-funcion)
  5. Crea un Pull Request

All versions of xpress with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
psr/http-message Version ^2.0
guzzlehttp/psr7 Version ^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 dr2gsistemas/xpress contains the following files

Loading the files please wait ...