Download the PHP package stougeiro/support without Composer

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

PHP PHPStan-Level Pest-php License

Support

A lightweight collection of utility helpers designed to provide small, predictable, and strongly typed building blocks for PHP applications. Each helper focuses on a single responsibility, offering safe and consistent operations for arrays, strings, files, directories, tokens, dates, and more.

✨ Features

📦 Installation

Install via Composer:

Available Classes

Arr

Array manipulation: safe wrapping, flattening, dot notation, and polyfills for PHP 8.4/8.5 functions.

Method Description
empty() Checks whether an array is empty
kshift() Removes and returns the first element (queue shift)
kpop() Removes and returns the last element (stack pop)
grab() Removes and returns a value by key
wrap() Wraps a value in an array (null -> empty array)
keysExists() Checks whether all given keys exist
only() Returns a new array containing only the given keys
except() Returns a new array excluding the given keys
flatten() Flattens a nested array into a single dimension
any() Polyfill for array_any() (PHP 8.4)
all() Polyfill for array_all() (PHP 8.4)
find() Polyfill for array_find() (PHP 8.4)
findKey() Polyfill for array_find_key() (PHP 8.4)
first() Polyfill for array_first() (PHP 8.5)
last() Polyfill for array_last() (PHP 8.5)
dot() Flattens a nested array into dot notation
undot() Converts a dot notation array back into a nested array
random() Returns N random key => value pairs

Base64

URL-safe Base64 encoding and decoding following RFC 4648 section 5.

Method Description
encode() Encodes a string to URL-safe Base64
decode() Decodes a URL-safe Base64 string

Date

Date validation, conversion, diff, and relative time strings.

Method Description
isValidDate() Validates a date string in Y-m-d format
isValidTime() Validates a time string in HH:MM or HH:MM:SS format
isValidDateTime() Validates a datetime string
convert() Converts a date string from one format to another
diff() Returns the difference between two dates as int values
withTimezone() Executes a callback with a specific timezone, then reverts
ago() Returns a human-readable relative time string for past dates
fromNow() Returns a human-readable relative time string for future dates

FileSystem

File and directory operations: size, copy, mkdir, glob, MIME detection.

Method Description
absolute() Normalizes a path to absolute form without touching the filesystem
size() Returns the size of a file or directory in bytes
unit() Converts bytes to a human-readable string (KB, MB, GB, TB)
mkdir() Creates a directory recursively
rrmdir() Recursively removes a directory and all its contents
copy() Copies a file or directory to a new location
rglob() Recursively globs files matching a pattern
mime() Returns the MIME type of a file

Password

Password hashing, verification, upgrade, strength scoring, and validation.

Method Description
hash() Hashes a password using bcrypt or argon2id
verify() Verifies a password against a hash
needsRehash() Checks if a hash needs rehashing
upgrade() Upgrades a password hash if needed
algo() Detects the algorithm used in a password hash
strength() Returns a strength score from 0 (very weak) to 4 (very strong)
strengthLabel() Returns a human-readable label for a strength score
validate() Validates a password against a set of rules

Str

String inspection, transformation, and normalization.

Method Description
empty() Checks whether a string is empty or whitespace-only
ttrim() Trims and collapses internal whitespace into single spaces
onlyNumbers() Removes all non-digit characters from a string
mask() Applies a mask template to a value string (multibyte-safe)
slugify() Converts a string to a URL-friendly slug with transliteration
isFqcn() Validates whether a string is a valid fully-qualified class name

TTL

Time-to-live duration helpers with fixed constants.

Method Description
none() Returns 0 (immediate expiration)
seconds() Converts seconds to an integer TTL
minutes() Converts minutes to an integer TTL in seconds
hours() Converts hours to an integer TTL in seconds
days() Converts days to an integer TTL in seconds
weeks() Converts weeks to an integer TTL in seconds
months() Converts months to an integer TTL in seconds (30 days/month)
years() Converts years to an integer TTL in seconds (365 days/year)
forever() Returns PHP_INT_MAX (never expires)

🧠 Why?

Modern applications often need small, reliable helpers — but frameworks tend to ship bloated or inconsistent utilities. Support solves this by providing:

It's a foundation you can trust, especially when building systems that value clarity, correctness, and long-term maintainability.

🤝 Contributing

Contributions are welcome. Feel free to open issues or submit pull requests.



All versions of support with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
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 stougeiro/support contains the following files

Loading the files please wait ...