@@ -24,7 +24,7 @@ |
||
| 24 | 24 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 25 | 25 | */ |
| 26 | 26 | |
| 27 | - class StringHash{ |
|
| 27 | + class StringHash { |
|
| 28 | 28 | |
| 29 | 29 | //blowfish |
| 30 | 30 | private static $algo = '$2a'; |
@@ -1,65 +1,65 @@ |
||
| 1 | 1 | <?php |
| 2 | - defined('ROOT_PATH') || exit('Access denied'); |
|
| 3 | - /** |
|
| 4 | - * TNH Framework |
|
| 5 | - * |
|
| 6 | - * A simple PHP framework using HMVC architecture |
|
| 7 | - * |
|
| 8 | - * This content is released under the GNU GPL License (GPL) |
|
| 9 | - * |
|
| 10 | - * Copyright (C) 2017 Tony NGUEREZA |
|
| 11 | - * |
|
| 12 | - * This program is free software; you can redistribute it and/or |
|
| 13 | - * modify it under the terms of the GNU General Public License |
|
| 14 | - * as published by the Free Software Foundation; either version 3 |
|
| 15 | - * of the License, or (at your option) any later version. |
|
| 16 | - * |
|
| 17 | - * This program is distributed in the hope that it will be useful, |
|
| 18 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 19 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 20 | - * GNU General Public License for more details. |
|
| 21 | - * |
|
| 22 | - * You should have received a copy of the GNU General Public License |
|
| 23 | - * along with this program; if not, write to the Free Software |
|
| 24 | - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
| 25 | - */ |
|
| 2 | + defined('ROOT_PATH') || exit('Access denied'); |
|
| 3 | + /** |
|
| 4 | + * TNH Framework |
|
| 5 | + * |
|
| 6 | + * A simple PHP framework using HMVC architecture |
|
| 7 | + * |
|
| 8 | + * This content is released under the GNU GPL License (GPL) |
|
| 9 | + * |
|
| 10 | + * Copyright (C) 2017 Tony NGUEREZA |
|
| 11 | + * |
|
| 12 | + * This program is free software; you can redistribute it and/or |
|
| 13 | + * modify it under the terms of the GNU General Public License |
|
| 14 | + * as published by the Free Software Foundation; either version 3 |
|
| 15 | + * of the License, or (at your option) any later version. |
|
| 16 | + * |
|
| 17 | + * This program is distributed in the hope that it will be useful, |
|
| 18 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 19 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 20 | + * GNU General Public License for more details. |
|
| 21 | + * |
|
| 22 | + * You should have received a copy of the GNU General Public License |
|
| 23 | + * along with this program; if not, write to the Free Software |
|
| 24 | + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
| 25 | + */ |
|
| 26 | 26 | |
| 27 | - class StringHash{ |
|
| 27 | + class StringHash{ |
|
| 28 | 28 | |
| 29 | - //blowfish |
|
| 30 | - private static $algo = '$2a'; |
|
| 29 | + //blowfish |
|
| 30 | + private static $algo = '$2a'; |
|
| 31 | 31 | |
| 32 | - //cost parameter |
|
| 33 | - private static $cost = '$10'; |
|
| 32 | + //cost parameter |
|
| 33 | + private static $cost = '$10'; |
|
| 34 | 34 | |
| 35 | - /** |
|
| 36 | - * Get the unique salt for the string hash |
|
| 37 | - * @return string the unique generated salt |
|
| 38 | - */ |
|
| 39 | - private static function uniqueSalt() { |
|
| 40 | - return substr(sha1(mt_rand()), 0, 22); |
|
| 41 | - } |
|
| 35 | + /** |
|
| 36 | + * Get the unique salt for the string hash |
|
| 37 | + * @return string the unique generated salt |
|
| 38 | + */ |
|
| 39 | + private static function uniqueSalt() { |
|
| 40 | + return substr(sha1(mt_rand()), 0, 22); |
|
| 41 | + } |
|
| 42 | 42 | |
| 43 | - /** |
|
| 44 | - * Hash the given string |
|
| 45 | - * @param string $value the plain string text to be hashed |
|
| 46 | - * @return string the hashed string |
|
| 47 | - */ |
|
| 48 | - public static function hash($value) { |
|
| 49 | - return crypt($value, self::$algo . |
|
| 50 | - self::$cost . |
|
| 51 | - '$' . self::uniqueSalt()); |
|
| 52 | - } |
|
| 43 | + /** |
|
| 44 | + * Hash the given string |
|
| 45 | + * @param string $value the plain string text to be hashed |
|
| 46 | + * @return string the hashed string |
|
| 47 | + */ |
|
| 48 | + public static function hash($value) { |
|
| 49 | + return crypt($value, self::$algo . |
|
| 50 | + self::$cost . |
|
| 51 | + '$' . self::uniqueSalt()); |
|
| 52 | + } |
|
| 53 | 53 | |
| 54 | - /** |
|
| 55 | - * Check if the hash and plain string is valid |
|
| 56 | - * @param string $hash the hashed string |
|
| 57 | - * @param string $plain the plain text |
|
| 58 | - * @return boolean true if is valid or false if not |
|
| 59 | - */ |
|
| 60 | - public static function check($hash, $plain) { |
|
| 61 | - $full_salt = substr($hash, 0, 29); |
|
| 62 | - $new_hash = crypt($plain, $full_salt); |
|
| 63 | - return ($hash === $new_hash); |
|
| 64 | - } |
|
| 65 | - } |
|
| 66 | 54 | \ No newline at end of file |
| 55 | + /** |
|
| 56 | + * Check if the hash and plain string is valid |
|
| 57 | + * @param string $hash the hashed string |
|
| 58 | + * @param string $plain the plain text |
|
| 59 | + * @return boolean true if is valid or false if not |
|
| 60 | + */ |
|
| 61 | + public static function check($hash, $plain) { |
|
| 62 | + $full_salt = substr($hash, 0, 29); |
|
| 63 | + $new_hash = crypt($plain, $full_salt); |
|
| 64 | + return ($hash === $new_hash); |
|
| 65 | + } |
|
| 66 | + } |
|
| 67 | 67 | \ No newline at end of file |
@@ -921,20 +921,15 @@ |
||
| 921 | 921 | if(preg_match('#trident/([0-9\.]+);#i', $this->_agent, $aresult)){ |
| 922 | 922 | if($aresult[1] == '3.1'){ |
| 923 | 923 | $this->setVersion('7.0'); |
| 924 | - } |
|
| 925 | - else if($aresult[1] == '4.0'){ |
|
| 924 | + } else if($aresult[1] == '4.0'){ |
|
| 926 | 925 | $this->setVersion('8.0'); |
| 927 | - } |
|
| 928 | - else if($aresult[1] == '5.0'){ |
|
| 926 | + } else if($aresult[1] == '5.0'){ |
|
| 929 | 927 | $this->setVersion('9.0'); |
| 930 | - } |
|
| 931 | - else if($aresult[1] == '6.0'){ |
|
| 928 | + } else if($aresult[1] == '6.0'){ |
|
| 932 | 929 | $this->setVersion('10.0'); |
| 933 | - } |
|
| 934 | - else if($aresult[1] == '7.0'){ |
|
| 930 | + } else if($aresult[1] == '7.0'){ |
|
| 935 | 931 | $this->setVersion('11.0'); |
| 936 | - } |
|
| 937 | - else if($aresult[1] == '8.0'){ |
|
| 932 | + } else if($aresult[1] == '8.0'){ |
|
| 938 | 933 | $this->setVersion('11.0'); |
| 939 | 934 | } |
| 940 | 935 | } |
@@ -1669,34 +1669,34 @@ |
||
| 1669 | 1669 | protected function checkPlatform() |
| 1670 | 1670 | { |
| 1671 | 1671 | $platformMaps = array( |
| 1672 | - 'windows' => self::PLATFORM_WINDOWS, |
|
| 1673 | - 'iPad' => self::PLATFORM_IPAD, |
|
| 1674 | - 'iPod' => self::PLATFORM_IPOD, |
|
| 1675 | - 'iPhone' => self::PLATFORM_IPHONE, |
|
| 1676 | - 'mac' => self::PLATFORM_APPLE, |
|
| 1677 | - 'android' => self::PLATFORM_ANDROID, |
|
| 1678 | - 'Silk' => self::PLATFORM_FIRE_OS, |
|
| 1679 | - 'linux_smarttv' => self::PLATFORM_LINUX .'/'.self::PLATFORM_SMART_TV, |
|
| 1680 | - 'linux' => self::PLATFORM_LINUX, |
|
| 1681 | - 'Nokia' => self::PLATFORM_NOKIA, |
|
| 1682 | - 'BlackBerry' => self::PLATFORM_BLACKBERRY, |
|
| 1683 | - 'FreeBSD' => self::PLATFORM_FREEBSD, |
|
| 1684 | - 'OpenBSD' => self::PLATFORM_OPENBSD, |
|
| 1685 | - 'NetBSD' => self::PLATFORM_NETBSD, |
|
| 1686 | - 'OpenSolaris' => self::PLATFORM_OPENSOLARIS, |
|
| 1687 | - 'SunOS' => self::PLATFORM_SUNOS, |
|
| 1688 | - 'OS\/2' => self::PLATFORM_OS2, |
|
| 1689 | - 'BeOS' => self::PLATFORM_BEOS, |
|
| 1690 | - 'win' => self::PLATFORM_WINDOWS, |
|
| 1691 | - 'Playstation' => self::PLATFORM_PLAYSTATION, |
|
| 1692 | - 'Roku' => self::PLATFORM_ROKU, |
|
| 1693 | - 'iOS' => self::PLATFORM_IPHONE . '/' . self::PLATFORM_IPAD, |
|
| 1694 | - 'tvOS' => self::PLATFORM_APPLE_TV, |
|
| 1695 | - 'curl' => self::PLATFORM_TERMINAL, |
|
| 1696 | - 'CrOS' => self::PLATFORM_CHROME_OS, |
|
| 1697 | - 'okhttp' => self::PLATFORM_JAVA_ANDROID, |
|
| 1698 | - 'PostmanRuntime' => self::PLATFORM_POSTMAN, |
|
| 1699 | - 'Iframely' => self::PLATFORM_I_FRAME |
|
| 1672 | + 'windows' => self::PLATFORM_WINDOWS, |
|
| 1673 | + 'iPad' => self::PLATFORM_IPAD, |
|
| 1674 | + 'iPod' => self::PLATFORM_IPOD, |
|
| 1675 | + 'iPhone' => self::PLATFORM_IPHONE, |
|
| 1676 | + 'mac' => self::PLATFORM_APPLE, |
|
| 1677 | + 'android' => self::PLATFORM_ANDROID, |
|
| 1678 | + 'Silk' => self::PLATFORM_FIRE_OS, |
|
| 1679 | + 'linux_smarttv' => self::PLATFORM_LINUX .'/'.self::PLATFORM_SMART_TV, |
|
| 1680 | + 'linux' => self::PLATFORM_LINUX, |
|
| 1681 | + 'Nokia' => self::PLATFORM_NOKIA, |
|
| 1682 | + 'BlackBerry' => self::PLATFORM_BLACKBERRY, |
|
| 1683 | + 'FreeBSD' => self::PLATFORM_FREEBSD, |
|
| 1684 | + 'OpenBSD' => self::PLATFORM_OPENBSD, |
|
| 1685 | + 'NetBSD' => self::PLATFORM_NETBSD, |
|
| 1686 | + 'OpenSolaris' => self::PLATFORM_OPENSOLARIS, |
|
| 1687 | + 'SunOS' => self::PLATFORM_SUNOS, |
|
| 1688 | + 'OS\/2' => self::PLATFORM_OS2, |
|
| 1689 | + 'BeOS' => self::PLATFORM_BEOS, |
|
| 1690 | + 'win' => self::PLATFORM_WINDOWS, |
|
| 1691 | + 'Playstation' => self::PLATFORM_PLAYSTATION, |
|
| 1692 | + 'Roku' => self::PLATFORM_ROKU, |
|
| 1693 | + 'iOS' => self::PLATFORM_IPHONE . '/' . self::PLATFORM_IPAD, |
|
| 1694 | + 'tvOS' => self::PLATFORM_APPLE_TV, |
|
| 1695 | + 'curl' => self::PLATFORM_TERMINAL, |
|
| 1696 | + 'CrOS' => self::PLATFORM_CHROME_OS, |
|
| 1697 | + 'okhttp' => self::PLATFORM_JAVA_ANDROID, |
|
| 1698 | + 'PostmanRuntime' => self::PLATFORM_POSTMAN, |
|
| 1699 | + 'Iframely' => self::PLATFORM_I_FRAME |
|
| 1700 | 1700 | ); |
| 1701 | 1701 | |
| 1702 | 1702 | foreach ($platformMaps as $name => $value) { |
@@ -916,27 +916,27 @@ discard block |
||
| 916 | 916 | if (isset($aresult[1])) { |
| 917 | 917 | $this->setBrowser(self::BROWSER_IE); |
| 918 | 918 | $this->setVersion(str_replace(array('(', ')', ';'), '', $aresult[1])); |
| 919 | - if(preg_match('#trident/([0-9\.]+);#i', $this->_agent, $aresult)){ |
|
| 920 | - if($aresult[1] == '3.1'){ |
|
| 919 | + if (preg_match('#trident/([0-9\.]+);#i', $this->_agent, $aresult)) { |
|
| 920 | + if ($aresult[1] == '3.1') { |
|
| 921 | 921 | $this->setVersion('7.0'); |
| 922 | 922 | } |
| 923 | - else if($aresult[1] == '4.0'){ |
|
| 923 | + else if ($aresult[1] == '4.0') { |
|
| 924 | 924 | $this->setVersion('8.0'); |
| 925 | 925 | } |
| 926 | - else if($aresult[1] == '5.0'){ |
|
| 926 | + else if ($aresult[1] == '5.0') { |
|
| 927 | 927 | $this->setVersion('9.0'); |
| 928 | 928 | } |
| 929 | - else if($aresult[1] == '6.0'){ |
|
| 929 | + else if ($aresult[1] == '6.0') { |
|
| 930 | 930 | $this->setVersion('10.0'); |
| 931 | 931 | } |
| 932 | - else if($aresult[1] == '7.0'){ |
|
| 932 | + else if ($aresult[1] == '7.0') { |
|
| 933 | 933 | $this->setVersion('11.0'); |
| 934 | 934 | } |
| 935 | - else if($aresult[1] == '8.0'){ |
|
| 935 | + else if ($aresult[1] == '8.0') { |
|
| 936 | 936 | $this->setVersion('11.0'); |
| 937 | 937 | } |
| 938 | 938 | } |
| 939 | - if(stripos($this->_agent, 'IEMobile') !== false) { |
|
| 939 | + if (stripos($this->_agent, 'IEMobile') !== false) { |
|
| 940 | 940 | $this->setBrowser(self::BROWSER_POCKET_IE); |
| 941 | 941 | $this->setMobile(true); |
| 942 | 942 | } |
@@ -1676,7 +1676,7 @@ discard block |
||
| 1676 | 1676 | 'mac' => self::PLATFORM_APPLE, |
| 1677 | 1677 | 'android' => self::PLATFORM_ANDROID, |
| 1678 | 1678 | 'Silk' => self::PLATFORM_FIRE_OS, |
| 1679 | - 'linux_smarttv' => self::PLATFORM_LINUX .'/'.self::PLATFORM_SMART_TV, |
|
| 1679 | + 'linux_smarttv' => self::PLATFORM_LINUX . '/' . self::PLATFORM_SMART_TV, |
|
| 1680 | 1680 | 'linux' => self::PLATFORM_LINUX, |
| 1681 | 1681 | 'Nokia' => self::PLATFORM_NOKIA, |
| 1682 | 1682 | 'BlackBerry' => self::PLATFORM_BLACKBERRY, |
@@ -1700,9 +1700,9 @@ discard block |
||
| 1700 | 1700 | ); |
| 1701 | 1701 | |
| 1702 | 1702 | foreach ($platformMaps as $name => $value) { |
| 1703 | - if($name == 'linux_smarttv' |
|
| 1703 | + if ($name == 'linux_smarttv' |
|
| 1704 | 1704 | && stripos($this->_agent, 'linux') !== false |
| 1705 | - && stripos($this->_agent, 'SMART-TV') !== false ){ |
|
| 1705 | + && stripos($this->_agent, 'SMART-TV') !== false) { |
|
| 1706 | 1706 | $this->_platform = $value; |
| 1707 | 1707 | break; |
| 1708 | 1708 | } elseif (stripos($this->_agent, $name) !== false) { |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 25 | 25 | */ |
| 26 | 26 | |
| 27 | - if(! function_exists('__')){ |
|
| 27 | + if (!function_exists('__')) { |
|
| 28 | 28 | /** |
| 29 | 29 | * function for the shortcut to Lang::get() |
| 30 | 30 | * @param string $key the language key to retrieve |
@@ -32,20 +32,20 @@ discard block |
||
| 32 | 32 | * for the given key |
| 33 | 33 | * @return string the language value |
| 34 | 34 | */ |
| 35 | - function __($key, $default = 'LANGUAGE_ERROR'){ |
|
| 35 | + function __($key, $default = 'LANGUAGE_ERROR') { |
|
| 36 | 36 | return get_instance()->lang->get($key, $default); |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | |
| 42 | - if(! function_exists('get_languages')){ |
|
| 42 | + if (!function_exists('get_languages')) { |
|
| 43 | 43 | /** |
| 44 | 44 | * function for the shortcut to Lang::getSupported() |
| 45 | 45 | * |
| 46 | 46 | * @return array all the supported languages |
| 47 | 47 | */ |
| 48 | - function get_languages(){ |
|
| 48 | + function get_languages() { |
|
| 49 | 49 | return get_instance()->lang->getSupported(); |
| 50 | 50 | } |
| 51 | 51 | |
@@ -1,52 +1,52 @@ |
||
| 1 | 1 | <?php |
| 2 | - defined('ROOT_PATH') || exit('Access denied'); |
|
| 3 | - /** |
|
| 4 | - * TNH Framework |
|
| 5 | - * |
|
| 6 | - * A simple PHP framework using HMVC architecture |
|
| 7 | - * |
|
| 8 | - * This content is released under the GNU GPL License (GPL) |
|
| 9 | - * |
|
| 10 | - * Copyright (C) 2017 Tony NGUEREZA |
|
| 11 | - * |
|
| 12 | - * This program is free software; you can redistribute it and/or |
|
| 13 | - * modify it under the terms of the GNU General Public License |
|
| 14 | - * as published by the Free Software Foundation; either version 3 |
|
| 15 | - * of the License, or (at your option) any later version. |
|
| 16 | - * |
|
| 17 | - * This program is distributed in the hope that it will be useful, |
|
| 18 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 19 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 20 | - * GNU General Public License for more details. |
|
| 21 | - * |
|
| 22 | - * You should have received a copy of the GNU General Public License |
|
| 23 | - * along with this program; if not, write to the Free Software |
|
| 24 | - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
| 25 | - */ |
|
| 2 | + defined('ROOT_PATH') || exit('Access denied'); |
|
| 3 | + /** |
|
| 4 | + * TNH Framework |
|
| 5 | + * |
|
| 6 | + * A simple PHP framework using HMVC architecture |
|
| 7 | + * |
|
| 8 | + * This content is released under the GNU GPL License (GPL) |
|
| 9 | + * |
|
| 10 | + * Copyright (C) 2017 Tony NGUEREZA |
|
| 11 | + * |
|
| 12 | + * This program is free software; you can redistribute it and/or |
|
| 13 | + * modify it under the terms of the GNU General Public License |
|
| 14 | + * as published by the Free Software Foundation; either version 3 |
|
| 15 | + * of the License, or (at your option) any later version. |
|
| 16 | + * |
|
| 17 | + * This program is distributed in the hope that it will be useful, |
|
| 18 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 19 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 20 | + * GNU General Public License for more details. |
|
| 21 | + * |
|
| 22 | + * You should have received a copy of the GNU General Public License |
|
| 23 | + * along with this program; if not, write to the Free Software |
|
| 24 | + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
| 25 | + */ |
|
| 26 | 26 | |
| 27 | - if(! function_exists('__')){ |
|
| 28 | - /** |
|
| 29 | - * function for the shortcut to Lang::get() |
|
| 30 | - * @param string $key the language key to retrieve |
|
| 31 | - * @param mixed $default the default value to return if can not find the value |
|
| 32 | - * for the given key |
|
| 33 | - * @return string the language value |
|
| 34 | - */ |
|
| 35 | - function __($key, $default = 'LANGUAGE_ERROR'){ |
|
| 36 | - return get_instance()->lang->get($key, $default); |
|
| 37 | - } |
|
| 27 | + if(! function_exists('__')){ |
|
| 28 | + /** |
|
| 29 | + * function for the shortcut to Lang::get() |
|
| 30 | + * @param string $key the language key to retrieve |
|
| 31 | + * @param mixed $default the default value to return if can not find the value |
|
| 32 | + * for the given key |
|
| 33 | + * @return string the language value |
|
| 34 | + */ |
|
| 35 | + function __($key, $default = 'LANGUAGE_ERROR'){ |
|
| 36 | + return get_instance()->lang->get($key, $default); |
|
| 37 | + } |
|
| 38 | 38 | |
| 39 | - } |
|
| 39 | + } |
|
| 40 | 40 | |
| 41 | 41 | |
| 42 | - if(! function_exists('get_languages')){ |
|
| 43 | - /** |
|
| 44 | - * function for the shortcut to Lang::getSupported() |
|
| 45 | - * |
|
| 46 | - * @return array all the supported languages |
|
| 47 | - */ |
|
| 48 | - function get_languages(){ |
|
| 49 | - return get_instance()->lang->getSupported(); |
|
| 50 | - } |
|
| 42 | + if(! function_exists('get_languages')){ |
|
| 43 | + /** |
|
| 44 | + * function for the shortcut to Lang::getSupported() |
|
| 45 | + * |
|
| 46 | + * @return array all the supported languages |
|
| 47 | + */ |
|
| 48 | + function get_languages(){ |
|
| 49 | + return get_instance()->lang->getSupported(); |
|
| 50 | + } |
|
| 51 | 51 | |
| 52 | - } |
|
| 53 | 52 | \ No newline at end of file |
| 53 | + } |
|
| 54 | 54 | \ No newline at end of file |
@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | <meta name="viewport" content="width=device-width, initial-scale=1"> |
| 7 | 7 | <meta name="description" content=""> |
| 8 | 8 | <meta name="author" content="Tony NGUEREZA"> |
| 9 | - <title><?php echo $title;?></title> |
|
| 9 | + <title><?php echo $title; ?></title> |
|
| 10 | 10 | <style type = 'text/css'> |
| 11 | 11 | /* reset */ |
| 12 | 12 | *{ |
@@ -64,10 +64,10 @@ discard block |
||
| 64 | 64 | <body> |
| 65 | 65 | <div class="container"> |
| 66 | 66 | <div class = "title"> |
| 67 | - <h2><?php echo $title;?></h2> |
|
| 67 | + <h2><?php echo $title; ?></h2> |
|
| 68 | 68 | </div> |
| 69 | 69 | <div class = "body"> |
| 70 | - <p><?php echo $error;?></p> |
|
| 70 | + <p><?php echo $error; ?></p> |
|
| 71 | 71 | </div> |
| 72 | 72 | </div> <!-- ./container--> |
| 73 | 73 | </body> |
@@ -3,11 +3,11 @@ discard block |
||
| 3 | 3 | /** |
| 4 | 4 | * Form validation language message (English) |
| 5 | 5 | */ |
| 6 | - $lang['fv_required'] = 'Field %1 is required.'; |
|
| 6 | + $lang['fv_required'] = 'Field %1 is required.'; |
|
| 7 | 7 | $lang['fv_min_length'] = 'Field %1 must contain at least %2 characters.'; |
| 8 | 8 | $lang['fv_max_length'] = 'Field %1 must contain at most %2 characters.'; |
| 9 | 9 | $lang['fv_exact_length'] = 'Field %1 must contain exactly %2 characters.'; |
| 10 | - $lang['fv_less_than'] = 'Field %1 must less than %2.'; |
|
| 10 | + $lang['fv_less_than'] = 'Field %1 must less than %2.'; |
|
| 11 | 11 | $lang['fv_greater_than'] = 'Field %1 must greater than %2.'; |
| 12 | 12 | $lang['fv_matches'] = 'Field %1 must be identical to field %2.'; |
| 13 | 13 | $lang['fv_valid_email'] = 'Field %1 must contain a valid E-mail address.'; |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | $lang['fv_depends'] = 'Field %1 depends on field %2 which is not valid.'; |
| 17 | 17 | $lang['fv_is_unique'] = 'The value of field %1 already exists.'; |
| 18 | 18 | $lang['fv_is_unique_update'] = 'The value of field %1 already exists for another record.'; |
| 19 | - $lang['fv_exists'] = 'The value of the field %1 does not exist.'; |
|
| 19 | + $lang['fv_exists'] = 'The value of the field %1 does not exist.'; |
|
| 20 | 20 | $lang['fv_regex'] = 'The value of the field %1 does not use the correct format.'; |
| 21 | 21 | $lang['fv_in_list'] = 'The value of field %1 must be one of the list (%2).'; |
| 22 | 22 | $lang['fv_numeric'] = 'The value of field %1 must be a number.'; |
@@ -1,9 +1,9 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | defined('ROOT_PATH') || exit('Access denied'); |
| 3 | - /** |
|
| 4 | - * Form validation language message (English) |
|
| 5 | - */ |
|
| 6 | - $lang['fv_required'] = 'Field %1 is required.'; |
|
| 3 | + /** |
|
| 4 | + * Form validation language message (English) |
|
| 5 | + */ |
|
| 6 | + $lang['fv_required'] = 'Field %1 is required.'; |
|
| 7 | 7 | $lang['fv_min_length'] = 'Field %1 must contain at least %2 characters.'; |
| 8 | 8 | $lang['fv_max_length'] = 'Field %1 must contain at most %2 characters.'; |
| 9 | 9 | $lang['fv_exact_length'] = 'Field %1 must contain exactly %2 characters.'; |
@@ -14,8 +14,8 @@ discard block |
||
| 14 | 14 | $lang['fv_not_equal_post_key'] = 'Field %1 must not be the same as field %2.'; |
| 15 | 15 | $lang['fv_not_equal_string'] = 'Field %1 must not contain the value %2.'; |
| 16 | 16 | $lang['fv_depends'] = 'Field %1 depends on field %2 which is not valid.'; |
| 17 | - $lang['fv_is_unique'] = 'The value of field %1 already exists.'; |
|
| 18 | - $lang['fv_is_unique_update'] = 'The value of field %1 already exists for another record.'; |
|
| 17 | + $lang['fv_is_unique'] = 'The value of field %1 already exists.'; |
|
| 18 | + $lang['fv_is_unique_update'] = 'The value of field %1 already exists for another record.'; |
|
| 19 | 19 | $lang['fv_exists'] = 'The value of the field %1 does not exist.'; |
| 20 | 20 | $lang['fv_regex'] = 'The value of the field %1 does not use the correct format.'; |
| 21 | 21 | $lang['fv_in_list'] = 'The value of field %1 must be one of the list (%2).'; |
@@ -6,11 +6,11 @@ |
||
| 6 | 6 | $lang['fu_upload_err_ini_size'] = 'The uploaded file exceeds the upload_max_filesize directive in php.ini.'; |
| 7 | 7 | $lang['fu_upload_err_form_size'] = 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.'; |
| 8 | 8 | $lang['fu_upload_err_partial'] = 'The uploaded file was only partially uploaded.'; |
| 9 | - $lang['fu_upload_err_no_file'] = 'No file was choosed. Please select one.'; |
|
| 9 | + $lang['fu_upload_err_no_file'] = 'No file was choosed. Please select one.'; |
|
| 10 | 10 | $lang['fu_upload_err_no_tmp_dir'] = 'Missing a temporary folder.'; |
| 11 | - $lang['fu_upload_err_cant_write'] = 'Failed to write file to disk.'; |
|
| 11 | + $lang['fu_upload_err_cant_write'] = 'Failed to write file to disk.'; |
|
| 12 | 12 | $lang['fu_upload_err_extension'] = 'A PHP extension stopped the file upload.'; |
| 13 | - $lang['fu_accept_file_types'] = 'Filetype not allowed'; |
|
| 13 | + $lang['fu_accept_file_types'] = 'Filetype not allowed'; |
|
| 14 | 14 | $lang['fu_file_uploads_disabled'] = 'File uploading option is disabled in php.ini'; |
| 15 | 15 | $lang['fu_max_file_size'] = 'The uploaded file size is too big max size is %s'; |
| 16 | 16 | $lang['fu_overwritten_not_allowed'] = 'You don\'t allow overwriting existing file'; |
@@ -1,9 +1,9 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | defined('ROOT_PATH') || exit('Access denied'); |
| 3 | - /** |
|
| 4 | - * File upload language messages (English) |
|
| 5 | - */ |
|
| 6 | - $lang['fu_upload_err_ini_size'] = 'The uploaded file exceeds the upload_max_filesize directive in php.ini.'; |
|
| 3 | + /** |
|
| 4 | + * File upload language messages (English) |
|
| 5 | + */ |
|
| 6 | + $lang['fu_upload_err_ini_size'] = 'The uploaded file exceeds the upload_max_filesize directive in php.ini.'; |
|
| 7 | 7 | $lang['fu_upload_err_form_size'] = 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.'; |
| 8 | 8 | $lang['fu_upload_err_partial'] = 'The uploaded file was only partially uploaded.'; |
| 9 | 9 | $lang['fu_upload_err_no_file'] = 'No file was choosed. Please select one.'; |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | */ |
| 46 | 46 | protected $sessionTableColumns = array(); |
| 47 | 47 | |
| 48 | - public function __construct(Database $db = null){ |
|
| 48 | + public function __construct(Database $db = null) { |
|
| 49 | 49 | parent::__construct($db); |
| 50 | 50 | } |
| 51 | 51 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | * Return the session database table columns |
| 54 | 54 | * @return array |
| 55 | 55 | */ |
| 56 | - public function getSessionTableColumns(){ |
|
| 56 | + public function getSessionTableColumns() { |
|
| 57 | 57 | return $this->sessionTableColumns; |
| 58 | 58 | } |
| 59 | 59 | |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | * Set the session database table columns |
| 62 | 62 | * @param array $columns the columns definition |
| 63 | 63 | */ |
| 64 | - public function setSessionTableColumns(array $columns){ |
|
| 64 | + public function setSessionTableColumns(array $columns) { |
|
| 65 | 65 | $this->sessionTableColumns = $columns; |
| 66 | 66 | return $this; |
| 67 | 67 | } |
@@ -1,39 +1,39 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | - defined('ROOT_PATH') || exit('Access denied'); |
|
| 3 | - /** |
|
| 4 | - * TNH Framework |
|
| 5 | - * |
|
| 6 | - * A simple PHP framework using HMVC architecture |
|
| 7 | - * |
|
| 8 | - * This content is released under the GNU GPL License (GPL) |
|
| 9 | - * |
|
| 10 | - * Copyright (C) 2017 Tony NGUEREZA |
|
| 11 | - * |
|
| 12 | - * This program is free software; you can redistribute it and/or |
|
| 13 | - * modify it under the terms of the GNU General Public License |
|
| 14 | - * as published by the Free Software Foundation; either version 3 |
|
| 15 | - * of the License, or (at your option) any later version. |
|
| 16 | - * |
|
| 17 | - * This program is distributed in the hope that it will be useful, |
|
| 18 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 19 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 20 | - * GNU General Public License for more details. |
|
| 21 | - * |
|
| 22 | - * You should have received a copy of the GNU General Public License |
|
| 23 | - * along with this program; if not, write to the Free Software |
|
| 24 | - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
| 25 | - */ |
|
| 2 | + defined('ROOT_PATH') || exit('Access denied'); |
|
| 3 | + /** |
|
| 4 | + * TNH Framework |
|
| 5 | + * |
|
| 6 | + * A simple PHP framework using HMVC architecture |
|
| 7 | + * |
|
| 8 | + * This content is released under the GNU GPL License (GPL) |
|
| 9 | + * |
|
| 10 | + * Copyright (C) 2017 Tony NGUEREZA |
|
| 11 | + * |
|
| 12 | + * This program is free software; you can redistribute it and/or |
|
| 13 | + * modify it under the terms of the GNU General Public License |
|
| 14 | + * as published by the Free Software Foundation; either version 3 |
|
| 15 | + * of the License, or (at your option) any later version. |
|
| 16 | + * |
|
| 17 | + * This program is distributed in the hope that it will be useful, |
|
| 18 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 19 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 20 | + * GNU General Public License for more details. |
|
| 21 | + * |
|
| 22 | + * You should have received a copy of the GNU General Public License |
|
| 23 | + * along with this program; if not, write to the Free Software |
|
| 24 | + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
| 25 | + */ |
|
| 26 | 26 | |
| 27 | - /** |
|
| 28 | - * DB session handler class |
|
| 29 | - */ |
|
| 30 | - abstract class DBSessionHandlerModel extends Model { |
|
| 27 | + /** |
|
| 28 | + * DB session handler class |
|
| 29 | + */ |
|
| 30 | + abstract class DBSessionHandlerModel extends Model { |
|
| 31 | 31 | |
| 32 | - /** |
|
| 33 | - * The session table columns to use |
|
| 34 | - * @var array |
|
| 35 | - * @example |
|
| 36 | - * array( |
|
| 32 | + /** |
|
| 33 | + * The session table columns to use |
|
| 34 | + * @var array |
|
| 35 | + * @example |
|
| 36 | + * array( |
|
| 37 | 37 | 'sid' => '', //VARCHAR(255) Note: this a primary key |
| 38 | 38 | 'sdata' => '', //TEXT |
| 39 | 39 | 'stime' => '', //unix timestamp (INT|BIGINT) |
@@ -42,41 +42,41 @@ discard block |
||
| 42 | 42 | 'sbrowser' => '', //VARCHAR(255) |
| 43 | 43 | 'skey' => '' //VARCHAR(255) |
| 44 | 44 | ); |
| 45 | - */ |
|
| 46 | - protected $sessionTableColumns = array(); |
|
| 45 | + */ |
|
| 46 | + protected $sessionTableColumns = array(); |
|
| 47 | 47 | |
| 48 | - public function __construct(Database $db = null){ |
|
| 49 | - parent::__construct($db); |
|
| 50 | - } |
|
| 48 | + public function __construct(Database $db = null){ |
|
| 49 | + parent::__construct($db); |
|
| 50 | + } |
|
| 51 | 51 | |
| 52 | - /** |
|
| 53 | - * Return the session database table columns |
|
| 54 | - * @return array |
|
| 55 | - */ |
|
| 56 | - public function getSessionTableColumns(){ |
|
| 57 | - return $this->sessionTableColumns; |
|
| 58 | - } |
|
| 52 | + /** |
|
| 53 | + * Return the session database table columns |
|
| 54 | + * @return array |
|
| 55 | + */ |
|
| 56 | + public function getSessionTableColumns(){ |
|
| 57 | + return $this->sessionTableColumns; |
|
| 58 | + } |
|
| 59 | 59 | |
| 60 | - /** |
|
| 61 | - * Set the session database table columns |
|
| 62 | - * @param array $columns the columns definition |
|
| 63 | - */ |
|
| 64 | - public function setSessionTableColumns(array $columns){ |
|
| 65 | - $this->sessionTableColumns = $columns; |
|
| 66 | - return $this; |
|
| 67 | - } |
|
| 60 | + /** |
|
| 61 | + * Set the session database table columns |
|
| 62 | + * @param array $columns the columns definition |
|
| 63 | + */ |
|
| 64 | + public function setSessionTableColumns(array $columns){ |
|
| 65 | + $this->sessionTableColumns = $columns; |
|
| 66 | + return $this; |
|
| 67 | + } |
|
| 68 | 68 | |
| 69 | - /** |
|
| 70 | - * Delete the expire session |
|
| 71 | - * @param int $time the unix timestamp |
|
| 72 | - * @return int affected rows |
|
| 73 | - */ |
|
| 74 | - abstract public function deleteByTime($time); |
|
| 69 | + /** |
|
| 70 | + * Delete the expire session |
|
| 71 | + * @param int $time the unix timestamp |
|
| 72 | + * @return int affected rows |
|
| 73 | + */ |
|
| 74 | + abstract public function deleteByTime($time); |
|
| 75 | 75 | |
| 76 | 76 | |
| 77 | - /** |
|
| 78 | - * How to get the value of the table column key. Generally is the session key |
|
| 79 | - * @return mixed the key value like used to identify the data |
|
| 80 | - */ |
|
| 81 | - abstract public function getKeyValue(); |
|
| 82 | - } |
|
| 77 | + /** |
|
| 78 | + * How to get the value of the table column key. Generally is the session key |
|
| 79 | + * @return mixed the key value like used to identify the data |
|
| 80 | + */ |
|
| 81 | + abstract public function getKeyValue(); |
|
| 82 | + } |
|
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | /** |
| 28 | 28 | * Class for Benchmark |
| 29 | 29 | */ |
| 30 | - class Benchmark{ |
|
| 30 | + class Benchmark { |
|
| 31 | 31 | /** |
| 32 | 32 | * The markers for excution time |
| 33 | 33 | * @var array |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | * This method is used to mark one point for benchmark (execution time and memory usage) |
| 45 | 45 | * @param string $name the marker name |
| 46 | 46 | */ |
| 47 | - public function mark($name){ |
|
| 47 | + public function mark($name) { |
|
| 48 | 48 | //Marker for execution time |
| 49 | 49 | $this->markersTime[$name] = microtime(true); |
| 50 | 50 | //Marker for memory usage |
@@ -58,12 +58,12 @@ discard block |
||
| 58 | 58 | * @param integer $decimalCount the number of decimal |
| 59 | 59 | * @return string the total execution time |
| 60 | 60 | */ |
| 61 | - public function elapsedTime($startMarkerName = null, $endMarkerName = null, $decimalCount = 6){ |
|
| 62 | - if(! $startMarkerName || !isset($this->markersTime[$startMarkerName])){ |
|
| 61 | + public function elapsedTime($startMarkerName = null, $endMarkerName = null, $decimalCount = 6) { |
|
| 62 | + if (!$startMarkerName || !isset($this->markersTime[$startMarkerName])) { |
|
| 63 | 63 | return 0; |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | - if(! isset($this->markersTime[$endMarkerName])){ |
|
| 66 | + if (!isset($this->markersTime[$endMarkerName])) { |
|
| 67 | 67 | $this->markersTime[$endMarkerName] = microtime(true); |
| 68 | 68 | } |
| 69 | 69 | return number_format($this->markersTime[$endMarkerName] - $this->markersTime[$startMarkerName], $decimalCount); |
@@ -76,12 +76,12 @@ discard block |
||
| 76 | 76 | * @param integer $decimalCount the number of decimal |
| 77 | 77 | * @return string the total memory usage |
| 78 | 78 | */ |
| 79 | - public function memoryUsage($startMarkerName = null, $endMarkerName = null, $decimalCount = 6){ |
|
| 80 | - if(! $startMarkerName || !isset($this->markersMemory[$startMarkerName])){ |
|
| 79 | + public function memoryUsage($startMarkerName = null, $endMarkerName = null, $decimalCount = 6) { |
|
| 80 | + if (!$startMarkerName || !isset($this->markersMemory[$startMarkerName])) { |
|
| 81 | 81 | return 0; |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | - if(! isset($this->markersMemory[$endMarkerName])){ |
|
| 84 | + if (!isset($this->markersMemory[$endMarkerName])) { |
|
| 85 | 85 | $this->markersMemory[$endMarkerName] = microtime(true); |
| 86 | 86 | } |
| 87 | 87 | return number_format($this->markersMemory[$endMarkerName] - $this->markersMemory[$startMarkerName], $decimalCount); |
@@ -1,89 +1,89 @@ |
||
| 1 | 1 | <?php |
| 2 | - defined('ROOT_PATH') or exit('Access denied'); |
|
| 3 | - /** |
|
| 4 | - * TNH Framework |
|
| 5 | - * |
|
| 6 | - * A simple PHP framework using HMVC architecture |
|
| 7 | - * |
|
| 8 | - * This content is released under the GNU GPL License (GPL) |
|
| 9 | - * |
|
| 10 | - * Copyright (C) 2017 Tony NGUEREZA |
|
| 11 | - * |
|
| 12 | - * This program is free software; you can redistribute it and/or |
|
| 13 | - * modify it under the terms of the GNU General Public License |
|
| 14 | - * as published by the Free Software Foundation; either version 3 |
|
| 15 | - * of the License, or (at your option) any later version. |
|
| 16 | - * |
|
| 17 | - * This program is distributed in the hope that it will be useful, |
|
| 18 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 19 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 20 | - * GNU General Public License for more details. |
|
| 21 | - * |
|
| 22 | - * You should have received a copy of the GNU General Public License |
|
| 23 | - * along with this program; if not, write to the Free Software |
|
| 24 | - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
| 25 | - */ |
|
| 2 | + defined('ROOT_PATH') or exit('Access denied'); |
|
| 3 | + /** |
|
| 4 | + * TNH Framework |
|
| 5 | + * |
|
| 6 | + * A simple PHP framework using HMVC architecture |
|
| 7 | + * |
|
| 8 | + * This content is released under the GNU GPL License (GPL) |
|
| 9 | + * |
|
| 10 | + * Copyright (C) 2017 Tony NGUEREZA |
|
| 11 | + * |
|
| 12 | + * This program is free software; you can redistribute it and/or |
|
| 13 | + * modify it under the terms of the GNU General Public License |
|
| 14 | + * as published by the Free Software Foundation; either version 3 |
|
| 15 | + * of the License, or (at your option) any later version. |
|
| 16 | + * |
|
| 17 | + * This program is distributed in the hope that it will be useful, |
|
| 18 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 19 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 20 | + * GNU General Public License for more details. |
|
| 21 | + * |
|
| 22 | + * You should have received a copy of the GNU General Public License |
|
| 23 | + * along with this program; if not, write to the Free Software |
|
| 24 | + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
| 25 | + */ |
|
| 26 | 26 | |
| 27 | - /** |
|
| 28 | - * Class for Benchmark |
|
| 29 | - */ |
|
| 30 | - class Benchmark{ |
|
| 31 | - /** |
|
| 32 | - * The markers for excution time |
|
| 33 | - * @var array |
|
| 34 | - */ |
|
| 35 | - private $markersTime = array(); |
|
| 27 | + /** |
|
| 28 | + * Class for Benchmark |
|
| 29 | + */ |
|
| 30 | + class Benchmark{ |
|
| 31 | + /** |
|
| 32 | + * The markers for excution time |
|
| 33 | + * @var array |
|
| 34 | + */ |
|
| 35 | + private $markersTime = array(); |
|
| 36 | 36 | |
| 37 | - /** |
|
| 38 | - * The markers for memory usage |
|
| 39 | - * @var array |
|
| 40 | - */ |
|
| 41 | - private $markersMemory = array(); |
|
| 37 | + /** |
|
| 38 | + * The markers for memory usage |
|
| 39 | + * @var array |
|
| 40 | + */ |
|
| 41 | + private $markersMemory = array(); |
|
| 42 | 42 | |
| 43 | - /** |
|
| 44 | - * This method is used to mark one point for benchmark (execution time and memory usage) |
|
| 45 | - * @param string $name the marker name |
|
| 46 | - */ |
|
| 47 | - public function mark($name){ |
|
| 48 | - //Marker for execution time |
|
| 49 | - $this->markersTime[$name] = microtime(true); |
|
| 50 | - //Marker for memory usage |
|
| 51 | - $this->markersMemory[$name] = memory_get_usage(true); |
|
| 52 | - } |
|
| 43 | + /** |
|
| 44 | + * This method is used to mark one point for benchmark (execution time and memory usage) |
|
| 45 | + * @param string $name the marker name |
|
| 46 | + */ |
|
| 47 | + public function mark($name){ |
|
| 48 | + //Marker for execution time |
|
| 49 | + $this->markersTime[$name] = microtime(true); |
|
| 50 | + //Marker for memory usage |
|
| 51 | + $this->markersMemory[$name] = memory_get_usage(true); |
|
| 52 | + } |
|
| 53 | 53 | |
| 54 | - /** |
|
| 55 | - * This method is used to get the total excution time in second between two markers |
|
| 56 | - * @param string $startMarkerName the marker for start point |
|
| 57 | - * @param string $endMarkerName the marker for end point |
|
| 58 | - * @param integer $decimalCount the number of decimal |
|
| 59 | - * @return string the total execution time |
|
| 60 | - */ |
|
| 61 | - public function elapsedTime($startMarkerName = null, $endMarkerName = null, $decimalCount = 6){ |
|
| 62 | - if(! $startMarkerName || !isset($this->markersTime[$startMarkerName])){ |
|
| 63 | - return 0; |
|
| 64 | - } |
|
| 54 | + /** |
|
| 55 | + * This method is used to get the total excution time in second between two markers |
|
| 56 | + * @param string $startMarkerName the marker for start point |
|
| 57 | + * @param string $endMarkerName the marker for end point |
|
| 58 | + * @param integer $decimalCount the number of decimal |
|
| 59 | + * @return string the total execution time |
|
| 60 | + */ |
|
| 61 | + public function elapsedTime($startMarkerName = null, $endMarkerName = null, $decimalCount = 6){ |
|
| 62 | + if(! $startMarkerName || !isset($this->markersTime[$startMarkerName])){ |
|
| 63 | + return 0; |
|
| 64 | + } |
|
| 65 | 65 | |
| 66 | - if(! isset($this->markersTime[$endMarkerName])){ |
|
| 67 | - $this->markersTime[$endMarkerName] = microtime(true); |
|
| 68 | - } |
|
| 69 | - return number_format($this->markersTime[$endMarkerName] - $this->markersTime[$startMarkerName], $decimalCount); |
|
| 70 | - } |
|
| 66 | + if(! isset($this->markersTime[$endMarkerName])){ |
|
| 67 | + $this->markersTime[$endMarkerName] = microtime(true); |
|
| 68 | + } |
|
| 69 | + return number_format($this->markersTime[$endMarkerName] - $this->markersTime[$startMarkerName], $decimalCount); |
|
| 70 | + } |
|
| 71 | 71 | |
| 72 | - /** |
|
| 73 | - * This method is used to get the total memory usage in byte between two markers |
|
| 74 | - * @param string $startMarkerName the marker for start point |
|
| 75 | - * @param string $endMarkerName the marker for end point |
|
| 76 | - * @param integer $decimalCount the number of decimal |
|
| 77 | - * @return string the total memory usage |
|
| 78 | - */ |
|
| 79 | - public function memoryUsage($startMarkerName = null, $endMarkerName = null, $decimalCount = 6){ |
|
| 80 | - if(! $startMarkerName || !isset($this->markersMemory[$startMarkerName])){ |
|
| 81 | - return 0; |
|
| 82 | - } |
|
| 72 | + /** |
|
| 73 | + * This method is used to get the total memory usage in byte between two markers |
|
| 74 | + * @param string $startMarkerName the marker for start point |
|
| 75 | + * @param string $endMarkerName the marker for end point |
|
| 76 | + * @param integer $decimalCount the number of decimal |
|
| 77 | + * @return string the total memory usage |
|
| 78 | + */ |
|
| 79 | + public function memoryUsage($startMarkerName = null, $endMarkerName = null, $decimalCount = 6){ |
|
| 80 | + if(! $startMarkerName || !isset($this->markersMemory[$startMarkerName])){ |
|
| 81 | + return 0; |
|
| 82 | + } |
|
| 83 | 83 | |
| 84 | - if(! isset($this->markersMemory[$endMarkerName])){ |
|
| 85 | - $this->markersMemory[$endMarkerName] = microtime(true); |
|
| 86 | - } |
|
| 87 | - return number_format($this->markersMemory[$endMarkerName] - $this->markersMemory[$startMarkerName], $decimalCount); |
|
| 88 | - } |
|
| 89 | - } |
|
| 84 | + if(! isset($this->markersMemory[$endMarkerName])){ |
|
| 85 | + $this->markersMemory[$endMarkerName] = microtime(true); |
|
| 86 | + } |
|
| 87 | + return number_format($this->markersMemory[$endMarkerName] - $this->markersMemory[$startMarkerName], $decimalCount); |
|
| 88 | + } |
|
| 89 | + } |
|
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | /** |
| 28 | 28 | * This class represent the event detail to dispatch to correspond listener |
| 29 | 29 | */ |
| 30 | - class EventInfo{ |
|
| 30 | + class EventInfo { |
|
| 31 | 31 | |
| 32 | 32 | /** |
| 33 | 33 | * The event name |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | */ |
| 55 | 55 | public $stop; |
| 56 | 56 | |
| 57 | - public function __construct($name, $payload = array(), $returnBack = false, $stop = false){ |
|
| 57 | + public function __construct($name, $payload = array(), $returnBack = false, $stop = false) { |
|
| 58 | 58 | $this->name = $name; |
| 59 | 59 | $this->payload = $payload; |
| 60 | 60 | $this->returnBack = $returnBack; |
@@ -1,63 +1,63 @@ |
||
| 1 | 1 | <?php |
| 2 | - defined('ROOT_PATH') or exit('Access denied'); |
|
| 3 | - /** |
|
| 4 | - * TNH Framework |
|
| 5 | - * |
|
| 6 | - * A simple PHP framework using HMVC architecture |
|
| 7 | - * |
|
| 8 | - * This content is released under the GNU GPL License (GPL) |
|
| 9 | - * |
|
| 10 | - * Copyright (C) 2017 Tony NGUEREZA |
|
| 11 | - * |
|
| 12 | - * This program is free software; you can redistribute it and/or |
|
| 13 | - * modify it under the terms of the GNU General Public License |
|
| 14 | - * as published by the Free Software Foundation; either version 3 |
|
| 15 | - * of the License, or (at your option) any later version. |
|
| 16 | - * |
|
| 17 | - * This program is distributed in the hope that it will be useful, |
|
| 18 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 19 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 20 | - * GNU General Public License for more details. |
|
| 21 | - * |
|
| 22 | - * You should have received a copy of the GNU General Public License |
|
| 23 | - * along with this program; if not, write to the Free Software |
|
| 24 | - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
| 25 | - */ |
|
| 2 | + defined('ROOT_PATH') or exit('Access denied'); |
|
| 3 | + /** |
|
| 4 | + * TNH Framework |
|
| 5 | + * |
|
| 6 | + * A simple PHP framework using HMVC architecture |
|
| 7 | + * |
|
| 8 | + * This content is released under the GNU GPL License (GPL) |
|
| 9 | + * |
|
| 10 | + * Copyright (C) 2017 Tony NGUEREZA |
|
| 11 | + * |
|
| 12 | + * This program is free software; you can redistribute it and/or |
|
| 13 | + * modify it under the terms of the GNU General Public License |
|
| 14 | + * as published by the Free Software Foundation; either version 3 |
|
| 15 | + * of the License, or (at your option) any later version. |
|
| 16 | + * |
|
| 17 | + * This program is distributed in the hope that it will be useful, |
|
| 18 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 19 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 20 | + * GNU General Public License for more details. |
|
| 21 | + * |
|
| 22 | + * You should have received a copy of the GNU General Public License |
|
| 23 | + * along with this program; if not, write to the Free Software |
|
| 24 | + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
| 25 | + */ |
|
| 26 | 26 | |
| 27 | - /** |
|
| 28 | - * This class represent the event detail to dispatch to correspond listener |
|
| 29 | - */ |
|
| 30 | - class EventInfo{ |
|
| 27 | + /** |
|
| 28 | + * This class represent the event detail to dispatch to correspond listener |
|
| 29 | + */ |
|
| 30 | + class EventInfo{ |
|
| 31 | 31 | |
| 32 | - /** |
|
| 33 | - * The event name |
|
| 34 | - * @var string |
|
| 35 | - */ |
|
| 36 | - public $name; |
|
| 32 | + /** |
|
| 33 | + * The event name |
|
| 34 | + * @var string |
|
| 35 | + */ |
|
| 36 | + public $name; |
|
| 37 | 37 | |
| 38 | - /** |
|
| 39 | - * The event data to send to the listeners |
|
| 40 | - * @var mixed |
|
| 41 | - */ |
|
| 42 | - public $payload; |
|
| 38 | + /** |
|
| 39 | + * The event data to send to the listeners |
|
| 40 | + * @var mixed |
|
| 41 | + */ |
|
| 42 | + public $payload; |
|
| 43 | 43 | |
| 44 | - /** |
|
| 45 | - * If the listeners need return the event after treatment or not, false means no need |
|
| 46 | - * return true need return the event. |
|
| 47 | - * @var boolean |
|
| 48 | - */ |
|
| 49 | - public $returnBack; |
|
| 44 | + /** |
|
| 45 | + * If the listeners need return the event after treatment or not, false means no need |
|
| 46 | + * return true need return the event. |
|
| 47 | + * @var boolean |
|
| 48 | + */ |
|
| 49 | + public $returnBack; |
|
| 50 | 50 | |
| 51 | - /** |
|
| 52 | - * This variable indicates if need stop the event propagation |
|
| 53 | - * @var boolean |
|
| 54 | - */ |
|
| 55 | - public $stop; |
|
| 51 | + /** |
|
| 52 | + * This variable indicates if need stop the event propagation |
|
| 53 | + * @var boolean |
|
| 54 | + */ |
|
| 55 | + public $stop; |
|
| 56 | 56 | |
| 57 | - public function __construct($name, $payload = array(), $returnBack = false, $stop = false){ |
|
| 58 | - $this->name = $name; |
|
| 59 | - $this->payload = $payload; |
|
| 60 | - $this->returnBack = $returnBack; |
|
| 61 | - $this->stop = $stop; |
|
| 62 | - } |
|
| 63 | - } |
|
| 57 | + public function __construct($name, $payload = array(), $returnBack = false, $stop = false){ |
|
| 58 | + $this->name = $name; |
|
| 59 | + $this->payload = $payload; |
|
| 60 | + $this->returnBack = $returnBack; |
|
| 61 | + $this->stop = $stop; |
|
| 62 | + } |
|
| 63 | + } |
|