Download the PHP package brenno-duarte/modern-php-exception without Composer

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

Modern PHP Exception

Display PHP errors and exceptions in a modern and intuitive way!

Requirements

Installing via Composer

Use the command below:

How to use

You only need to call a single method as shown below.

From there, all errors and exceptions that are triggered will be displayed through the ModernPHPException component.

You can change the return, title and theme settings in the class constructor as shown in the items below.

YAML configuration

You can customize the exception title, enable dark mode and also enable production mode. Use the example file config.example.yaml or create a new one.

Changing the page title

Enabling dark mode

Enabling production mode

To change the message, change the error_message variable:

Load CSS files if there is no internet connection

Enabling Log file

Enable occurrences

If you want to have a history of all exceptions and errors that your application displays, you can enable the occurrences using the enableOccurrences method:

Don't forget to configure the database in the config.example.yaml file.

Creating a solution for an exception

If you are creating a custom exception class, you can add a solution to resolve this exception.

For that, use the static getSolution method implementing the SolutionInterface interface:

You can test using a new class:

Functions

Modern PHP Exceptions has some functions to help you debug your code. The available functions are:

In terminal, you can simple hide or show some object attribute using a Doc block flag:

@dumpignore-inheritance Hides inherited class properties.
@dumpignore-inherited-class Hides the class name from inherited properties.
@dumpignore-private Show all properties except the private ones.
@dumpignore-protected Show all properties except the protected ones.
@dumpignore-public Show all properties except the public ones.
@dumpignore Hide the property the Doc comment belongs to.

Logger

If you want to record a log to a file, you can use the Debug class. To record a log, use the log method.

You can register the file and line on which this method is being called.

And to retrieve the logs that were recorded in a file, use the get method.

Test

If you want to test the component, use the code below in your index.php.

License

MIT


All versions of modern-php-exception with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
ext-mbstring Version *
ext-pdo Version *
symfony/yaml Version ^7.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 brenno-duarte/modern-php-exception contains the following files

Loading the files please wait ....