Download the PHP package kariricode/exception without Composer

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

KaririCode Framework: Exception Component

PHP Docker PHPUnit

A comprehensive and flexible exception handling component for PHP, part of the KaririCode Framework. It provides a structured approach to error management, enhancing the robustness and maintainability of your applications.

Table of Contents

Features

Installation

You can install the Exception component via Composer:

Requirements

Usage

Basic Usage

Using Pre-defined Exceptions in Your Code

The KaririCode Exception component provides a variety of pre-defined exceptions that you can use to handle common error scenarios in a professional and structured manner. Below is an example of how to use these exceptions in an object-oriented context.

Advanced Usage

Create custom exceptions by extending the base classes:

Using custom exceptions in your application:

Error Code Range Table

Here is a proposed table for the error code ranges. Each range is assigned to a group of related errors, allowing better organization and identification of errors in the system.

Error Code Range Table

Range Error Group Description
1000 - 1099 Authentication Errors Errors related to authentication and login
1100 - 1199 Authorization Errors Errors related to permissions and roles
1200 - 1299 Cache Errors Errors related to cache operations
1300 - 1399 Configuration Errors Errors related to configuration settings
1400 - 1499 Container Errors Errors related to dependency injection and services
1500 - 1599 Database Errors Errors related to database connections, queries, etc.
1600 - 1699 Event Errors Errors related to event handling and dispatching
1700 - 1799 External Service Errors Errors related to external API calls and services
1800 - 1899 File System Errors Errors related to file operations (reading, writing)
1900 - 1999 Input/Validation Errors Errors related to invalid input or validation
2000 - 2099 Localization Errors Errors related to localization and translations
2100 - 2199 Middleware Errors Errors related to middleware processing
2200 - 2299 Network Errors Errors related to network operations
2300 - 2399 Queue Errors Errors related to queuing systems
2400 - 2499 Routing Errors Errors related to routing and HTTP methods
2500 - 2599 Runtime Errors General runtime errors
2600 - 2699 Encryption Errors Errors related to encryption and decryption
2700 - 2799 Security Errors Errors related to security, access control, etc.
2800 - 2899 Session Errors Errors related to session handling
2900 - 2999 System Errors Errors related to system resources and environment
3000 - 3099 Template Errors Errors related to template rendering and loading
3100 - 3199 Validation Errors Errors related to data validation
4000 - 4099 Business Logic Errors Custom errors for business logic violations

Explanation of Each Range:

  1. 1000 - 1099: Authentication Errors

    • Errors related to user authentication, such as invalid credentials, locked accounts, or missing two-factor authentication.
  2. 1100 - 1199: Authorization Errors

    • Errors related to insufficient permissions or missing roles during authorization processes.
  3. ... (Same as previous ranges)

  4. 3100 - 3199: Validation Errors

    • Errors related to data validation.
  5. 4000 - 4099: Business Logic Errors
    • Custom error codes for business logic violations specific to your application.

This structure allows you to easily categorize and expand error codes in the future, keeping the error-handling system organized.

Available Exception Types

Each exception type is designed to handle specific error scenarios. For detailed information on each exception type, please refer to the documentation.

Integration with Other KaririCode Components

The Exception component is designed to work seamlessly with other KaririCode components:

Development and Testing

For development and testing purposes, this package uses Docker and Docker Compose to ensure consistency across different environments. A Makefile is provided for convenience.

Prerequisites

Development Setup

  1. Clone the repository:

  2. Set up the environment:

  3. Start the Docker containers:

  4. Install dependencies:

Available Make Commands

For a full list of available commands, run:

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support and Community


Built with ❤️ by the KaririCode team. Empowering developers to handle errors effectively and build more resilient PHP applications.


All versions of exception with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
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 kariricode/exception contains the following files

Loading the files please wait ....