Skip to content

Commit

Permalink
Port over from php-helper: MULTIPLE_TRANS
Browse files Browse the repository at this point in the history
  • Loading branch information
repat committed Sep 16, 2019
1 parent 6aab35d commit 571b30f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
3 changes: 2 additions & 1 deletion README.md
Expand Up @@ -219,6 +219,7 @@ extract_inline_img("<img src='data:image/jpeg;base64,...>", '/var/www/htdocs/lar
* `HTTP_VERBS_LARAVEL`: [all, get, head, post, delete, options, put, patch]
* `REGEX_IMG_BASE64_SRC`: Regular Expression used to find a base64 encoded image in HTML text
* `REGEX_IMG_BASE64_REPLACE`: Regular Expression used to replace a base64 encoded image in HTML text
* `MULTIPLE_TRANS`: 2
## Contributors
* https://github.com/bertholf
Expand All @@ -227,7 +228,7 @@ extract_inline_img("<img src='data:image/jpeg;base64,...>", '/var/www/htdocs/lar
* MIT, see [LICENSE](https://github.com/repat/laravel-helper/blob/master/LICENSE)
## Version
* Version 0.2
* Version 0.2.1
## Contact
#### repat
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Expand Up @@ -4,14 +4,14 @@
"keywords": ["laravel", "helper", "files", "array", "database", "strings", "date"],
"homepage": "https://repat.de",
"license": "MIT",
"version" : "0.2",
"version" : "0.2.1",
"authors": [
{"name": "repat", "email": "repat@repat.de"}
],
"require": {
"illuminate/database": "5.*|6.*|7.*",
"php": ">=7.2",
"repat/php-helper": "^0.1"
"repat/php-helper": "^0.1.3"
},
"autoload": {
"files": [
Expand Down
16 changes: 16 additions & 0 deletions src/defines.php
Expand Up @@ -18,6 +18,7 @@
| Regex
|--------------------------------------------------------------------------
*/

if (! defined('REGEX_IMG_BASE64_SRC')) {
/**
* String to parse a base64 encoded inline image
Expand All @@ -33,3 +34,18 @@
*/
define('REGEX_IMG_BASE64_REPLACE', '/src=(\"data:image\/[a-zA-Z]*;base64,[^\"]*)\"/');
}

/*
|--------------------------------------------------------------------------
| Misc
|--------------------------------------------------------------------------
*/

if (! defined('MULTIPLE_TRANS')) {
/**
* Minimum for trans_choice() to trigger the plural version
*
* @var int
*/
define('MULTIPLE_TRANS', 2); // at least 2 is multiple
}

0 comments on commit 571b30f

Please sign in to comment.