Download the PHP package inetprocess/transformation without Composer

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

Build Status Scrutinizer Code Quality Code Coverage Build Status SensioLabsInsight

inetprocess/transformation

Inspired by Respect/Validation, that library transforms an input string (or float / int / bool) to an output string, after applying rules.

The benefit using it is that it a generic wrapper for any kind of transformation. Also it throws Exceptions and allows to chain the transformations.

Usage

It's pretty simple to use. suppose you need to transform a date "31-12-2012" to another format such as "2012-12-31". Just do:

Now if you need to change the format then the Timezone:

Transformation Rules

For now there is only a few rules. I'll add more later, and don't hesitate if you want to contribute.

Callback(string $functionName, [$param1, $param2, ...])

Call any php function on input. The input will be passed as the last argument of the function.

CopyFileToUuid(string $sourceDir, string $destinationDir)

Copy a file with a filename to a UUID generated name. Return the generated UUID. php T::Concat('REF')->transform('1234'); // REF1234 T::Concat('REF', 'AB')->transform('1234'); // REF1234AB



## Date(string $inputFormat, string $outputFormat)
Transforms a date from a format to another.

_See example above_

## Explode(string $delimiter)
Explode a string to an array using a delimiter. Uses `explode` function from PHP.
It returns an array.

## Htmlspecialchars([array $flags, string $encoding, bool $double_encoding])
Encode special chars. Uses `htmlspecialchars` function from PHP.

## HtmlspecialcharsDecode([array $flags])
Decode special chars. Uses `htmlspecialchars_decode` function from PHP.

## Implode(string $delimiter)
Join an array elements to a string. Uses `implode` function from PHP.

## Map(array $mapping)
Try to replace the input with the value in the mapping.
It can also work with an array as input.
Values not found in mapping are return without tranformations

## MimeType([string $root])
Return the MimeType of the file.
The first optional parameter allow to specify a root directory prepend to the filename

## NormalizeURL(string $protocol)
Prepend a default protocol if not present to any url.

## Replace(string $search, string $replace)
Replace a string by another (does the same than str_replace).

## ReplaceRegexp(string $pattern, string $replacement)
Replace a pattern by a replacement (does the same than preg_replace).

## Slugify()
Uses [Cocur\Slugify](https://github.com/cocur/slugify) to Slugify a string.

## SetType()
Uses settype from PHP for type casting.

## SugarCRMMapMultiEnum(array $mapping, [array $options])
Map multiple values from a string or an array
and return a string encoded for database storage of SugarCRM multi enum field.
String are exploded first with the default separator `|`.
You can set the following options
* `separator`: Separator to use to explode input string. Default: `|`
* `from_multi_enum`: If true parse the input string as a SugarCRM multi enum field. Default: `false`

## Timezone(string $inputFormat, string $targetTimezone, [string $currentTimezone])
Change the Timezone of a Date by providing the format, the target Timezone and optionnaly the timezone for the current date.

_See example above_

All versions of transformation with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3
cocur/slugify Version ^1.2
ramsey/uuid Version ^2.9
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 inetprocess/transformation contains the following files

Loading the files please wait ....