diff --git a/_common.php b/_common.php
index da8c3bcb..fecd45f7 100644
--- a/_common.php
+++ b/_common.php
@@ -2,8 +2,8 @@
if(!defined('ROOT')){
define('ROOT', '.');
}
-require(ROOT.'/f_config/config.php');
-require(ROOT.W.F_CONFIG.W.APP.PHP);
-require(ROOT.W.F_FUNC.W.FUNC.PHP);
+require_once(ROOT.'/f_config/config.php');
+require_once(ROOT.W.F_CONFIG.W.APP.PHP);
+require_once(ROOT.W.F_FUNC.W.FUNC.PHP);
CustomHeader();
diff --git a/che_close/d_setting/_common.php b/che_close/d_setting/_common.php
index 2b789212..57949e8d 100644
--- a/che_close/d_setting/_common.php
+++ b/che_close/d_setting/_common.php
@@ -2,8 +2,8 @@
if(!defined('ROOT')){
define('ROOT', '../..');
}
-require(ROOT.'/f_config/config.php');
-require(ROOT.W.F_CONFIG.W.APP.PHP);
-require(ROOT.W.F_FUNC.W.FUNC.PHP);
+require_once(ROOT.'/f_config/config.php');
+require_once(ROOT.W.F_CONFIG.W.APP.PHP);
+require_once(ROOT.W.F_FUNC.W.FUNC.PHP);
CustomHeader();
diff --git a/d_setting/_common.php b/d_setting/_common.php
index d9e9ed06..25378505 100644
--- a/d_setting/_common.php
+++ b/d_setting/_common.php
@@ -2,8 +2,8 @@
if(!defined('ROOT')){
define('ROOT', '..');
}
-require(ROOT.'/f_config/config.php');
-require(ROOT.W.F_CONFIG.W.APP.PHP);
-require(ROOT.W.F_FUNC.W.FUNC.PHP);
+require_once(ROOT.'/f_config/config.php');
+require_once(ROOT.W.F_CONFIG.W.APP.PHP);
+require_once(ROOT.W.F_FUNC.W.FUNC.PHP);
CustomHeader();
diff --git a/e_lib/plates.php b/e_lib/plates.php
index bd1f1534..88f1d1c8 100644
--- a/e_lib/plates.php
+++ b/e_lib/plates.php
@@ -11,4 +11,6 @@ include(__DIR__.'/plates/Template/Functions.php');
include(__DIR__.'/plates/Template/Name.php');
include(__DIR__.'/plates/Template/Template.php');
+class Plates extends League\Plates\Engine { }
+
?>
\ No newline at end of file
diff --git a/e_lib/utilphp-1.1.0/.coveralls.yml b/e_lib/utilphp-1.1.0/.coveralls.yml
deleted file mode 100644
index 6e649991..00000000
--- a/e_lib/utilphp-1.1.0/.coveralls.yml
+++ /dev/null
@@ -1 +0,0 @@
-service_name: travis-ci
\ No newline at end of file
diff --git a/e_lib/utilphp-1.1.0/.gitignore b/e_lib/utilphp-1.1.0/.gitignore
deleted file mode 100644
index a28cc36f..00000000
--- a/e_lib/utilphp-1.1.0/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-test.php
-build/*
-report/*
-tests/test*
diff --git a/e_lib/utilphp-1.1.0/.travis.yml b/e_lib/utilphp-1.1.0/.travis.yml
deleted file mode 100644
index bfce66e7..00000000
--- a/e_lib/utilphp-1.1.0/.travis.yml
+++ /dev/null
@@ -1,22 +0,0 @@
-language: php
-
-php:
- - 5.3
- - 5.4
- - 5.5
- - 5.6
- - hhvm
-
-matrix:
- allow_failures:
- - php: hhvm
-
-before_script:
- - pyrus install pear/PHP_CodeSniffer
- - wget -nc http://getcomposer.org/composer.phar
- - php composer.phar install --dev --no-interaction
- - mkdir -p build/logs
- - phpenv rehash
-
-after_script:
- - php vendor/bin/coveralls
diff --git a/e_lib/utilphp-1.1.0/CHANGELOG.md b/e_lib/utilphp-1.1.0/CHANGELOG.md
deleted file mode 100644
index 8cbd899f..00000000
--- a/e_lib/utilphp-1.1.0/CHANGELOG.md
+++ /dev/null
@@ -1,86 +0,0 @@
-Change Log
-==========
-
-1.1.0
------
-
-This release introduces a deprecation notice for `slugify()`, please update your code.
-
-* Added a cryptographically secure random string function `secure_random_string`. Thanks to @abhimanyusharma003 via [Pull Request #53](https://github.com/brandonwamboldt/utilphp/pull/53)
-* Added `limit_characters` and `limit_words` functions. Thanks to @abhimanyusharma003 via [Pull Request #55](https://github.com/brandonwamboldt/utilphp/pull/55)
-* Added `rmdir` method to recursively delete a directory. Thanks to @ARACOOOL via [Pull Request #56](https://github.com/brandonwamboldt/utilphp/pull/56)
-* Added `set_executable`, `set_readable`, `set_writable`, `directory_size`, `directory_contents` and `get_user_dir` functions. Thanks to @sergserg via [Pull Request #70](https://github.com/brandonwamboldt/utilphp/pull/70)
-* Changed parameter ordering for `slugify`, `$css_mode` is now the third argument. For backwards compatibility, the old order will still work but it will generate an `E_USER_DEPRECATED` warning. Thanks to @abhimanyusharma003 via [Pull Request #71](https://github.com/brandonwamboldt/utilphp/pull/71)
-* Added `match_string` method. Thanks to @abhimanyusharma003 via [Pull Request #72](https://github.com/brandonwamboldt/utilphp/pull/72)
-* Renamed internal methods (protected ones) for PSR-2 compliance
-* General performance improvements, code quality improvements, and increased unit test coverage (special thanks to @hopeseekr for getting us near 100% coverage)
-
-1.0.7
------
-
-* Added `fix_broken_serialization` to fix broken serialized strings (Thanks to @hopeseekr via [Pull Request #48](https://github.com/brandonwamboldt/utilphp/pull/48))
-* Fixed `get_current_url` appending port 80 or 443 when not needed (Thanks to @scottchiefbaker via [Pull Request #49](https://github.com/brandonwamboldt/utilphp/pull/49))
-* `var_dump` can now handle recursive data structures without crashing
-* `var_dump` code was minified and cleaned up
-* `array_flatten` was optimized (thanks to @hopeseekr via [Pull Request #47](https://github.com/brandonwamboldt/utilphp/pull/47))
-* `remove_accents` was completely rewritten and is now ~4x faster
-
-1.0.6
------
-
-* Added `start_with` function
-* Added `ends_with` function
-* Added `str_contains` function
-* Added `str_icontains` function
-* Added `get_file_ext` function
-* Fixing permissions on the files & directories
-* Fixing a bug with the include path of util.php
-
-1.0.5
------
-
-* [Issue #29](https://github.com/brandonwamboldt/utilphp/issues/29) Fixed error in `var_dump` if mbstring extension wasn't present
-* Adding Composer support
-* Updating license from GPL to MIT
-* Adding Changelog to project
-* Bumping minimum version to PHP 5.3.3
-
-1.0.4
------
-
-* [Issue #22](https://github.com/brandonwamboldt/utilphp/issues/22) Removed all superglobal *_get functions, you can use the modified array_get now
-* [Issue #22](https://github.com/brandonwamboldt/utilphp/issues/22) Modifed the behaviour of `array_get`, see documentation
-* [Pull Request #21](https://github.com/brandonwamboldt/utilphp/pull/21) Added multibyte support to html* functions
-* [Issue #9](https://github.com/brandonwamboldt/utilphp/issues/9) Removed the `str_to_utf8` function
-* [Issue #3](https://github.com/brandonwamboldt/utilphp/issues/3) Removed the `absint` function
-* Removed declare() from util.php to avoid errors
-* Updated PHPUnit tests to use PHPUnit 3.6
-
-1.0.3
------
-
-* [Issue #16](https://github.com/brandonwamboldt/utilphp/issues/16) Improved performance of `slugify`
-* [Issue #14](https://github.com/brandonwamboldt/utilphp/issues/14) Modified the regex for `seems_utf8` to be more accurate
-* [Issue #13](https://github.com/brandonwamboldt/utilphp/issues/13) Changed `validate_email` to be wrapper for `filter_var`
-* Added 'ok' to the list of yes words for `str_to_bool`
-* `str_to_bool` matches no followed by any number of 'o's
-
-1.0.2
------
-
-* [Issue #12](https://github.com/brandonwamboldt/utilphp/issues/12) `get_current_url` now includes the port and user/password if required
-* [Issue #11](https://github.com/brandonwamboldt/utilphp/issues/11) `human_time_diff` now uses the DateTime functions
-* [Issue #10](https://github.com/brandonwamboldt/utilphp/issues/10) `is_https` no longer checks the port as well
-
-1.0.1
------
-
-* [Issue #7](https://github.com/brandonwamboldt/utilphp/issues/7) Added the `$trust_proxy_headers` parameter to `get_client_ip`
-* [Issue #6](https://github.com/brandonwamboldt/utilphp/issues/6) Removed `is_isset` as the function did not work as intended
-* [Issue #6](https://github.com/brandonwamboldt/utilphp/issues/6) Removed `is_empty` as it is redundant, use ! with function calls instead
-* Fixed a bug with `get_gravatar`
-
-1.0.0
------
-
-* Initial release of util.php.
diff --git a/e_lib/utilphp-1.1.0/CONTRIBUTORS.md b/e_lib/utilphp-1.1.0/CONTRIBUTORS.md
deleted file mode 100644
index 7fadf04f..00000000
--- a/e_lib/utilphp-1.1.0/CONTRIBUTORS.md
+++ /dev/null
@@ -1,48 +0,0 @@
-# CONTRIBUTORS
-
-Util.php is the combined effort of many people who contributed new functions and features, bug fixes, tests, and documentation.
-
-# Maintainer / Lead
-
-* Brandon Wamboldt (http://brandonwamboldt.ca)
-
-## Third-Party Projects
-
-The following projects were fully or partially incorporated into util.php (and properly attributed).
-
-* IntToWords (https://github.com/hemant347/IntToWords)
-* LinkifyURL (https://github.com/jmrware/LinkifyURL)
-* URLify.php (https://github.com/jbroadway/urlify/)
-* Pure PHP http_build_url (https://github.com/jakeasmith/http_build_url)
-
-## Methods
-
-The following developers and/or companies helped contribute to building util.php.
-
-* PHP Experts, Inc. (http://www.phpexperts.pro/)
- - `array_flatten()`
- - `fix_broken_serialization()`
- - Lots of unit tests.
-* Tony Ferrara (ircmaxwell, http://blog.ircmaxell.com/)
- - `seemsUtf8Regex()`: http://stackoverflow.com/a/11709412/430062
-* Askar ([@ARACOOOL](https://github.com/ARACOOOL))
- - `rmdir()`
- - `limit_characters()`
- - `limit_words()`
-* Anonymous (tmp1000@fastmail.fm)
- - `htmlspecialentities()`: http://php.timesoft.cc/manual/en/function.htmlentities.php
- - `htmlspecialchars()`
-* Laravel Project (https://github.com/laravel/laravel)
- - `secure_random_string()`: http://trac.allenjb.me.uk/php/browser/tagi/vendor/laravel/framework/src/Illuminate/Support/Str.php?rev=87#L127
-* Abhimanyu Sharma ([@abhimanyusharma003](https://github.com/abhimanyusharma003))
- - `limit_characters()`
- - `limit_words()`
- - `match_string()`
-* Scott Baker ([@scottchiefbaker](https://github.com/scottchiefbaker))
-* [@sergserg](https://github.com/sergserg)
- - `set_writable()`
- - `set_executable()`
- - `set_readable()`
- - `directory_size()`
- - `directory_contents()`
- - `get_user_dir()`
diff --git a/e_lib/utilphp-1.1.0/LICENSE.md b/e_lib/utilphp-1.1.0/LICENSE.md
deleted file mode 100644
index 7c3f2915..00000000
--- a/e_lib/utilphp-1.1.0/LICENSE.md
+++ /dev/null
@@ -1,24 +0,0 @@
-The MIT License (MIT)
-=====================
-
-The MIT License (MIT)
-
-Copyright (c) 2013 Brandon Wamboldt
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
\ No newline at end of file
diff --git a/e_lib/utilphp-1.1.0/README.md b/e_lib/utilphp-1.1.0/README.md
deleted file mode 100644
index 3b271796..00000000
--- a/e_lib/utilphp-1.1.0/README.md
+++ /dev/null
@@ -1,123 +0,0 @@
-# Util.php [](https://travis-ci.org/brandonwamboldt/utilphp) [](https://coveralls.io/r/brandonwamboldt/utilphp)
-
-[UtilPHP](http://brandonwamboldt.github.com/utilphp/) (Aka util.php) is a
-collection of useful functions and snippets that you need or could use every
-day. It's implemented as a class with static methods, to avoid conflicts with
-your existing code-base. Just drop it in and start using it immediately.
-
-Included are 55+ functions that provide you with the ability to do common
-tasks much easier and more efficiently, without having to find that one comment
-on php.net where you know it's been done already. Access superglobals without
-checking to see if certain indexes are set first and pass default values, use a
-nicely formatted var dump, validate emails, generate random strings, flatten an
-array, pull a single column out of a multidimensional array and much more.
-
-Although it's implemented as one giant class, util.php has extensive
-documentation and a full suite of unit tests to avoid breaking
-backwards-compatibility unintentionally.
-
-## Release Information
-
-This repo contains in development code for future releases as well as the
-current stable branch. Development code is contained in the develop branch.
-
-## Changelog and New Features
-
-You can find a list of all changes for each release in the
-[official documentation](http://brandonwamboldt.github.com/utilphp/#changelog)
-
-## Installation
-
-### Server Requirements
-
-* PHP version 5.3.3 or higher.
-
-### Standalone File
-
-Simply drop `util.php` in any project and call `include 'util.php';` in your
-project. You can then access the `Util` class.
-
-### Composer
-
-Add the following dependency to your composer.json:
-
-```
-"brandonwamboldt/utilphp": "1.0.*"
-```
-
-When used with composer, the class is namespaced (`\utilphp\util`) instead of
-just `util`.
-
-## Contributing
-
-UtilPHP is a community driven project and accepts contributions of code and
-documentation from the community. These contributions are made in the form of
-Issues or [Pull Requests](http://help.github.com/send-pull-requests/) on the
-[UtilityPHP repository](https://github.com/brandonwamboldt/utilphp) on GitHub.
-
-Issues are a quick way to point out a bug. If you find a bug or documentation
-error in UtilityPHP then please check a few things first:
-
-* There is not already an open Issue
-* The issue has already been fixed (check the develop branch, or look for closed Issues)
-* Is it something really obvious that you fix it yourself?
-
-Reporting issues is helpful but an even better approach is to send a Pull
-Request, which is done by "Forking" the main repository and committing to your
-own copy. This will require you to use the version control system called Git.
-
-## Guidelines
-
-Before we look into how, here are the guidelines. If your Pull Requests fail to
-pass these guidelines it will be declined and you will need to re-submit when
-you’ve made the changes. This might sound a bit tough, but it is required for
-me to maintain quality of the code-base.
-
-### PHP Style
-
-Please ensure all new contributions match the [PSR-2](http://www.php-fig.org/psr/psr-2/)
-coding style guide.
-
-### Documentation
-
-If you change anything that requires a change to documentation then you will
-need to add it. New methods, parameters, changing default values, adding
-constants, etc are all things that will require a change to documentation. The
-change-log must also be updated for every change. Also PHPDoc blocks must be
-maintained.
-
-### PHP Version Compatibility
-
-UtilityPHP is compatible with PHP 5.3.3 so all code supplied must stick to this
-requirement.
-
-Of particular note is avoiding short array notation like this:
-
-```
-$var = [];
-```
-
-Please use the old notation instead:
-
-```
-$var = array();
-```
-
-I know it's uglier, but PHP 5.3 while EOL'd, still isn't that old.
-
-### Branching
-
-One thing at a time: A pull request should only contain one change. That does
-not mean only one commit, but one change - however many commits it took. The
-reason for this is that if you change X and Y but send a pull request for both
-at the same time, we might really want X but disagree with Y, meaning we cannot
-merge the request. Using the Git-Flow branching model you can create new
-branches for both of these features and send two requests.
-
-## License
-
-UtilPHP is licensed under the MIT license.
-
-## Resources
-
-* [Documentation](http://brandonwamboldt.github.com/utilphp/)
diff --git a/e_lib/utilphp-1.1.0/composer.json b/e_lib/utilphp-1.1.0/composer.json
deleted file mode 100644
index 9bf3520e..00000000
--- a/e_lib/utilphp-1.1.0/composer.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "name": "brandonwamboldt/utilphp",
- "type": "library",
- "version": "1.1.0",
- "description": "util.php is a collection of useful functions and snippets that you need or could use every day, designed to avoid conflicts with existing projects",
- "keywords": ["php", "utility", "collection", "helpers"],
- "homepage": "https://github.com/brandonwamboldt/utilphp",
- "license": "MIT",
- "authors": [
- {
- "name": "Brandon Wamboldt",
- "email": "brandon.wamboldt@gmail.com"
- }
- ],
- "autoload": {
- "psr-0": { "utilphp\\": "src/" }
- },
- "require-dev": {
- "satooshi/php-coveralls": "dev-master"
- },
- "require": {
- "php": ">=5.3.3"
- }
-}
diff --git a/e_lib/utilphp-1.1.0/docs/css/docs.css b/e_lib/utilphp-1.1.0/docs/css/docs.css
deleted file mode 100644
index 77993435..00000000
--- a/e_lib/utilphp-1.1.0/docs/css/docs.css
+++ /dev/null
@@ -1,168 +0,0 @@
-body {
- background: #f4f4f4 url('../images/background.png');
- color: #333;
- font: 18px/30px "Droid Serif", "Helvetica Neue", Helvetica, Arial;
-}
-
-a {
- text-decoration: none;
- color: #f00;
- padding: 2px;
-}
-
-a:hover {
- background: #277585;
- color: #fff;
- border-radius: 3px;
-}
-
-h1, h2, h3, h4, h5, h6 {
- padding-top: 20px;
-}
-
-h2 {
- font-size: 40px;
- font-weight: normal;
- margin: 0 0 15px;
-}
-
-p {
- margin: 20px 0;
- min-width: 550px;
- max-width: 900px;
-}
-
-table, tr, td {
- margin: 0; padding: 0;
-}
-
-td {
- padding: 2px 12px 2px 0;
-}
-
-ul {
- list-style-type: circle;
- padding: 0 0 0 20px;
-}
-
-li {
- width: 500px;
- margin-bottom: 10px;
-}
-
-code, pre, tt {
- font-family: Monaco, Consolas, "Lucida Console", monospace;
- font-size: 12px;
- line-height: 18px;
- font-style: normal;
-}
-
-tt {
- padding: 0px 3px;
- background: #fff;
- border: 1px solid #ddd;
- zoom: 1;
-}
-
-code {
- margin-left: 20px;
-}
-
-pre {
- font-size: 12px;
- padding: 12px;
- background: #fff;
- margin: 0px 0 30px;
- border-radius: 0 0 2px 2px;
- box-shadow: inset 0 0 0 1px rgba(0,0,0,.15);
-}
-
-span.header {
- font-size: 24px;
- line-height: 30px;
- border-left: 10px solid #ddd;
- padding-left: 10px;
-}
-
-.desc-text code {
- margin-left: 0;
- font-size: 18px;
- color: #0E04C8;
-}
-
-#sidebar {
- background: #fff;
- position: fixed;
- top: 0; left: 0; bottom: 0;
- width: 220px;
- overflow-y: auto;
- overflow-x: hidden;
- padding: 5px 0 30px 10px;
- border-right: 1px solid #bbb;
-
- box-shadow: 0 0 20px #ccc;
- -webkit-box-shadow: 0 0 20px #ccc;
- -moz-box-shadow: 0 0 20px #ccc;
- -webkit-overflow-scrolling: touch;
-}
-
-.toc_title, .toc_title:visited {
- display: block;
- color: #000;
- margin-top: 15px;
-}
-
-.toc_title:hover {
- background: none;
- color: #f00;
-}
-
-.toc_title .version {
- font-size: 12px;
- font-weight: normal;
-}
-
-.toc_section {
- font-size: 14px;
- line-height: 24px;
- margin: 5px 0 0 0;
- padding-left: 10px;
- list-style-type: none;
-}
-
-.toc_section li {
- cursor: pointer;
- margin: 0 0 3px 0;
-}
-
-.toc_section li a {
- text-decoration: none;
- color: black;
-}
-
-.toc_section li a:hover {
- background: none;
- color: #f00;
-}
-
-.container {
- min-width: 550px;
- max-width: 1000px;
- margin: 40px 0 50px 260px;
-}
-
-#documentation section > article > p > code {
- color: #999;
-}
-
-#documentation section > article > p > code > .util_class {
- color: #bbb;
-}
-
-#documentation section > article > p > code > .func_name {
- color: #0E04C8;
-}
-
-#documentation section > article > p > code > .param {
- color: #DA72F3;
-}
diff --git a/e_lib/utilphp-1.1.0/docs/favicon.png b/e_lib/utilphp-1.1.0/docs/favicon.png
deleted file mode 100644
index 5f17cf1d..00000000
Binary files a/e_lib/utilphp-1.1.0/docs/favicon.png and /dev/null differ
diff --git a/e_lib/utilphp-1.1.0/docs/images/awesome_var_dump.jpg b/e_lib/utilphp-1.1.0/docs/images/awesome_var_dump.jpg
deleted file mode 100644
index a697c734..00000000
Binary files a/e_lib/utilphp-1.1.0/docs/images/awesome_var_dump.jpg and /dev/null differ
diff --git a/e_lib/utilphp-1.1.0/docs/images/background.png b/e_lib/utilphp-1.1.0/docs/images/background.png
deleted file mode 100644
index 1e6fddd7..00000000
Binary files a/e_lib/utilphp-1.1.0/docs/images/background.png and /dev/null differ
diff --git a/e_lib/utilphp-1.1.0/docs/images/utility_logo.png b/e_lib/utilphp-1.1.0/docs/images/utility_logo.png
deleted file mode 100644
index 434c7bc5..00000000
Binary files a/e_lib/utilphp-1.1.0/docs/images/utility_logo.png and /dev/null differ
diff --git a/e_lib/utilphp-1.1.0/docs/index.html b/e_lib/utilphp-1.1.0/docs/index.html
deleted file mode 100644
index 3b47bba7..00000000
--- a/e_lib/utilphp-1.1.0/docs/index.html
+++ /dev/null
@@ -1,1234 +0,0 @@
-
-
-
-
-
- util.php is a collection of useful functions and snippets
- that you need or could use every day. It's implemented as a class with static methods, to avoid conflicts with your
- existing code-base. Just drop it in and start using it immediately.
-
-
-
- Included are 60+ functions that provide you with the ability to do common tasks much easier and more efficiently,
- without having to find that one comment on php.net where you know its been done already. Access superglobals
- without checking to see if certain indexes are set first and pass default values, use a nicely formatted var dump,
- validate emails, generate random strings, flatten an array, pull a single column out of a multidimensional array
- and much more.
-
-
-
- Although it's implemented as one giant class, util.php has extensive documentation and a full suite of unit tests
- to avoid breaking backwards-compatibility unintentionally.
-
- Nicely prints out the contents of a passed variable. Booleans are properly displayed as 'true' or 'false',
- null values are shown as 'NULL', variable types are displayed, and arrays and objects are displayed as a
- collapsible tree powered by JavaScript.
-
- Retrieve the first value from an array. Can be run on function callbacks, and it will not modify the pointer
- of the source array unlike most other methods of doing this.
-
- Retrieve the first key from an array. Can be run on function callbacks, and it will not modify the pointer of
- the source array unlike most other methods of doing this.
-
Retrieve a value from an array, or return a given default if the index isn't set
-
-
Usage:
-
-
util::array_get($_POST['action'], 'index');
-=> If $_POST['action'] is set, returns its value, otherwise returns 'index'
-util::array_get($_POST['action']['do'], 'index');
-=> Returns the value of $_POST['action']['do'] or 'index'
- Retrieve the last value from an array. Can be run on function callbacks, and it will not modify the pointer
- of the source array unlike most other methods of doing this.
-
- Retrieve the last key from an array. Can be run on function callbacks, and it will not modify the pointer of
- the source array unlike most other methods of doing this.
-
- Returns an array containing all the elements of $array after applying the callback function to each one recursively.
- Particularly useful for avoiding errors when calling functions that only accept scalar values on an array that could
- contain nested arrays, such as $_GET or $_POST.
-
-
-
Usage:
-
-
util::array_map_deep($_POST, 'htmlentities');
-=> Recursively escapes each scalar value in $_POST
-util::array_map_deep($_POST, 'htmlentities', TRUE);
-=> Recursively escapes each value in $_POST regardless of its type
- Replaces each value in an array with the specified field of the array or object that used to be the value. Very
- useful when you have an array of objects or arrays from a database, and you only want one specific field. For
- example, you want an array of emails from an array of users.
-
-
-
Usage:
-
-
util::array_pluck([['val' => 1], ['val' => 2], ['val' => 3]], 'val');
-=> Returns [1, 2, 3]
-util::array_pluck($users, 'email');
-=> Returns an array of email addresses for each user
- Allows you to search for a value in an array of arrays or an array of objects, and return the key of the value
- that matches the search criteria. If $field is unspecified, the entire array/object is searched.
-
- Generate a string safe for use in URLs from any given string. Converts any accent characters
- to their equivalent normal characters and converts any other non-alphanumeric characters to
- dashes, then converts any sequence of two or more dashes to a single dash. This function
- generates slugs safe for use as URLs, and if you pass TRUE as the second parameter, it will
- create strings safe for use as CSS classes or IDs.
-
-
-
Usage:
-
-
util::slugify('This is a random --string with an Ãccent');
-=> Returns 'this-is-a-random-string-with-an-accent'
-util::slugify('Another String', '.');
-=> Returns 'another.string'
- Executes htmlentities with ENT_QUOTES set by default. However, if you pass TRUE as
- the second parameter, it will not re-encode entities that are already encoded.
-
-
-
Usage:
-
-
util::htmlentities('this string < this string', TRUE);
-=> Returns 'this string < this string'
- Executes htmlspecialchars with ENT_QUOTES set by default. However, if you pass TRUE as
- the second parameter, it will not re-encode entities that are already encoded.
-
-
-
Usage:
-
-
util::htmlspecialchars('this string < this string', TRUE);
-=> Returns 'this string < this string'
-
-
-
-
- linkify
-
- util::linkify(string $text)
-
-
-
-
Find's any URLs in the specified text and wraps them with HTML anchor tags
-
-
Usage:
-
-
util::linkify('this string has a link to www.google.com');
-=> Returns 'this string has a link to <a href="http://wwww.google.com/">www.google.com</a>'
- Generates a random string of the specified length. Human friendly mode
- will exclude characters that can be confused with other characters, such
- as 0 (zero) and O (capital o), 1 (one) and l (lowercase L).
-
- Sanitize a string by performing the following operation :
-
-
Remove accents
-
Lower the string
-
Remove punctuation characters
-
Strip whitespaces
-
-
-
-
Usage:
-
-
util::sanitize_string(' Benoit! à New-York? j’ai perçu 1 % : Qu’as-tu "gagné" chez M. V. Noël? Dix francs.');
-=> Returns 'benoitanewyorkjaipercu1quastugagnechezmvnoeldixfrancs'
- Attempt to fix a broken serialization string (e.g. where string offsets are incorrect). Can fix
- errors that frequently occur with mismatched character sets or higher-than-ASCII characters.
-
- Transmit headers that force a browser to display the download file dialog. Cross
- browser compatible. Only fires if headers have not already been sent.
-
-
-
Usage:
-
-
util::force_download( 'export.csv', file_get_contents( 'securefile.csv' ) );
-=> The user will be prompted to download the file
- Returns the IP address of the client. Only enable $trust_proxy_headers if your server is behind a proxy
- that sets the HTTP_CLIENT_IP and HTTP_X_FORWARDED_FOR headers.
-
Sets the headers to prevent caching for the different browsers
-
-
- Different browsers support different nocache headers, so several headers must be sent
- so that all of them get the point that no caching should occur
-
The number of seconds in a year (365 days), useful for making code more verbose
-
-
-
-
Change Log
-
-
-
-
- 1.1.0
-
- This release introduces a deprecation notice for slugify(), please update your code.
-
- - Added a cryptographically secure random string function secure_random_string. Thanks to @abhimanyusharma003 via Pull Request #53
- - Added limit_characters and limit_words functions. Thanks to @abhimanyusharma003 via Pull Request #55
- - Added rmdir method to recursively delete a directory. Thanks to @ARACOOOL via Pull Request #56
- - Added set_executable, set_readable, set_writable, directory_size, directory_contents and get_user_dir functions. Thanks to @sergserg via Pull Request #70
- - Changed parameter ordering for slugify, $css_mode is now the third argument. For backwards compatibility, the old order will still work but it will generate an E_USER_DEPRECATED warning. Thanks to @abhimanyusharma003 via Pull Request #71
- - Added match_string method. Thanks to @abhimanyusharma003 via Pull Request #72
- - Renamed internal methods (protected ones) for PSR-2 compliance
- - General performance improvements, code quality improvements, and increased unit test coverage (special thanks to @hopeseekr for getting us near 100% coverage)
-
-
-
- 1.0.7
- - Added fix_broken_serialization to fix broken serialized strings (Thanks to @hopeseekr via Pull Request #48)
- - Fixed get_current_url appending port 80 or 443 when not needed (Thanks to @scottchiefbaker via Pull Request #49)
- - var_dump can now handle recursive data structures without crashing
- - var_dump code was minified and cleaned up
- - array_flatten was optimized (thanks to @hopeseekr via Pull Request #47)
- - remove_accents was completely rewritten and is now ~4x faster
-
-
-
- 1.0.6
- - Added start_with function
- - Added ends_with function
- - Added str_contains function
- - Added str_icontains function
- - Added get_file_ext function
- - Fixing permissions on the files & directories
- - Fixing a bug with the include path of util.php
-
-
-
- 1.0.5
- - Issue #29 Fixed error in var_dump if mbstring extension wasn't present
- - Adding Composer support
- - Updating license from GPL to MIT
- - Adding Changelog to project
- - Bumping minimum version to PHP 5.3.3
-
-
-
- 1.0.4
- - Issue #22 Removed all superglobal *_get functions, you can use the modified array_get now
- - Issue #22 Modifed the behaviour of array_get, see documentation
- - Pull Request #21 Added multibyte support to html* functions
- - Issue #9 Removed the str_to_utf8 function
- - Issue #3 Removed the absint function
- - Removed declare() from util.php to avoid errors
- - Updated PHPUnit tests to use PHPUnit 3.6
-
-
-
- 1.0.3
- - Issue #16 Improved performance of slugify
- - Issue #14 Modified the regex for seems_utf8 to be more accurate
- - Issue #13 Changed validate_email to be wrapper for filter_var
- - Added 'ok' to the list of yes words for str_to_bool
- - str_to_bool matches no followed by any number of 'o's
-
-
-
- 1.0.2
- - Issue #12get_current_url now includes the port and user/password if required
- - Issue #11human_time_diff now uses the DateTime functions
- - Issue #10is_https no longer checks the port as well
-
-
-
- 1.0.1
- - Issue #7 Added the $trust_proxy_headers parameter to get_client_ip
- - Issue #6 Removed is_isset as the function did not work as intended
- - Issue #6 Removed is_empty as it is redundant, use ! with function calls instead
- - Fixed a bug with get_gravatar
-