Download the PHP package yassinebenaid/eldia without Composer

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

Eldia

Eldia is a lightweight PHP package that provides developers with a set of extra helpers to simplify common programming tasks. The library is designed to be easy to use, with an elegant and intuitive syntax that makes it easy to add powerful functionality to your PHP applications.

The Eldia package includes a variety of helpers that can be used for tasks like working with arrays, manipulating strings, generating random data, dealing with exceptions and more. These helpers are designed to be easy to integrate into your code, and they can help you to write cleaner, more efficient PHP code.

installation

Features

Promises

have you used Javascript promises, if so , then you probably liked the functionality they give , and how great they are . now you can use them in php like this :

 use Eldia\Promise\Promise;

 Promise::make(function ($success, $reject) {

        if (0) {
            $success('hello world');
        } else {
            $reject('error');
        }
    })

        ->then(fn ($message) => print($message), fn ($reason) => print($reason))

        ->catch(fn ($exception) => print($exception->getMessage()));

you can use how many then you like , everytime you use it , you have access to the latest returned data , see example

Promise::make(function ($success, $reject) {

    $var = 5 + 5;

    if ($var === 10) $success($var);
    else $reject($var);
})
  ->then(fn ($data) => $data + 5)
  ->then(fn ($data) =>  print  $data) // 15

that's available in both , success and reject callbacks, and you can even avoid using the reject at all :

 Promise::make(function ($success) {

        if (0) {
            $success('hello world');
        } else{
            // do somthing
        }
    })

        ->then(fn ($message) => print($message))

during the promise callbacks , you're safe from all types of errors , even the syntax errors , which means that whatever happend in the callbacks, no error will occur , it will just stop executing the callbacks, but , for some reason you want to execute some code when an error occurs , you can use catch ,

 Promise::make(function ($success) {

        if (0) {
            $success('hello world');
        } else{
            throw new Exception('error');
        }
    })

        ->catch(fn ($exception) => print($exception->getMessage())) // prints "error"

you can even catch specific error by just typing hint the exception type , typed exception will only be exceuted if it matches the type :

 Promise::make(function ($success) {

    $str = "baz";

    if ($str === "foo") {
        $success('hello world');
    } else {
        throw new ValidationException('error');
    }
})

    ->catch(fn (AuthException $exception) => print($exception->getMessage())) // won't works
    ->catch(fn (ValidationException $exception) => print($exception->getMessage())); // prints "error"

All versions of eldia with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
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 yassinebenaid/eldia contains the following files

Loading the files please wait ...