Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/flow-flo.../libs/cakephp/utility
File: README.md
[![Total Downloads](https://img.shields.io/packagist/dt/cakephp/utility.svg?style=flat-square)](https://packagist.org/packages/cakephp/utility)
[0] Fix | Delete
[![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](LICENSE.txt)
[1] Fix | Delete
[2] Fix | Delete
# CakePHP Utility Classes
[3] Fix | Delete
[4] Fix | Delete
This library provides a range of utility classes that are used throughout the CakePHP framework
[5] Fix | Delete
[6] Fix | Delete
## What's in the toolbox?
[7] Fix | Delete
[8] Fix | Delete
### Hash
[9] Fix | Delete
[10] Fix | Delete
A ``Hash`` (as in PHP arrays) class, capable of extracting data using an intuitive DSL:
[11] Fix | Delete
[12] Fix | Delete
```php
[13] Fix | Delete
$things = [
[14] Fix | Delete
['name' => 'Mark', 'age' => 15],
[15] Fix | Delete
['name' => 'Susan', 'age' => 30],
[16] Fix | Delete
['name' => 'Lucy', 'age' => 25]
[17] Fix | Delete
];
[18] Fix | Delete
[19] Fix | Delete
$bigPeople = Hash::extract($things, '{n}[age>21].name');
[20] Fix | Delete
[21] Fix | Delete
// $bigPeople will contain ['Susan', 'Lucy']
[22] Fix | Delete
```
[23] Fix | Delete
[24] Fix | Delete
Check the [official Hash class documentation](https://book.cakephp.org/3/en/core-libraries/hash.html)
[25] Fix | Delete
[26] Fix | Delete
### Inflector
[27] Fix | Delete
[28] Fix | Delete
The Inflector class takes a string and can manipulate it to handle word variations
[29] Fix | Delete
such as pluralizations or camelizing.
[30] Fix | Delete
[31] Fix | Delete
```php
[32] Fix | Delete
echo Inflector::pluralize('Apple'); // echoes Apples
[33] Fix | Delete
[34] Fix | Delete
echo Inflector::singularize('People'); // echoes Person
[35] Fix | Delete
```
[36] Fix | Delete
[37] Fix | Delete
Check the [official Inflector class documentation](https://book.cakephp.org/3/en/core-libraries/inflector.html)
[38] Fix | Delete
[39] Fix | Delete
### Text
[40] Fix | Delete
[41] Fix | Delete
The Text class includes convenience methods for creating and manipulating strings.
[42] Fix | Delete
[43] Fix | Delete
```php
[44] Fix | Delete
Text::insert(
[45] Fix | Delete
'My name is :name and I am :age years old.',
[46] Fix | Delete
['name' => 'Bob', 'age' => '65']
[47] Fix | Delete
);
[48] Fix | Delete
// Returns: "My name is Bob and I am 65 years old."
[49] Fix | Delete
[50] Fix | Delete
$text = 'This is the song that never ends.';
[51] Fix | Delete
$result = Text::wrap($text, 22);
[52] Fix | Delete
[53] Fix | Delete
// Returns
[54] Fix | Delete
This is the song
[55] Fix | Delete
that never ends.
[56] Fix | Delete
```
[57] Fix | Delete
[58] Fix | Delete
Check the [official Text class documentation](https://book.cakephp.org/3/en/core-libraries/text.html)
[59] Fix | Delete
[60] Fix | Delete
### Security
[61] Fix | Delete
[62] Fix | Delete
The security library handles basic security measures such as providing methods for hashing and encrypting data.
[63] Fix | Delete
[64] Fix | Delete
```php
[65] Fix | Delete
$key = 'wt1U5MACWJFTXGenFoZoiLwQGrLgdbHA';
[66] Fix | Delete
$result = Security::encrypt($value, $key);
[67] Fix | Delete
[68] Fix | Delete
Security::decrypt($result, $key);
[69] Fix | Delete
```
[70] Fix | Delete
[71] Fix | Delete
Check the [official Security class documentation](https://book.cakephp.org/3/en/core-libraries/security.html)
[72] Fix | Delete
[73] Fix | Delete
### Xml
[74] Fix | Delete
[75] Fix | Delete
The Xml class allows you to easily transform arrays into SimpleXMLElement or DOMDocument objects
[76] Fix | Delete
and back into arrays again
[77] Fix | Delete
[78] Fix | Delete
```php
[79] Fix | Delete
$data = [
[80] Fix | Delete
'post' => [
[81] Fix | Delete
'id' => 1,
[82] Fix | Delete
'title' => 'Best post',
[83] Fix | Delete
'body' => ' ... '
[84] Fix | Delete
]
[85] Fix | Delete
];
[86] Fix | Delete
$xml = Xml::build($data);
[87] Fix | Delete
```
[88] Fix | Delete
[89] Fix | Delete
Check the [official Xml class documentation](https://book.cakephp.org/3/en/core-libraries/xml.html)
[90] Fix | Delete
[91] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function