Download the PHP package jenssegers/optimus without Composer

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

Optimus id transformation

Packagist Downloads Build Coverage

With this library, you can transform your internal id's to obfuscated integers based on Knuth's integer hash. It is similar to Hashids, but will generate integers instead of random strings. It is also super fast.

Installation

Install using composer:

If you will be running your code on a 32 bit system or will be working with large prime numbers it is suggested that you install the GMP extension. For debian/ubuntu you can install the extension with one of these commands:

Usage

To get started you will need 3 things;

Luckily for you, I have included a console command that can do all of this for you. To get started, just run the following command:

If you prefer to choose your own prime number (from this list for example), you can pass it to the command to calculate the remaining numbers:

Using those numbers, you can start creating instances of Optimus($prime, $inverted, $random):

NOTE: Make sure that you are using the same constructor values throughout your entire application!

Encoding and decoding

To encode id's, use the encode method:

To decode the resulting 1535832388 back to its original value, use the decode method:

Framework Integrations

Laravel

This is an example service provider which registers a shared Optimus instance for your entire application:

Once you have created the service provider, add it to the providers array in your config/app.php configuration file:

Laravel's automatic injection will pass this instance where needed. Example controller:

More information: https://laravel.com/docs/5.3/container#resolving

Third-party integrations

Security contact information

To report a security vulnerability, follow these steps.

License

The MIT License.


All versions of optimus with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4||^8.0
phpseclib/phpseclib Version ^3.0
symfony/console Version ^5.0||^6.0||^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 jenssegers/optimus contains the following files

Loading the files please wait ....