Download the PHP package cosmologist/gears without Composer

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

PHP-Gears - handy helper library for PHP and Symfony

Installation

Array functions

Get an item from the array by key

Adds a value to an array with a specific key only if key not presents in an array

It's more intuitive variant to <code>$array += [$key => $value];

Push element onto the end of array and returns the modified array

Prepend element to the beginning of an array and returns the modified array

Calculate the average of values in an array (array_avg)

Check if array is associative

Check if a value exists in an array

Inserts an array after the key

Inserts an array before the key

Convert list of items to ranges

Unset array item by value

Calculate the standard deviation of values in an array

Cast to an array

Behavior for different types:

Get the array encoded in json

If encoded value is false, true or null then returns empty array.
JSON_THROW_ON_ERROR always enabled.

Callable functions

Determine if a callable a closure

Determine if a callable a function

Determine if a callable a method

Determine if a callable a static method

Get suitable reflection implementation for the callable

Class functions

Get the class or an object class short name

Get the class and the parent classes

Get the class and the parent classes

Get the corresponding basic enum case dynamically from variable

Basic enumerations does not implement from() or tryFrom() methods, but it is possible to return the corresponding enum case using the constant() function.

File functions

Get the extension of a file name

Write a string to a file and create the file directory recursively if it does not exist

Get the path to the file with $name inside the system temporary directory

Determine if the path an absolute path

Join the paths into one and fix the directory separators

Fix the directory separators (remove duplicates and replace with the current system directory separator)

Guess the file extensions of the file

Guess the file extension of the file

Guess the mime-type of the file

Number functions

Parse a float or integer value from the argument

Remove all characters except digits, +-.,eE from the argument and returns result as the float value or NULL if the parser fails.

Parse a float value from the argument

Remove all characters except digits, +-.,eE from the argument and returns result as the float value or NULL if the parser fails.

Parse a integer value from the argument

Remove all characters except digits, plus and minus sign and returns result as the integer value or NULL if the parser fails.

Returns fractions of the float value

Checks if the value is odd

Checks if the value is even

Round to nearest multiple

Round down to nearest multiple

Round up to nearest multiple

Spell out

Division with zero tolerance

Percent calculation

The first argument is a value for calculating the percentage. The second argument is a base value corresponding to 100%.

Unsign a number

A negative value will be converted to zero, positive or zero value will be returned unchanged.

Converts a number to string with sign.

Object functions

Read the value at the end of the property path of the object graph

Uses Symfony PropertyAccessor

Read the value of internal object property (protected and private)

Read ocramius

Get the values of the property path of the object recursively

Read ocramius

Set the value at the end of the property path of the object graph

Uses Symfony PropertyAccessor

Write the value to internal object property (protected and private)

Read ocramius

Call the internal object method (protected and private) and returns result

Read ocramius

Get a string representation of the object or enum

PHP default behavior: if the method is not defined, an error (Object of class X could not be converted to string) is triggered.

Cast an object or a FQCN to FQCN

Returns the result of __toString or null if the method is not defined.
PHP default behavior: if the method is not defined, an error (Object of class X could not be converted to string) is triggered.

String functions

Determine if a given string contains a given substring

Simple symmetric decryption of a string with a key (using libsodium)

Simple symmetric encryption of a string with a key (using libsodium)

Convenient way to perform a regular expression match

Default behaviour like preg_match_all(..., ..., PREG_SET_ORDER)

Exclude full matches from regular expression matches

Get only first set from regular expression matches (exclude full matches)

Get only first match of each set from regular expression matches (exclude full matches)

Get only first match of the first set from regular expression matches as single scalar value

Replace first string occurrence in a string

Wrap string

Guess the MIME-type of the string data

Guess the file extension from the string data.

Check if a string is a binary string

Convert string to CamelCase

Convert string to snake_case

ltrim()/rtrim()/trim() replacements supports UTF-8 chars in the charlist

Use these only if you are supplying the charlist optional arg and it contains UTF-8 characters. Otherwise trim will work normally on a UTF-8 string.

Split text into sentences

returns

Split text into words

Remove word from text

Doctrine utils

DoctrineUtils activation

Manually instance a DoctrineUtils

Register DoctrineUtils as a service with Symfony DI

Get metadata for a persistent object or a persistent object class

Get real class of a persistent object (resolve a proxy class)

Check if an object, or an object class persistent (managed by the Doctrine)

Get an identifier field name of the Doctrine object

Get an identifier value of the Doctrine object

Merge multiple Doctrine\Common\Collections\Criteria into a new one

Add a join to a QueryBuilder with support of the nested join (e.g. "contact.user.type")

Add a join to a QueryBuilder once and returns an alias of join

Get a target class name of a given association path recursively (e.g. "contact.user")

Symfony ExpressionLanguage utils

Create an ExpressionFunction from a callable

For example, this can be useful for injecting simple objects (like ValueObject) into a Symfony service container

Symfony Forms utils

Convert domain model constraint violation to the form constraint violation

It's maybe useful when you validate your model from form on the domain layer and want to map violations to the form.

Trait with a method implementing DataMapperInterface::mapDataToForms with default behavior

This is convenient for mapping of form data to a model via DataMapperInterface::mapFormsToData(), for example, to create a model via a constructor, in this case, the mapping of model data to a form via DataMapperInterface::mapDataToForms() will remain unchanged, and you cannot not define it, since it is required by the DataMapperInterface.

Symfony Framework utils

Configure your Symfony application as a bundle using service container extension and configuration

Symfony Messenger utils

Assert that a symfony messenger command (a command bus message) execution will throw an exception

Symfony Messenger transport to redispatch messages on kernel.terminate event

It's a convenient way to speed up your app response to clients by scheduling hard tasks after the server response, thanks to the kernel.terminate event.

Firstly, you should enable this transport:

Configure a messenger:

and

Symfony Pagination utils

Twig-based pagination (Bootstrap friendly)

Before use, you should register @Gears as Twig namespace

Symfony PropertyAccess utils

Get the values of the property path of the object or of the array recursively

Symfony Security utils

A SuperUserRoleVoter brings a ROLE_SUPER_USER, which effectively bypasses any, and all security checks

Enable the ROLE_SUPER_USER

Check if ROLE_SUPER_USER granted (e.g. inside a controller)

Symfony Test utils

Add a specified HTTP-header to the kernel-browser request

Symfony Validator utils

Simple and convenient way instance of ValidationFailedException with single ConstraintViolation


All versions of gears with dependencies

PHP Build Version
Package Version
No informations.
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 cosmologist/gears contains the following files

Loading the files please wait ....