Download the PHP package brio/helpers without Composer

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

My personal helpers

These are some of the functions I use intensively for my projects.

As I don't want my functions to interfere with any of yours, they all use the Embryo namespace.

Array helpers

arrayDepth

This function returns the depth of a given array.

WARNING: a recursive array could currently cause an infinite loop (See issue #29).

Command Line Interface (CLI) helpers

These helpers are made specifically for command-line interfaces (CLI)

cliArguments

Just add $args = Embryo\cliArguments(); at the beginning of your CLI script, and use your CLI script as you do with a bash script.

The array $args will now contain :

You can also give an array of allowed arguments in the first parameter of cliArguments(). Any parameter other than the ones listed will generate and error and die.

cliClear

Calling this function clears the command line interface. Tested with Windows and Unix environments.

cliIsInterface

Tells whether the current script is called in a command-line interface.

cliProgressBar

Displays a nice progressBar.

Since the display is updated less frequently than the spinner, it is slightly quicker than cliSpinner.

cliPrompt

Prompts a question to the user, and returns a boolean: true if the answer is the first letter or the first answer, false in every other case.

If no answers are set, default answers are [y]es / [n]o

Will display Do you want to continue ? [y]es / [n]o, and will return true if the answer is either y or yes.

Will display Do you want to continue ? [c]ontinue / [a]bort, and will return true if the answer is either c or continue.

cliQuestion

Displays a question to the user, and returns its answer as a string.

cliSpinner

Adds a nice spinner to your loops.

cliTable

Displays an array as a readable table.

By default, the first value's keys will be used as header names.

will be displayed like this :

Debug helpers

d

Dumps a variable. The second parameters allows to dump only if the corresponding $_REQUEST ($_GET or $_POST) parameter exists, and is equivalent to true.

dd

Like \Embryo\d(), this function dumps a variable. It also dies just after.

If nothing has been sent to the browser before the call, and the data is an array or an object, a json header will be sent and the data will be displayed as a json string.

pp

Pretty prints a given value by wrapping a var_dump into <pre> tags

SEO helpers

seoUrl

Creates an URL from any UTF-8 compatible given string.

It removes the accents, and replaces all non-alphanumeric character by hyphens.

unparseUrl

This method is intended to be a reverse of PHP's builtin parse_url. The parsed url's query key can be a string or an array.

string helpers

strBase64ImageEncode

Returns the correct base64 value for a given image path.

strComplete

Completes a string to a given length. If the length is shorter than the string, it will return the full, non-altered string.

strCut

Cuts a text at a given number of characters.

If $isTotalLength is set to true, the final maximum length will be $length. If it set to false, the final maximum length will be $length + strlen($end).

If $length is >= 40, the function will not cut into a word, but just after the previous word.

strIsFourByteUtf8

Tells whether a string contains four-byte UTF-8 characters

strIsJson

Tells whether a given string is valid JSON

strIsUtf8

Tells whether a given string is encoded in UTF-8.

strIsXml

Returns whether the given string contains valid XML code (including HTML)

strRemoveAccents

Removes all accented characters from a given string.

strRemoveFourByteUtf8Characters

Removes all four-bytes UTF-8 characters from a given UTF-8 string.

It can be used to prevent Illegal mix of collation errors in your database queries, for example, if your database is not set to UTF8MB4.


All versions of helpers with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
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 brio/helpers contains the following files

Loading the files please wait ....