Download the PHP package ohchiko/randomizer without Composer

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

Randomizer

Randomizer is a php helper that helps your application to generate a random string.

This package is initially comes from an idea to generate a user's password.

Installation

Simply add the package to your composer.json file and run composer update.

Usage

To generate a random string, simply add below line to your code.

It will return a string containing random words concatenated with random punctutations. Below is the example result.

If you want to change the amount of words and/or punctuations in the result string, you may supply the amount in the method.

How It Works

Randomizer is generating a string which contains random words and random punctuations.

The words and punctuations are taken from a set. There are wordset and punctset which stores a list of words and punctuations.

By default, wordset are taken from one of wordset files which identified by the language used. And punctset is taken from an array of punctuations.

For example, the current available languages are: id and en, and the default language used is id. The wordset file for those languages are: id_wordset and en_wordset. So, when generate method called, it will take a random word(s) from id_wordset file because the language used is id.

The amount of words and punctuations to be taken is identified by the generate method. The default value for both words and punctuations amount is 3. See Available Methods section for detail.

You can change the language by calling the setLanguage method before the generate method. The argument supplied can be the language constants (which currently are LANG_ID and LANG_EN) or the language code (ex. en).

If you prefered using your own wordset and/or punctset, you can tell Randomizer to use that instead by calling the setCustomWordset and/or setCustomPunctset method.

After that, you can check the customized wordset and punctset by calling getCustomWordset and/or getCustomPunctset method.

Available Methods

Besides the main method generate, there also a number of other methods available.

Available Language Constants

The language constants are hardcoded, so in case to add a new wordset language, I need to update the code to add that language constant.

Testing

You can use phpunit from the package root to run the test file.

Support

If you ever encountered any issues while using this package, you may create a new issue report. If you have any idea on supporting this package (it may be a new wordsets, bug fixes, new feature, etc.), you may create a pull request and I will review it before it can be merged.

Please remember that this package is comes from an idea of creating a random user's password, so this package may not lead to what it is should be. This package soon may be a real randomizer, so please support me. :)

License

The MIT License (MIT). Please see LICENSE file for more information.

Credits


All versions of randomizer with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1.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 ohchiko/randomizer contains the following files

Loading the files please wait ....