Download the PHP package makis83/helpers without Composer

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

CI PHPStan Coverage

Makis83 PHP Helpers

A collection of PHP helper classes for files, texts, images etc.

Installation

Use composer to install Makis83 PHP Helpers:

Requirements

Documentation

Data Helper

isJson(string $text): bool

Check if the specified text is JSON.

jsonEncode(array $data, int $options = JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP): string

Encode array as JSON.

jsonDecode(string $data, bool $asArray = true): mixed

Decode the JSON-sequence.

valueToArray(array|null|bool|int|float|string $value, string $delimiter = ','): array

Convert value into array.

File Helper

fileExtension(string $path): string

Get file extension from a file with the given path.

fileName(string $path, bool $withExtension = true): string

Get file name from the given path.

isAbsolutePath(string $path, bool $allowSchemes = true): bool

Check if the specified path is an absolute path.

ensureDirectory(string $path, int $mode = 0775, ?string $owner = null, ?string $group = null): true

Create a directory with the given path if it doesn't exist.

removeDirectory(string $path): void

Remove directory and all its files and subdirs recursively.

sanitizeFilename(string $fileName, string $replacement = '_'): string

Sanitizes a filename by removing characters that are problematic for filesystems.

Html Helper

isHTML(string $text): bool

Detect whether the text is an HTML code.

secure(string $data, bool $forceHtml = true, bool $purify = true, ?string $charset = null): string

Secure the specified text data.

tidy(string $html, bool $repair = true, ?string $charset = null): string

Tidy the specified HTML code.

textToHtml(string $text, ?string $charset = null): string

Convert a plain text into HTML.

textTags(string $text): array

Get HTML tags used in the text.

Text Helper

setLeadingZeroes(int $number, int $numberLength = 2): string

Prepend the integer value with leading zeroes.

classNameToId(string $class): string

Convert class name (with or without namespace) to ID.

fixSpaces(string $text): string

Fixes issues with spaces, NBSPs etc.

Tests

Run the tests using PHPUnit and PHPStan:

or

License

This project is licensed under the MIT License.


All versions of helpers with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-mbstring Version *
ext-tidy Version *
ezyang/htmlpurifier Version dev-master
thecodingmachine/safe Version ^3.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 makis83/helpers contains the following files

Loading the files please wait ...