@@ -1,31 +1,31 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | - use PHPUnit\Framework\TestCase; |
|
| 3 | + use PHPUnit\Framework\TestCase; |
|
| 4 | 4 | |
| 5 | - class PDFTest extends TestCase |
|
| 6 | - { |
|
| 5 | + class PDFTest extends TestCase |
|
| 6 | + { |
|
| 7 | 7 | |
| 8 | - public static function setUpBeforeClass() |
|
| 9 | - { |
|
| 8 | + public static function setUpBeforeClass() |
|
| 9 | + { |
|
| 10 | 10 | |
| 11 | - } |
|
| 11 | + } |
|
| 12 | 12 | |
| 13 | - public static function tearDownAfterClass() |
|
| 14 | - { |
|
| 13 | + public static function tearDownAfterClass() |
|
| 14 | + { |
|
| 15 | 15 | |
| 16 | - } |
|
| 16 | + } |
|
| 17 | 17 | |
| 18 | - protected function setUp() |
|
| 19 | - { |
|
| 20 | - } |
|
| 18 | + protected function setUp() |
|
| 19 | + { |
|
| 20 | + } |
|
| 21 | 21 | |
| 22 | - protected function tearDown() |
|
| 23 | - { |
|
| 24 | - } |
|
| 22 | + protected function tearDown() |
|
| 23 | + { |
|
| 24 | + } |
|
| 25 | 25 | |
| 26 | - public function testNotYet() |
|
| 27 | - { |
|
| 28 | - $this->markTestSkipped(); |
|
| 29 | - } |
|
| 26 | + public function testNotYet() |
|
| 27 | + { |
|
| 28 | + $this->markTestSkipped(); |
|
| 29 | + } |
|
| 30 | 30 | |
| 31 | - } |
|
| 32 | 31 | \ No newline at end of file |
| 32 | + } |
|
| 33 | 33 | \ No newline at end of file |
@@ -1,31 +1,31 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | - use PHPUnit\Framework\TestCase; |
|
| 3 | + use PHPUnit\Framework\TestCase; |
|
| 4 | 4 | |
| 5 | - class AssetsTest extends TestCase |
|
| 6 | - { |
|
| 5 | + class AssetsTest extends TestCase |
|
| 6 | + { |
|
| 7 | 7 | |
| 8 | - public static function setUpBeforeClass() |
|
| 9 | - { |
|
| 8 | + public static function setUpBeforeClass() |
|
| 9 | + { |
|
| 10 | 10 | |
| 11 | - } |
|
| 11 | + } |
|
| 12 | 12 | |
| 13 | - public static function tearDownAfterClass() |
|
| 14 | - { |
|
| 13 | + public static function tearDownAfterClass() |
|
| 14 | + { |
|
| 15 | 15 | |
| 16 | - } |
|
| 16 | + } |
|
| 17 | 17 | |
| 18 | - protected function setUp() |
|
| 19 | - { |
|
| 20 | - } |
|
| 18 | + protected function setUp() |
|
| 19 | + { |
|
| 20 | + } |
|
| 21 | 21 | |
| 22 | - protected function tearDown() |
|
| 23 | - { |
|
| 24 | - } |
|
| 22 | + protected function tearDown() |
|
| 23 | + { |
|
| 24 | + } |
|
| 25 | 25 | |
| 26 | - public function testNotYet() |
|
| 27 | - { |
|
| 28 | - $this->markTestSkipped(); |
|
| 29 | - } |
|
| 26 | + public function testNotYet() |
|
| 27 | + { |
|
| 28 | + $this->markTestSkipped(); |
|
| 29 | + } |
|
| 30 | 30 | |
| 31 | - } |
|
| 32 | 31 | \ No newline at end of file |
| 32 | + } |
|
| 33 | 33 | \ No newline at end of file |
@@ -2,12 +2,12 @@ discard block |
||
| 2 | 2 | use PHPUnit\Framework\TestCase; |
| 3 | 3 | class FormValidationTest extends TestCase |
| 4 | 4 | { |
| 5 | - public static function setUpBeforeClass() |
|
| 5 | + public static function setUpBeforeClass() |
|
| 6 | 6 | { |
| 7 | 7 | |
| 8 | 8 | } |
| 9 | 9 | |
| 10 | - public static function tearDownAfterClass() |
|
| 10 | + public static function tearDownAfterClass() |
|
| 11 | 11 | { |
| 12 | 12 | |
| 13 | 13 | } |
@@ -27,109 +27,109 @@ discard block |
||
| 27 | 27 | // tests |
| 28 | 28 | public function testValidationDataIsEmpty() |
| 29 | 29 | { |
| 30 | - $fv = new FormValidation(); |
|
| 31 | - $this->assertEmpty($fv->getData()); |
|
| 30 | + $fv = new FormValidation(); |
|
| 31 | + $this->assertEmpty($fv->getData()); |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | - public function testValidationDataIsNotEmpty() |
|
| 34 | + public function testValidationDataIsNotEmpty() |
|
| 35 | 35 | { |
| 36 | - $fv = new FormValidation(); |
|
| 37 | - $fv->setData(array('name' => 'mike')); |
|
| 38 | - $this->assertNotEmpty($fv->getData()); |
|
| 39 | - $this->assertArrayHasKey('name', $fv->getData()); |
|
| 36 | + $fv = new FormValidation(); |
|
| 37 | + $fv->setData(array('name' => 'mike')); |
|
| 38 | + $this->assertNotEmpty($fv->getData()); |
|
| 39 | + $this->assertArrayHasKey('name', $fv->getData()); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | - public function testCannotDoValidation() |
|
| 42 | + public function testCannotDoValidation() |
|
| 43 | 43 | { |
| 44 | - $fv = new FormValidation(); |
|
| 45 | - $this->assertFalse($fv->canDoValidation()); |
|
| 44 | + $fv = new FormValidation(); |
|
| 45 | + $this->assertFalse($fv->canDoValidation()); |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | - public function testSettingErrorDelimiter() |
|
| 48 | + public function testSettingErrorDelimiter() |
|
| 49 | 49 | { |
| 50 | - $fv = new FormValidation(); |
|
| 51 | - $fv->setErrorDelimiter('<a>', '</b>'); |
|
| 52 | - $this->assertContains('<a>', $fv->getErrorDelimiter()); |
|
| 53 | - $this->assertContains('</b>', $fv->getErrorDelimiter()); |
|
| 50 | + $fv = new FormValidation(); |
|
| 51 | + $fv->setErrorDelimiter('<a>', '</b>'); |
|
| 52 | + $this->assertContains('<a>', $fv->getErrorDelimiter()); |
|
| 53 | + $this->assertContains('</b>', $fv->getErrorDelimiter()); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - public function testSettingErrorsDelimiter() |
|
| 56 | + public function testSettingErrorsDelimiter() |
|
| 57 | 57 | { |
| 58 | - $fv = new FormValidation(); |
|
| 59 | - $fv->setErrorsDelimiter('<foo>', '</bar>'); |
|
| 60 | - $this->assertContains('<foo>', $fv->getErrorsDelimiter()); |
|
| 61 | - $this->assertContains('</bar>', $fv->getErrorsDelimiter()); |
|
| 58 | + $fv = new FormValidation(); |
|
| 59 | + $fv->setErrorsDelimiter('<foo>', '</bar>'); |
|
| 60 | + $this->assertContains('<foo>', $fv->getErrorsDelimiter()); |
|
| 61 | + $this->assertContains('</bar>', $fv->getErrorsDelimiter()); |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | - public function testSettingErrorMessageOverride() |
|
| 64 | + public function testSettingErrorMessageOverride() |
|
| 65 | 65 | { |
| 66 | 66 | |
| 67 | - //field specific message for the rule |
|
| 68 | - $fv = new FormValidation(); |
|
| 69 | - $fv->setData(array('foo' => '')); |
|
| 70 | - $fv->setRule('foo', 'bar', 'required'); |
|
| 71 | - $fv->setMessage('required', 'foo', 'foo required message error'); |
|
| 67 | + //field specific message for the rule |
|
| 68 | + $fv = new FormValidation(); |
|
| 69 | + $fv->setData(array('foo' => '')); |
|
| 70 | + $fv->setRule('foo', 'bar', 'required'); |
|
| 71 | + $fv->setMessage('required', 'foo', 'foo required message error'); |
|
| 72 | 72 | |
| 73 | - $this->assertFalse($fv->run()); |
|
| 74 | - $this->assertContains('foo required message error', $fv->returnErrors()); |
|
| 73 | + $this->assertFalse($fv->run()); |
|
| 74 | + $this->assertContains('foo required message error', $fv->returnErrors()); |
|
| 75 | 75 | |
| 76 | - //global message for the rule |
|
| 77 | - $fv = new FormValidation(); |
|
| 78 | - $fv->setData(array('foo' => '', 'bar' => null)); |
|
| 79 | - $fv->setRule('foo', 'bar', 'required'); |
|
| 80 | - $fv->setRule('bar', 'foo', 'required'); |
|
| 81 | - $fv->setMessage('required', 'global required message error'); |
|
| 76 | + //global message for the rule |
|
| 77 | + $fv = new FormValidation(); |
|
| 78 | + $fv->setData(array('foo' => '', 'bar' => null)); |
|
| 79 | + $fv->setRule('foo', 'bar', 'required'); |
|
| 80 | + $fv->setRule('bar', 'foo', 'required'); |
|
| 81 | + $fv->setMessage('required', 'global required message error'); |
|
| 82 | 82 | |
| 83 | - $this->assertFalse($fv->run()); |
|
| 84 | - $this->assertContains('global required message error', $fv->returnErrors()); |
|
| 83 | + $this->assertFalse($fv->run()); |
|
| 84 | + $this->assertContains('global required message error', $fv->returnErrors()); |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | - public function testSettingCustomErrorMessage() |
|
| 87 | + public function testSettingCustomErrorMessage() |
|
| 88 | 88 | { |
| 89 | 89 | |
| 90 | - $fv = new FormValidation(); |
|
| 91 | - $fv->setData(array('foo' => '')); |
|
| 92 | - $fv->setRule('foo', 'bar', 'required'); |
|
| 93 | - $fv->setCustomError('foo', 'custom foo message error'); |
|
| 90 | + $fv = new FormValidation(); |
|
| 91 | + $fv->setData(array('foo' => '')); |
|
| 92 | + $fv->setRule('foo', 'bar', 'required'); |
|
| 93 | + $fv->setCustomError('foo', 'custom foo message error'); |
|
| 94 | 94 | |
| 95 | - $this->assertFalse($fv->run()); |
|
| 96 | - $this->assertContains('custom foo message error', $fv->returnErrors()); |
|
| 95 | + $this->assertFalse($fv->run()); |
|
| 96 | + $this->assertContains('custom foo message error', $fv->returnErrors()); |
|
| 97 | 97 | |
| 98 | - //with label in the message |
|
| 99 | - $fv = new FormValidation(); |
|
| 100 | - $fv->setData(array('foo' => '')); |
|
| 101 | - $fv->setRule('foo', 'bar', 'required'); |
|
| 102 | - $fv->setCustomError('foo', 'custom "%1" message error'); |
|
| 98 | + //with label in the message |
|
| 99 | + $fv = new FormValidation(); |
|
| 100 | + $fv->setData(array('foo' => '')); |
|
| 101 | + $fv->setRule('foo', 'bar', 'required'); |
|
| 102 | + $fv->setCustomError('foo', 'custom "%1" message error'); |
|
| 103 | 103 | |
| 104 | - $this->assertFalse($fv->run()); |
|
| 105 | - $this->assertContains('custom "bar" message error', $fv->returnErrors()); |
|
| 104 | + $this->assertFalse($fv->run()); |
|
| 105 | + $this->assertContains('custom "bar" message error', $fv->returnErrors()); |
|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | - public function testReturnErrorsArray() |
|
| 108 | + public function testReturnErrorsArray() |
|
| 109 | 109 | { |
| 110 | - $fv = new FormValidation(); |
|
| 111 | - $fv->setRule('name', 'name', 'required'); |
|
| 112 | - $fv->setData(array('name' => '')); |
|
| 113 | - $this->assertFalse($fv->run()); |
|
| 114 | - $this->assertNotEmpty($fv->returnErrors()); |
|
| 110 | + $fv = new FormValidation(); |
|
| 111 | + $fv->setRule('name', 'name', 'required'); |
|
| 112 | + $fv->setData(array('name' => '')); |
|
| 113 | + $this->assertFalse($fv->run()); |
|
| 114 | + $this->assertNotEmpty($fv->returnErrors()); |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | |
| 118 | - public function testRequiredRule() |
|
| 118 | + public function testRequiredRule() |
|
| 119 | 119 | { |
| 120 | - $fv = new FormValidation(); |
|
| 121 | - $fv->setRule('name', 'name', 'required'); |
|
| 122 | - $fv->setData(array('name' => '')); |
|
| 123 | - $this->assertFalse($fv->run()); |
|
| 120 | + $fv = new FormValidation(); |
|
| 121 | + $fv->setRule('name', 'name', 'required'); |
|
| 122 | + $fv->setData(array('name' => '')); |
|
| 123 | + $this->assertFalse($fv->run()); |
|
| 124 | 124 | |
| 125 | - $fv = new FormValidation(); |
|
| 126 | - $fv->setRule('name', 'name', 'required'); |
|
| 127 | - $fv->setData(array('name' => null)); |
|
| 128 | - $this->assertFalse($fv->run()); |
|
| 125 | + $fv = new FormValidation(); |
|
| 126 | + $fv->setRule('name', 'name', 'required'); |
|
| 127 | + $fv->setData(array('name' => null)); |
|
| 128 | + $this->assertFalse($fv->run()); |
|
| 129 | 129 | |
| 130 | - $fv = new FormValidation(); |
|
| 131 | - $fv->setRule('name', 'name', 'required'); |
|
| 132 | - $fv->setData(array('name' => 'tony')); |
|
| 133 | - $this->assertTrue($fv->run()); |
|
| 130 | + $fv = new FormValidation(); |
|
| 131 | + $fv->setRule('name', 'name', 'required'); |
|
| 132 | + $fv->setData(array('name' => 'tony')); |
|
| 133 | + $this->assertTrue($fv->run()); |
|
| 134 | 134 | } |
| 135 | 135 | } |
| 136 | 136 | \ No newline at end of file |
@@ -1,31 +1,31 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | - use PHPUnit\Framework\TestCase; |
|
| 3 | + use PHPUnit\Framework\TestCase; |
|
| 4 | 4 | |
| 5 | - class PaginationTest extends TestCase |
|
| 6 | - { |
|
| 5 | + class PaginationTest extends TestCase |
|
| 6 | + { |
|
| 7 | 7 | |
| 8 | - public static function setUpBeforeClass() |
|
| 9 | - { |
|
| 8 | + public static function setUpBeforeClass() |
|
| 9 | + { |
|
| 10 | 10 | |
| 11 | - } |
|
| 11 | + } |
|
| 12 | 12 | |
| 13 | - public static function tearDownAfterClass() |
|
| 14 | - { |
|
| 13 | + public static function tearDownAfterClass() |
|
| 14 | + { |
|
| 15 | 15 | |
| 16 | - } |
|
| 16 | + } |
|
| 17 | 17 | |
| 18 | - protected function setUp() |
|
| 19 | - { |
|
| 20 | - } |
|
| 18 | + protected function setUp() |
|
| 19 | + { |
|
| 20 | + } |
|
| 21 | 21 | |
| 22 | - protected function tearDown() |
|
| 23 | - { |
|
| 24 | - } |
|
| 22 | + protected function tearDown() |
|
| 23 | + { |
|
| 24 | + } |
|
| 25 | 25 | |
| 26 | - public function testNotYet() |
|
| 27 | - { |
|
| 28 | - $this->markTestSkipped(); |
|
| 29 | - } |
|
| 26 | + public function testNotYet() |
|
| 27 | + { |
|
| 28 | + $this->markTestSkipped(); |
|
| 29 | + } |
|
| 30 | 30 | |
| 31 | - } |
|
| 32 | 31 | \ No newline at end of file |
| 32 | + } |
|
| 33 | 33 | \ No newline at end of file |
@@ -1,94 +1,94 @@ |
||
| 1 | 1 | <?php |
| 2 | - defined('ROOT_PATH') || exit('Access denied'); |
|
| 3 | - /** |
|
| 4 | - * TNH Framework |
|
| 5 | - * |
|
| 6 | - * A simple PHP framework created using the concept of codeigniter with bootstrap twitter |
|
| 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 created using the concept of codeigniter with bootstrap twitter |
|
| 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 file contains the configuration of resources that you want to load automatically: |
|
| 29 | - * personal or system libraries, configuration files, models, |
|
| 30 | - * personal functions or systems that are used most often in your application |
|
| 31 | - * instead of loading them every time you want to use it. |
|
| 32 | - * Note: loading a lot of resources can decrease the performance of your application. |
|
| 33 | - */ |
|
| 27 | + /** |
|
| 28 | + * This file contains the configuration of resources that you want to load automatically: |
|
| 29 | + * personal or system libraries, configuration files, models, |
|
| 30 | + * personal functions or systems that are used most often in your application |
|
| 31 | + * instead of loading them every time you want to use it. |
|
| 32 | + * Note: loading a lot of resources can decrease the performance of your application. |
|
| 33 | + */ |
|
| 34 | 34 | |
| 35 | 35 | |
| 36 | - /** |
|
| 37 | - * If you have personal libraries or systems to load automatically, then list them in the following array. |
|
| 38 | - * For example : |
|
| 39 | - * |
|
| 40 | - * $autoload['libraries'] = array('library1', 'library1'); |
|
| 41 | - * |
|
| 42 | - * Note: Personal libraries have priority over system libraries, |
|
| 43 | - * ie the loading order is as follows: it looks in the folder of the personal libraries, |
|
| 44 | - * if it is found, it is loaded, if not , we search in the system libraries folder, |
|
| 45 | - * before returning an error in case it does not find it. |
|
| 46 | - */ |
|
| 47 | - $autoload['libraries'] = array(); |
|
| 36 | + /** |
|
| 37 | + * If you have personal libraries or systems to load automatically, then list them in the following array. |
|
| 38 | + * For example : |
|
| 39 | + * |
|
| 40 | + * $autoload['libraries'] = array('library1', 'library1'); |
|
| 41 | + * |
|
| 42 | + * Note: Personal libraries have priority over system libraries, |
|
| 43 | + * ie the loading order is as follows: it looks in the folder of the personal libraries, |
|
| 44 | + * if it is found, it is loaded, if not , we search in the system libraries folder, |
|
| 45 | + * before returning an error in case it does not find it. |
|
| 46 | + */ |
|
| 47 | + $autoload['libraries'] = array(); |
|
| 48 | 48 | |
| 49 | - /** |
|
| 50 | - * If you have configuration files to load automatically, then list them in the following array. |
|
| 51 | - * For example : |
|
| 52 | - * |
|
| 53 | - * $autoload['config'] = array('config1', 'config2'); |
|
| 54 | - * |
|
| 55 | - * Note 1: the file name must have as prefix "config_" |
|
| 56 | - * for example "config_name_of_the_file_config.php" and contains as configuration variable the array $config, |
|
| 57 | - * otherwise the system can not find this configuration file. |
|
| 58 | - * For example : |
|
| 59 | - * |
|
| 60 | - * $config['key1'] = value1; |
|
| 61 | - * $config['key2'] = value2; |
|
| 62 | - * |
|
| 63 | - * Note 2: the files to be loaded must be in the folder defined by the constant "CONFIG_PATH" in "index.php". |
|
| 64 | - */ |
|
| 65 | - $autoload['config'] = array(); |
|
| 49 | + /** |
|
| 50 | + * If you have configuration files to load automatically, then list them in the following array. |
|
| 51 | + * For example : |
|
| 52 | + * |
|
| 53 | + * $autoload['config'] = array('config1', 'config2'); |
|
| 54 | + * |
|
| 55 | + * Note 1: the file name must have as prefix "config_" |
|
| 56 | + * for example "config_name_of_the_file_config.php" and contains as configuration variable the array $config, |
|
| 57 | + * otherwise the system can not find this configuration file. |
|
| 58 | + * For example : |
|
| 59 | + * |
|
| 60 | + * $config['key1'] = value1; |
|
| 61 | + * $config['key2'] = value2; |
|
| 62 | + * |
|
| 63 | + * Note 2: the files to be loaded must be in the folder defined by the constant "CONFIG_PATH" in "index.php". |
|
| 64 | + */ |
|
| 65 | + $autoload['config'] = array(); |
|
| 66 | 66 | |
| 67 | - /** |
|
| 68 | - * If you have models to load automatically, then list them in the following table. |
|
| 69 | - * For example : |
|
| 70 | - * |
|
| 71 | - * $autoload['models'] = array('model1', 'model2'); |
|
| 72 | - */ |
|
| 73 | - $autoload['models'] = array(); |
|
| 67 | + /** |
|
| 68 | + * If you have models to load automatically, then list them in the following table. |
|
| 69 | + * For example : |
|
| 70 | + * |
|
| 71 | + * $autoload['models'] = array('model1', 'model2'); |
|
| 72 | + */ |
|
| 73 | + $autoload['models'] = array(); |
|
| 74 | 74 | |
| 75 | - /** |
|
| 76 | - * If you have system or personal functions to load automatically, specify them in the following array. |
|
| 77 | - * For example : |
|
| 78 | - * |
|
| 79 | - * $autoload['functions'] = array('function1', 'function2'); |
|
| 80 | - * |
|
| 81 | - * Note: Personal functions have priority over system functions, |
|
| 82 | - * that is to say that the order of loading is the following : it looks in the directory of the personal functions, |
|
| 83 | - * if it is found, it is loaded, otherwise, it looks in the directory of the system functions, |
|
| 84 | - * before returning an error in case he does not find it. |
|
| 85 | - */ |
|
| 86 | - $autoload['functions'] = array(); |
|
| 75 | + /** |
|
| 76 | + * If you have system or personal functions to load automatically, specify them in the following array. |
|
| 77 | + * For example : |
|
| 78 | + * |
|
| 79 | + * $autoload['functions'] = array('function1', 'function2'); |
|
| 80 | + * |
|
| 81 | + * Note: Personal functions have priority over system functions, |
|
| 82 | + * that is to say that the order of loading is the following : it looks in the directory of the personal functions, |
|
| 83 | + * if it is found, it is loaded, otherwise, it looks in the directory of the system functions, |
|
| 84 | + * before returning an error in case he does not find it. |
|
| 85 | + */ |
|
| 86 | + $autoload['functions'] = array(); |
|
| 87 | 87 | |
| 88 | - /** |
|
| 89 | - * If you have system or personal language to load automatically, specify them in the following array. |
|
| 90 | - * For example : |
|
| 91 | - * |
|
| 92 | - * $autoload['languages'] = array('lang1', 'lang2'); |
|
| 93 | - */ |
|
| 94 | - $autoload['languages'] = array(); |
|
| 88 | + /** |
|
| 89 | + * If you have system or personal language to load automatically, specify them in the following array. |
|
| 90 | + * For example : |
|
| 91 | + * |
|
| 92 | + * $autoload['languages'] = array('lang1', 'lang2'); |
|
| 93 | + */ |
|
| 94 | + $autoload['languages'] = array(); |
|
@@ -1,341 +1,341 @@ |
||
| 1 | 1 | <?php |
| 2 | - defined('ROOT_PATH') || exit('Access denied'); |
|
| 3 | - /** |
|
| 4 | - * TNH Framework |
|
| 5 | - * |
|
| 6 | - * A simple PHP framework created using the concept of codeigniter with bootstrap twitter |
|
| 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 created using the concept of codeigniter with bootstrap twitter |
|
| 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 file contains the main configuration of your application |
|
| 29 | - * web address, front controller, error logging, session parameters, CSRF, Cache, |
|
| 30 | - * Whitelist IP access, etc. |
|
| 31 | - */ |
|
| 27 | + /** |
|
| 28 | + * This file contains the main configuration of your application |
|
| 29 | + * web address, front controller, error logging, session parameters, CSRF, Cache, |
|
| 30 | + * Whitelist IP access, etc. |
|
| 31 | + */ |
|
| 32 | 32 | |
| 33 | - /*+---------------------------------------------------------------+ |
|
| 33 | + /*+---------------------------------------------------------------+ |
|
| 34 | 34 | * Basic configuration section |
| 35 | 35 | +------------------------------------------------------------------+ |
| 36 | 36 | */ |
| 37 | 37 | |
| 38 | - /** |
|
| 39 | - * The web address of your application. |
|
| 40 | - * |
|
| 41 | - * The address of your application or website terminated by a slash. |
|
| 42 | - * You can use a domain name or IP address, for example: |
|
| 43 | - * |
|
| 44 | - * $config['base_url'] = 'http://www.mysite.com'; |
|
| 45 | - * or |
|
| 46 | - * $config['base_url'] = 'http://198.15.25.12'; |
|
| 47 | - * |
|
| 48 | - * If this value is empty, we try to determine it automatically by using |
|
| 49 | - * the server variables "SERVER_ADDR" or "SCRIPT_NAME", |
|
| 50 | - * we recommend that you specify this value for a server in production this may reduce the performance of your application. |
|
| 51 | - */ |
|
| 52 | - $config['base_url'] = ''; |
|
| 38 | + /** |
|
| 39 | + * The web address of your application. |
|
| 40 | + * |
|
| 41 | + * The address of your application or website terminated by a slash. |
|
| 42 | + * You can use a domain name or IP address, for example: |
|
| 43 | + * |
|
| 44 | + * $config['base_url'] = 'http://www.mysite.com'; |
|
| 45 | + * or |
|
| 46 | + * $config['base_url'] = 'http://198.15.25.12'; |
|
| 47 | + * |
|
| 48 | + * If this value is empty, we try to determine it automatically by using |
|
| 49 | + * the server variables "SERVER_ADDR" or "SCRIPT_NAME", |
|
| 50 | + * we recommend that you specify this value for a server in production this may reduce the performance of your application. |
|
| 51 | + */ |
|
| 52 | + $config['base_url'] = ''; |
|
| 53 | 53 | |
| 54 | - /** |
|
| 55 | - * The front controller |
|
| 56 | - * |
|
| 57 | - * This represents the name of the file called by the application during the loading |
|
| 58 | - * process generally the file "index.php". |
|
| 59 | - * If your webserver supports the url rewrite module, then you can leave this value empty. |
|
| 60 | - * You will find a sample file to hide this file in the url inside the root folder of your |
|
| 61 | - * application "htaccess.txt" for the apache web server just rename it to ".htaccess" |
|
| 62 | - * |
|
| 63 | - * Without the rewrite module url enabled, leave this value to "index.php", in this case your urls look like: |
|
| 64 | - * |
|
| 65 | - * http://www.yoursite.com/index.php/controller/method |
|
| 66 | - * |
|
| 67 | - * otherwise if the module is available and activated you can put this value empty and your urls look like: |
|
| 68 | - * |
|
| 69 | - * http://www.yoursite.com/controller/method |
|
| 70 | - * |
|
| 71 | - */ |
|
| 72 | - $config['front_controller'] = 'index.php'; |
|
| 54 | + /** |
|
| 55 | + * The front controller |
|
| 56 | + * |
|
| 57 | + * This represents the name of the file called by the application during the loading |
|
| 58 | + * process generally the file "index.php". |
|
| 59 | + * If your webserver supports the url rewrite module, then you can leave this value empty. |
|
| 60 | + * You will find a sample file to hide this file in the url inside the root folder of your |
|
| 61 | + * application "htaccess.txt" for the apache web server just rename it to ".htaccess" |
|
| 62 | + * |
|
| 63 | + * Without the rewrite module url enabled, leave this value to "index.php", in this case your urls look like: |
|
| 64 | + * |
|
| 65 | + * http://www.yoursite.com/index.php/controller/method |
|
| 66 | + * |
|
| 67 | + * otherwise if the module is available and activated you can put this value empty and your urls look like: |
|
| 68 | + * |
|
| 69 | + * http://www.yoursite.com/controller/method |
|
| 70 | + * |
|
| 71 | + */ |
|
| 72 | + $config['front_controller'] = 'index.php'; |
|
| 73 | 73 | |
| 74 | - /** |
|
| 75 | - * Url suffix |
|
| 76 | - */ |
|
| 77 | - $config['url_suffix'] = ''; |
|
| 74 | + /** |
|
| 75 | + * Url suffix |
|
| 76 | + */ |
|
| 77 | + $config['url_suffix'] = ''; |
|
| 78 | 78 | |
| 79 | - /** |
|
| 80 | - * site charset |
|
| 81 | - */ |
|
| 82 | - $config['charset'] = 'UTF-8'; |
|
| 79 | + /** |
|
| 80 | + * site charset |
|
| 81 | + */ |
|
| 82 | + $config['charset'] = 'UTF-8'; |
|
| 83 | 83 | |
| 84 | - /** |
|
| 85 | - * Compress the output before send to browser |
|
| 86 | - * |
|
| 87 | - * Enables Gzip output compression for faster page loads. When enabled, |
|
| 88 | - * the Response class will test whether your server supports Gzip. |
|
| 89 | - * Even if it does, however, not all browsers support compression |
|
| 90 | - * so enable only if you are reasonably sure your visitors can handle it. |
|
| 91 | - * |
|
| 92 | - * This is only used if "zlib.output_compression" is turned off in your php configuration. |
|
| 93 | - * Please do not use it together with httpd-level output compression. |
|
| 94 | - * |
|
| 95 | - * IMPORTANT NOTE: If you are getting a blank page when compression is enabled it |
|
| 96 | - * means you are prematurely outputting something to your browser. It could |
|
| 97 | - * even be a line of whitespace at the end of one of your scripts. For |
|
| 98 | - * compression to work, nothing can be sent before the output buffer is called |
|
| 99 | - * by the Response class. Do not 'echo' any values with compression enabled. |
|
| 100 | - */ |
|
| 101 | - $config['compress_output'] = false; |
|
| 84 | + /** |
|
| 85 | + * Compress the output before send to browser |
|
| 86 | + * |
|
| 87 | + * Enables Gzip output compression for faster page loads. When enabled, |
|
| 88 | + * the Response class will test whether your server supports Gzip. |
|
| 89 | + * Even if it does, however, not all browsers support compression |
|
| 90 | + * so enable only if you are reasonably sure your visitors can handle it. |
|
| 91 | + * |
|
| 92 | + * This is only used if "zlib.output_compression" is turned off in your php configuration. |
|
| 93 | + * Please do not use it together with httpd-level output compression. |
|
| 94 | + * |
|
| 95 | + * IMPORTANT NOTE: If you are getting a blank page when compression is enabled it |
|
| 96 | + * means you are prematurely outputting something to your browser. It could |
|
| 97 | + * even be a line of whitespace at the end of one of your scripts. For |
|
| 98 | + * compression to work, nothing can be sent before the output buffer is called |
|
| 99 | + * by the Response class. Do not 'echo' any values with compression enabled. |
|
| 100 | + */ |
|
| 101 | + $config['compress_output'] = false; |
|
| 102 | 102 | |
| 103 | - /*+---------------------------------------------------------------+ |
|
| 103 | + /*+---------------------------------------------------------------+ |
|
| 104 | 104 | * Language configuration section |
| 105 | 105 | +------------------------------------------------------------------+ |
| 106 | 106 | */ |
| 107 | - /** |
|
| 108 | - * list of available supported language |
|
| 109 | - * array( |
|
| 110 | - * 'lang_key' => 'human readable' |
|
| 111 | - * ) |
|
| 112 | - */ |
|
| 113 | - $config['languages'] = array('en' => 'english'); |
|
| 107 | + /** |
|
| 108 | + * list of available supported language |
|
| 109 | + * array( |
|
| 110 | + * 'lang_key' => 'human readable' |
|
| 111 | + * ) |
|
| 112 | + */ |
|
| 113 | + $config['languages'] = array('en' => 'english'); |
|
| 114 | 114 | |
| 115 | - /** |
|
| 116 | - * the default language to use if can not find the client language |
|
| 117 | - * need match with the array key of the supported languages |
|
| 118 | - */ |
|
| 119 | - $config['default_language'] = 'en'; //en = english, fr = french |
|
| 115 | + /** |
|
| 116 | + * the default language to use if can not find the client language |
|
| 117 | + * need match with the array key of the supported languages |
|
| 118 | + */ |
|
| 119 | + $config['default_language'] = 'en'; //en = english, fr = french |
|
| 120 | 120 | |
| 121 | - /** |
|
| 122 | - * the name of cookie used to store the client language |
|
| 123 | - */ |
|
| 124 | - $config['language_cookie_name'] = 'cookie_lang'; |
|
| 121 | + /** |
|
| 122 | + * the name of cookie used to store the client language |
|
| 123 | + */ |
|
| 124 | + $config['language_cookie_name'] = 'cookie_lang'; |
|
| 125 | 125 | |
| 126 | 126 | |
| 127 | - /*+---------------------------------------------------------------+ |
|
| 127 | + /*+---------------------------------------------------------------+ |
|
| 128 | 128 | * Logs configuration section |
| 129 | 129 | +------------------------------------------------------------------+ |
| 130 | 130 | */ |
| 131 | 131 | |
| 132 | - /** |
|
| 133 | - * The log level |
|
| 134 | - * |
|
| 135 | - * The valid level are: OFF, NONE, FATAL, ERROR, WARNING, WARN, INFO, DEBUG, ALL |
|
| 136 | - * |
|
| 137 | - * 'OFF' or 'NONE' = do not save log |
|
| 138 | - * 'FATAL' = enable log for fatal level and above (FATAL) |
|
| 139 | - * 'ERROR' = enable log for error level and above (ERROR, FATAL) |
|
| 140 | - * 'WARNING' or WARN = enable log for warning level and above (WARNING, ERROR, FATAL) |
|
| 141 | - * 'INFO' = enable log for info level and above (INFO, WARNING, ERROR, FATAL) |
|
| 142 | - * 'DEBUG' = enable log for debug level and above (DEBUG, INFO, WARNING, ERROR, FATAL) |
|
| 143 | - * 'ALL' = enable log for all level |
|
| 144 | - * |
|
| 145 | - * The default value is NONE if the config value is: null, '', 0, false |
|
| 146 | - * |
|
| 147 | - * Note: in production environment it's recommand to set the log level to 'WARNING' if not in small |
|
| 148 | - * of time the log file size will increase very fast and will cost the application performance |
|
| 149 | - * and also the filesystem usage of your server. |
|
| 150 | - */ |
|
| 151 | - $config['log_level'] = 'NONE'; |
|
| 132 | + /** |
|
| 133 | + * The log level |
|
| 134 | + * |
|
| 135 | + * The valid level are: OFF, NONE, FATAL, ERROR, WARNING, WARN, INFO, DEBUG, ALL |
|
| 136 | + * |
|
| 137 | + * 'OFF' or 'NONE' = do not save log |
|
| 138 | + * 'FATAL' = enable log for fatal level and above (FATAL) |
|
| 139 | + * 'ERROR' = enable log for error level and above (ERROR, FATAL) |
|
| 140 | + * 'WARNING' or WARN = enable log for warning level and above (WARNING, ERROR, FATAL) |
|
| 141 | + * 'INFO' = enable log for info level and above (INFO, WARNING, ERROR, FATAL) |
|
| 142 | + * 'DEBUG' = enable log for debug level and above (DEBUG, INFO, WARNING, ERROR, FATAL) |
|
| 143 | + * 'ALL' = enable log for all level |
|
| 144 | + * |
|
| 145 | + * The default value is NONE if the config value is: null, '', 0, false |
|
| 146 | + * |
|
| 147 | + * Note: in production environment it's recommand to set the log level to 'WARNING' if not in small |
|
| 148 | + * of time the log file size will increase very fast and will cost the application performance |
|
| 149 | + * and also the filesystem usage of your server. |
|
| 150 | + */ |
|
| 151 | + $config['log_level'] = 'NONE'; |
|
| 152 | 152 | |
| 153 | 153 | |
| 154 | - /** |
|
| 155 | - * The path to log directory |
|
| 156 | - * |
|
| 157 | - * The path that the log data will be saved ending with de "/" or "\", leave empty if you |
|
| 158 | - * want use the default configuration |
|
| 159 | - * warning : if set, this directory must exist and will be writable and owned by the web server |
|
| 160 | - * else the default value will be used i.e the constant LOG_PATH |
|
| 161 | - * for security raison this directory must be outside of the document root of your |
|
| 162 | - * website. |
|
| 163 | - */ |
|
| 164 | - $config['log_save_path'] = ''; |
|
| 154 | + /** |
|
| 155 | + * The path to log directory |
|
| 156 | + * |
|
| 157 | + * The path that the log data will be saved ending with de "/" or "\", leave empty if you |
|
| 158 | + * want use the default configuration |
|
| 159 | + * warning : if set, this directory must exist and will be writable and owned by the web server |
|
| 160 | + * else the default value will be used i.e the constant LOG_PATH |
|
| 161 | + * for security raison this directory must be outside of the document root of your |
|
| 162 | + * website. |
|
| 163 | + */ |
|
| 164 | + $config['log_save_path'] = ''; |
|
| 165 | 165 | |
| 166 | - /** |
|
| 167 | - * The logger name to use for the log |
|
| 168 | - * |
|
| 169 | - * You can use an string or array of logger. If this config is set so means only log message with this or these logger(s) will be accepted |
|
| 170 | - * |
|
| 171 | - * Example: |
|
| 172 | - * //using string for only one logger name |
|
| 173 | - * $config['log_logger_name'] = 'MY_LOGGER'; //only log message with MY_LOGGER will be saved in file. |
|
| 174 | - * |
|
| 175 | - * //using array for muliple logger names |
|
| 176 | - * $config['log_logger_name'] = array('MY_LOGGER1', 'MY_LOGGER2'); //only log message with MY_LOGGER1 or MY_LOGGER2 will be saved in file. |
|
| 177 | - */ |
|
| 178 | - $config['log_logger_name'] = ''; |
|
| 166 | + /** |
|
| 167 | + * The logger name to use for the log |
|
| 168 | + * |
|
| 169 | + * You can use an string or array of logger. If this config is set so means only log message with this or these logger(s) will be accepted |
|
| 170 | + * |
|
| 171 | + * Example: |
|
| 172 | + * //using string for only one logger name |
|
| 173 | + * $config['log_logger_name'] = 'MY_LOGGER'; //only log message with MY_LOGGER will be saved in file. |
|
| 174 | + * |
|
| 175 | + * //using array for muliple logger names |
|
| 176 | + * $config['log_logger_name'] = array('MY_LOGGER1', 'MY_LOGGER2'); //only log message with MY_LOGGER1 or MY_LOGGER2 will be saved in file. |
|
| 177 | + */ |
|
| 178 | + $config['log_logger_name'] = ''; |
|
| 179 | 179 | |
| 180 | 180 | |
| 181 | - /*+---------------------------------------------------------------+ |
|
| 181 | + /*+---------------------------------------------------------------+ |
|
| 182 | 182 | * Session configuration section |
| 183 | 183 | +------------------------------------------------------------------+ |
| 184 | 184 | */ |
| 185 | 185 | |
| 186 | - /** |
|
| 187 | - * The session name |
|
| 188 | - * |
|
| 189 | - * By default is PHPSESSID. this must be alpha-numerical characters |
|
| 190 | - */ |
|
| 191 | - $config['session_name'] = 'PHPSESSID'; |
|
| 186 | + /** |
|
| 187 | + * The session name |
|
| 188 | + * |
|
| 189 | + * By default is PHPSESSID. this must be alpha-numerical characters |
|
| 190 | + */ |
|
| 191 | + $config['session_name'] = 'PHPSESSID'; |
|
| 192 | 192 | |
| 193 | - /** |
|
| 194 | - * Session save path |
|
| 195 | - * |
|
| 196 | - * The path that the session data will be saved, leave empty if you |
|
| 197 | - * want use the default configuration in the php.ini |
|
| 198 | - * warning : if set, this directory must exist and will be writable and owned by the web server |
|
| 199 | - * for security raison this directory must be outside of the document root of your |
|
| 200 | - * website. |
|
| 201 | - * Note: if the session handler is "database" the session_save_path is the model name to use |
|
| 202 | - */ |
|
| 203 | - $config['session_save_path'] = ''; |
|
| 193 | + /** |
|
| 194 | + * Session save path |
|
| 195 | + * |
|
| 196 | + * The path that the session data will be saved, leave empty if you |
|
| 197 | + * want use the default configuration in the php.ini |
|
| 198 | + * warning : if set, this directory must exist and will be writable and owned by the web server |
|
| 199 | + * for security raison this directory must be outside of the document root of your |
|
| 200 | + * website. |
|
| 201 | + * Note: if the session handler is "database" the session_save_path is the model name to use |
|
| 202 | + */ |
|
| 203 | + $config['session_save_path'] = ''; |
|
| 204 | 204 | |
| 205 | - /** |
|
| 206 | - * Session handler |
|
| 207 | - * |
|
| 208 | - * The session handler that we will use to manage the session. |
|
| 209 | - * currently the possible values are "files", "database". |
|
| 210 | - */ |
|
| 211 | - $config['session_handler'] = 'files'; |
|
| 205 | + /** |
|
| 206 | + * Session handler |
|
| 207 | + * |
|
| 208 | + * The session handler that we will use to manage the session. |
|
| 209 | + * currently the possible values are "files", "database". |
|
| 210 | + */ |
|
| 211 | + $config['session_handler'] = 'files'; |
|
| 212 | 212 | |
| 213 | - /** |
|
| 214 | - * Session secret |
|
| 215 | - * |
|
| 216 | - * This is used to hash the session data if the config "session_handler" is set to "database" |
|
| 217 | - * warning : do not change this value until you already set |
|
| 218 | - * for security raison use the very complicated value include $%)@^&^\''\'\' |
|
| 219 | - * NOTE: this value is an base64 so you need use the tool that generate it, like |
|
| 220 | - * PHP function base64_encode() |
|
| 221 | - */ |
|
| 222 | - $config['session_secret'] = ''; |
|
| 213 | + /** |
|
| 214 | + * Session secret |
|
| 215 | + * |
|
| 216 | + * This is used to hash the session data if the config "session_handler" is set to "database" |
|
| 217 | + * warning : do not change this value until you already set |
|
| 218 | + * for security raison use the very complicated value include $%)@^&^\''\'\' |
|
| 219 | + * NOTE: this value is an base64 so you need use the tool that generate it, like |
|
| 220 | + * PHP function base64_encode() |
|
| 221 | + */ |
|
| 222 | + $config['session_secret'] = ''; |
|
| 223 | 223 | |
| 224 | - /** |
|
| 225 | - * number of second that consider the session already expire |
|
| 226 | - */ |
|
| 227 | - $config['session_inactivity_time'] = 600; //in second |
|
| 224 | + /** |
|
| 225 | + * number of second that consider the session already expire |
|
| 226 | + */ |
|
| 227 | + $config['session_inactivity_time'] = 600; //in second |
|
| 228 | 228 | |
| 229 | - /** |
|
| 230 | - * Session cookie lifetime |
|
| 231 | - * |
|
| 232 | - * The cookie lifetime that the session will be dropped in seconds, leave 0 if you want |
|
| 233 | - * the cookie expire after the browser is closed |
|
| 234 | - */ |
|
| 235 | - $config['session_cookie_lifetime'] = 0; |
|
| 229 | + /** |
|
| 230 | + * Session cookie lifetime |
|
| 231 | + * |
|
| 232 | + * The cookie lifetime that the session will be dropped in seconds, leave 0 if you want |
|
| 233 | + * the cookie expire after the browser is closed |
|
| 234 | + */ |
|
| 235 | + $config['session_cookie_lifetime'] = 0; |
|
| 236 | 236 | |
| 237 | - /** |
|
| 238 | - * Session cookie path |
|
| 239 | - * |
|
| 240 | - * The path to your website that the cookie is available "/" means all path is available |
|
| 241 | - * example : /mysubdirectory => available in http://www.mysite.com/mysubdirectory |
|
| 242 | - */ |
|
| 243 | - $config['session_cookie_path'] = '/'; |
|
| 237 | + /** |
|
| 238 | + * Session cookie path |
|
| 239 | + * |
|
| 240 | + * The path to your website that the cookie is available "/" means all path is available |
|
| 241 | + * example : /mysubdirectory => available in http://www.mysite.com/mysubdirectory |
|
| 242 | + */ |
|
| 243 | + $config['session_cookie_path'] = '/'; |
|
| 244 | 244 | |
| 245 | - /** |
|
| 246 | - * Session cookie domain |
|
| 247 | - * |
|
| 248 | - * The domain of your website that the cookie is available if you want the cookie is available |
|
| 249 | - * in all your subdomain use this dot before the domain name for example ".mysite.com". |
|
| 250 | - * leave empty if you want use the default configuration |
|
| 251 | - */ |
|
| 252 | - $config['session_cookie_domain'] = ''; |
|
| 245 | + /** |
|
| 246 | + * Session cookie domain |
|
| 247 | + * |
|
| 248 | + * The domain of your website that the cookie is available if you want the cookie is available |
|
| 249 | + * in all your subdomain use this dot before the domain name for example ".mysite.com". |
|
| 250 | + * leave empty if you want use the default configuration |
|
| 251 | + */ |
|
| 252 | + $config['session_cookie_domain'] = ''; |
|
| 253 | 253 | |
| 254 | - /** |
|
| 255 | - * Session cookie secure |
|
| 256 | - * |
|
| 257 | - * If your website use SSL i.e https, you set "true" for this configuration, so the cookie |
|
| 258 | - * is available only if the website use the secure connection else set this value to "false" |
|
| 259 | - */ |
|
| 260 | - $config['session_cookie_secure'] = false; |
|
| 254 | + /** |
|
| 255 | + * Session cookie secure |
|
| 256 | + * |
|
| 257 | + * If your website use SSL i.e https, you set "true" for this configuration, so the cookie |
|
| 258 | + * is available only if the website use the secure connection else set this value to "false" |
|
| 259 | + */ |
|
| 260 | + $config['session_cookie_secure'] = false; |
|
| 261 | 261 | |
| 262 | 262 | |
| 263 | - /*+---------------------------------------------------------------+ |
|
| 263 | + /*+---------------------------------------------------------------+ |
|
| 264 | 264 | * CSRF configuration section |
| 265 | 265 | +------------------------------------------------------------------+ |
| 266 | 266 | */ |
| 267 | 267 | |
| 268 | - /** |
|
| 269 | - * CSRF status |
|
| 270 | - * |
|
| 271 | - * if you would to use the CSRF (that we recommand you), set this key to true |
|
| 272 | - */ |
|
| 273 | - $config['csrf_enable'] = false; |
|
| 268 | + /** |
|
| 269 | + * CSRF status |
|
| 270 | + * |
|
| 271 | + * if you would to use the CSRF (that we recommand you), set this key to true |
|
| 272 | + */ |
|
| 273 | + $config['csrf_enable'] = false; |
|
| 274 | 274 | |
| 275 | - /** |
|
| 276 | - * CSRF key |
|
| 277 | - * |
|
| 278 | - * the key used to store the csrf data |
|
| 279 | - */ |
|
| 280 | - $config['csrf_key'] = 'csrf_key'; |
|
| 275 | + /** |
|
| 276 | + * CSRF key |
|
| 277 | + * |
|
| 278 | + * the key used to store the csrf data |
|
| 279 | + */ |
|
| 280 | + $config['csrf_key'] = 'csrf_key'; |
|
| 281 | 281 | |
| 282 | - /** |
|
| 283 | - * CSRF expire |
|
| 284 | - * |
|
| 285 | - * expire time in seconds of the CSRF data |
|
| 286 | - */ |
|
| 287 | - $config['csrf_expire'] = 120; |
|
| 282 | + /** |
|
| 283 | + * CSRF expire |
|
| 284 | + * |
|
| 285 | + * expire time in seconds of the CSRF data |
|
| 286 | + */ |
|
| 287 | + $config['csrf_expire'] = 120; |
|
| 288 | 288 | |
| 289 | 289 | |
| 290 | - /*+---------------------------------------------------------------+ |
|
| 290 | + /*+---------------------------------------------------------------+ |
|
| 291 | 291 | * Cache configuration section |
| 292 | 292 | +------------------------------------------------------------------+ |
| 293 | 293 | */ |
| 294 | 294 | |
| 295 | - /** |
|
| 296 | - * Cache status |
|
| 297 | - * |
|
| 298 | - * If you would to use the cache functionnality set this value to true |
|
| 299 | - */ |
|
| 300 | - $config['cache_enable'] = false; |
|
| 295 | + /** |
|
| 296 | + * Cache status |
|
| 297 | + * |
|
| 298 | + * If you would to use the cache functionnality set this value to true |
|
| 299 | + */ |
|
| 300 | + $config['cache_enable'] = false; |
|
| 301 | 301 | |
| 302 | - /** |
|
| 303 | - * Cache Time To Live |
|
| 304 | - * |
|
| 305 | - * expire time in seconds of the cache data |
|
| 306 | - */ |
|
| 307 | - $config['cache_ttl'] = 120; //in second |
|
| 302 | + /** |
|
| 303 | + * Cache Time To Live |
|
| 304 | + * |
|
| 305 | + * expire time in seconds of the cache data |
|
| 306 | + */ |
|
| 307 | + $config['cache_ttl'] = 120; //in second |
|
| 308 | 308 | |
| 309 | - /** |
|
| 310 | - * Cache handler class |
|
| 311 | - * |
|
| 312 | - * The cache handler class inside (CORE_CLASSES_CACHE_PATH, LIBRARY_PATH) directories that implements |
|
| 313 | - * the interface "CacheInterface" that we will use to manage the cache. |
|
| 314 | - * currently the possible values are "FileCache", "ApcCache". |
|
| 315 | - */ |
|
| 316 | - $config['cache_handler'] = 'FileCache'; |
|
| 309 | + /** |
|
| 310 | + * Cache handler class |
|
| 311 | + * |
|
| 312 | + * The cache handler class inside (CORE_CLASSES_CACHE_PATH, LIBRARY_PATH) directories that implements |
|
| 313 | + * the interface "CacheInterface" that we will use to manage the cache. |
|
| 314 | + * currently the possible values are "FileCache", "ApcCache". |
|
| 315 | + */ |
|
| 316 | + $config['cache_handler'] = 'FileCache'; |
|
| 317 | 317 | |
| 318 | 318 | |
| 319 | - /*+---------------------------------------------------------------+ |
|
| 319 | + /*+---------------------------------------------------------------+ |
|
| 320 | 320 | * White list IP access configuration section |
| 321 | 321 | +------------------------------------------------------------------+ |
| 322 | 322 | */ |
| 323 | 323 | |
| 324 | - /** |
|
| 325 | - * White list ip status |
|
| 326 | - * |
|
| 327 | - * if you would to use the white list ip access, set this key to true |
|
| 328 | - */ |
|
| 329 | - $config['white_list_ip_enable'] = false; |
|
| 324 | + /** |
|
| 325 | + * White list ip status |
|
| 326 | + * |
|
| 327 | + * if you would to use the white list ip access, set this key to true |
|
| 328 | + */ |
|
| 329 | + $config['white_list_ip_enable'] = false; |
|
| 330 | 330 | |
| 331 | - /** |
|
| 332 | - * White listed ip addresses |
|
| 333 | - * |
|
| 334 | - * add the allowed ip address list to access this application. |
|
| 335 | - * You can use the wildcard address |
|
| 336 | - * @example: '18.90.09.*', '10.*.*.*', '*' |
|
| 337 | - * |
|
| 338 | - */ |
|
| 339 | - $config['white_list_ip_addresses'] = array('127.0.0.1', '::1'); |
|
| 331 | + /** |
|
| 332 | + * White listed ip addresses |
|
| 333 | + * |
|
| 334 | + * add the allowed ip address list to access this application. |
|
| 335 | + * You can use the wildcard address |
|
| 336 | + * @example: '18.90.09.*', '10.*.*.*', '*' |
|
| 337 | + * |
|
| 338 | + */ |
|
| 339 | + $config['white_list_ip_addresses'] = array('127.0.0.1', '::1'); |
|
| 340 | 340 | |
| 341 | - |
|
| 342 | 341 | \ No newline at end of file |
| 342 | + |
|
| 343 | 343 | \ No newline at end of file |
@@ -1,127 +1,127 @@ |
||
| 1 | 1 | <?php |
| 2 | - defined('ROOT_PATH') || exit('Access denied'); |
|
| 3 | - /** |
|
| 4 | - * TNH Framework |
|
| 5 | - * |
|
| 6 | - * A simple PHP framework created using the concept of codeigniter with bootstrap twitter |
|
| 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 created using the concept of codeigniter with bootstrap twitter |
|
| 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 file contains the connection information to your database, this file is read when you load the "Database" library. |
|
| 29 | - * You will find all its configuration parameters at your web hosting. |
|
| 30 | - */ |
|
| 27 | + /** |
|
| 28 | + * This file contains the connection information to your database, this file is read when you load the "Database" library. |
|
| 29 | + * You will find all its configuration parameters at your web hosting. |
|
| 30 | + */ |
|
| 31 | 31 | |
| 32 | - /** |
|
| 33 | - * The type or driver of your database. |
|
| 34 | - * |
|
| 35 | - * Note: the "Database" library uses the PHP PDO extension to interact with your database, |
|
| 36 | - * so most of the PDO supported drivers namely: mysql, pgsql, sqlite, oracle are accepted. |
|
| 37 | - * For example : |
|
| 38 | - * |
|
| 39 | - * $db['driver'] = 'mysql'; // for MySQL Database |
|
| 40 | - * or |
|
| 41 | - * $db['driver'] = 'pgsql'; // for PostgreSQL Database |
|
| 42 | - * or |
|
| 43 | - * $db['driver'] = 'sqlite'; // for SQLite Database |
|
| 44 | - * or |
|
| 45 | - * $db['driver'] = 'oracle'; // for Oracle Database |
|
| 46 | - * |
|
| 47 | - */ |
|
| 48 | - $db['driver'] = 'mysql'; |
|
| 32 | + /** |
|
| 33 | + * The type or driver of your database. |
|
| 34 | + * |
|
| 35 | + * Note: the "Database" library uses the PHP PDO extension to interact with your database, |
|
| 36 | + * so most of the PDO supported drivers namely: mysql, pgsql, sqlite, oracle are accepted. |
|
| 37 | + * For example : |
|
| 38 | + * |
|
| 39 | + * $db['driver'] = 'mysql'; // for MySQL Database |
|
| 40 | + * or |
|
| 41 | + * $db['driver'] = 'pgsql'; // for PostgreSQL Database |
|
| 42 | + * or |
|
| 43 | + * $db['driver'] = 'sqlite'; // for SQLite Database |
|
| 44 | + * or |
|
| 45 | + * $db['driver'] = 'oracle'; // for Oracle Database |
|
| 46 | + * |
|
| 47 | + */ |
|
| 48 | + $db['driver'] = 'mysql'; |
|
| 49 | 49 | |
| 50 | - /** |
|
| 51 | - * The address of your database server |
|
| 52 | - * |
|
| 53 | - * It can be a domain name or IP address, for example: |
|
| 54 | - * $db['hostname'] = 'localhost'; |
|
| 55 | - * or |
|
| 56 | - * $db['hostname'] = 'mysql.host.com'; |
|
| 57 | - * or |
|
| 58 | - * $db['hostname'] = '187.15.14.17'; |
|
| 59 | - * * or if port is not a standart port |
|
| 60 | - * $db['hostname'] = 'mydb.server.com:6356'; |
|
| 61 | - */ |
|
| 62 | - $db['hostname'] = 'localhost'; |
|
| 50 | + /** |
|
| 51 | + * The address of your database server |
|
| 52 | + * |
|
| 53 | + * It can be a domain name or IP address, for example: |
|
| 54 | + * $db['hostname'] = 'localhost'; |
|
| 55 | + * or |
|
| 56 | + * $db['hostname'] = 'mysql.host.com'; |
|
| 57 | + * or |
|
| 58 | + * $db['hostname'] = '187.15.14.17'; |
|
| 59 | + * * or if port is not a standart port |
|
| 60 | + * $db['hostname'] = 'mydb.server.com:6356'; |
|
| 61 | + */ |
|
| 62 | + $db['hostname'] = 'localhost'; |
|
| 63 | 63 | |
| 64 | - /** |
|
| 65 | - * The username of your database server |
|
| 66 | - * for example : |
|
| 67 | - * |
|
| 68 | - * $db['username'] = 'root'; |
|
| 69 | - * or |
|
| 70 | - * $db['username'] = 'myusername'; |
|
| 71 | - */ |
|
| 72 | - $db['username'] = 'root'; |
|
| 64 | + /** |
|
| 65 | + * The username of your database server |
|
| 66 | + * for example : |
|
| 67 | + * |
|
| 68 | + * $db['username'] = 'root'; |
|
| 69 | + * or |
|
| 70 | + * $db['username'] = 'myusername'; |
|
| 71 | + */ |
|
| 72 | + $db['username'] = 'root'; |
|
| 73 | 73 | |
| 74 | 74 | |
| 75 | - /** |
|
| 76 | - * The password of your database server. |
|
| 77 | - * |
|
| 78 | - * Note: Some configuration settings on some database management systems do not allow |
|
| 79 | - * connection with a user without password, so it is recommended to set a password for this user for a security measure. |
|
| 80 | - * for example : |
|
| 81 | - * |
|
| 82 | - * $db['password'] = ''; //for an empty password, this is the case most often, if you are in local, ie for the user "root". |
|
| 83 | - * or |
|
| 84 | - * $db['password'] = 'M@5CUR3P@$$W0rd'; |
|
| 85 | - */ |
|
| 86 | - $db['password'] = ''; |
|
| 75 | + /** |
|
| 76 | + * The password of your database server. |
|
| 77 | + * |
|
| 78 | + * Note: Some configuration settings on some database management systems do not allow |
|
| 79 | + * connection with a user without password, so it is recommended to set a password for this user for a security measure. |
|
| 80 | + * for example : |
|
| 81 | + * |
|
| 82 | + * $db['password'] = ''; //for an empty password, this is the case most often, if you are in local, ie for the user "root". |
|
| 83 | + * or |
|
| 84 | + * $db['password'] = 'M@5CUR3P@$$W0rd'; |
|
| 85 | + */ |
|
| 86 | + $db['password'] = ''; |
|
| 87 | 87 | |
| 88 | - /** |
|
| 89 | - * The name of your database |
|
| 90 | - * |
|
| 91 | - * for example : |
|
| 92 | - * |
|
| 93 | - * $db['database'] = 'database_name'; |
|
| 94 | - */ |
|
| 95 | - $db['database'] = ''; |
|
| 88 | + /** |
|
| 89 | + * The name of your database |
|
| 90 | + * |
|
| 91 | + * for example : |
|
| 92 | + * |
|
| 93 | + * $db['database'] = 'database_name'; |
|
| 94 | + */ |
|
| 95 | + $db['database'] = ''; |
|
| 96 | 96 | |
| 97 | 97 | |
| 98 | - /** |
|
| 99 | - * The character set that will be used by the database server. |
|
| 100 | - * for example : |
|
| 101 | - * |
|
| 102 | - * $db['charset'] = 'utf8'; |
|
| 103 | - */ |
|
| 104 | - $db['charset'] = 'utf8'; |
|
| 98 | + /** |
|
| 99 | + * The character set that will be used by the database server. |
|
| 100 | + * for example : |
|
| 101 | + * |
|
| 102 | + * $db['charset'] = 'utf8'; |
|
| 103 | + */ |
|
| 104 | + $db['charset'] = 'utf8'; |
|
| 105 | 105 | |
| 106 | - /** |
|
| 107 | - * In addition to the character set, a certain database management system allows you to |
|
| 108 | - * choose how the data will be classified (ORDER BY) by what is called a "COLLATE". |
|
| 109 | - * This makes it possible, for example, to answer the classic problem of case sensitivity. |
|
| 110 | - * for example : |
|
| 111 | - * $db['collation'] = 'utf8_general_ci'; |
|
| 112 | - */ |
|
| 113 | - $db['collation'] = 'utf8_general_ci'; |
|
| 106 | + /** |
|
| 107 | + * In addition to the character set, a certain database management system allows you to |
|
| 108 | + * choose how the data will be classified (ORDER BY) by what is called a "COLLATE". |
|
| 109 | + * This makes it possible, for example, to answer the classic problem of case sensitivity. |
|
| 110 | + * for example : |
|
| 111 | + * $db['collation'] = 'utf8_general_ci'; |
|
| 112 | + */ |
|
| 113 | + $db['collation'] = 'utf8_general_ci'; |
|
| 114 | 114 | |
| 115 | 115 | |
| 116 | - /** |
|
| 117 | - * If your tables in your database contain prefixes, this is the case most on some application, |
|
| 118 | - * to avoid the conflict of name of the tables between different database, |
|
| 119 | - * it is possible to define prefixes for the tables. |
|
| 120 | - * for example : |
|
| 121 | - * |
|
| 122 | - * $db['prefix'] = 'pf_'; |
|
| 123 | - * or |
|
| 124 | - * |
|
| 125 | - * $db['prefix'] = 'my_db_'; |
|
| 126 | - */ |
|
| 127 | - $db['prefix'] = ''; |
|
| 128 | 116 | \ No newline at end of file |
| 117 | + /** |
|
| 118 | + * If your tables in your database contain prefixes, this is the case most on some application, |
|
| 119 | + * to avoid the conflict of name of the tables between different database, |
|
| 120 | + * it is possible to define prefixes for the tables. |
|
| 121 | + * for example : |
|
| 122 | + * |
|
| 123 | + * $db['prefix'] = 'pf_'; |
|
| 124 | + * or |
|
| 125 | + * |
|
| 126 | + * $db['prefix'] = 'my_db_'; |
|
| 127 | + */ |
|
| 128 | + $db['prefix'] = ''; |
|
| 129 | 129 | \ No newline at end of file |
@@ -1,88 +1,88 @@ |
||
| 1 | 1 | <?php |
| 2 | - defined('ROOT_PATH') || exit('Access denied'); |
|
| 3 | - /** |
|
| 4 | - * TNH Framework |
|
| 5 | - * |
|
| 6 | - * A simple PHP framework created using the concept of codeigniter with bootstrap twitter |
|
| 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 created using the concept of codeigniter with bootstrap twitter |
|
| 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 file contains the configuration of your routes that is to say that links to your URLs. |
|
| 29 | - * The index of the $route array contains the url address to capture and the value contains |
|
| 30 | - * the name of the module, controller and the method to call. |
|
| 31 | - * For example : |
|
| 32 | - * |
|
| 33 | - * $route['/users/login'] = 'moduleUsers#UsersController@login_action'; |
|
| 34 | - * |
|
| 35 | - * it means, if the user type in the address bar an URL like http://yoursite.com/users/login, |
|
| 36 | - * that will call the module "moduleUsers", the controller "UsersController" and the method "login_action". |
|
| 37 | - * Note 1: it is recommended that each index in the $route array start with a slash "/" |
|
| 38 | - * otherwise on some system this will not work. |
|
| 39 | - * Note 2: to define the default controller route (homepage) of your application you use only the index "/" |
|
| 40 | - * for example the following route represents the homepage: |
|
| 41 | - * |
|
| 42 | - * $route['/'] = 'Home'; //only the controller or module name |
|
| 43 | - * |
|
| 44 | - * $route['/'] = 'Home@index'; //only the controller or module name with the method |
|
| 45 | - * |
|
| 46 | - * $route['/'] = 'module#Home@index'; //with module name, controller and method |
|
| 47 | - * |
|
| 48 | - * Note 3: If the method is not specified then the "index" method will be used as |
|
| 49 | - * default method. For example in the case of our homepage, this will be able to make: |
|
| 50 | - * |
|
| 51 | - * $route['/'] = 'Home'; |
|
| 52 | - * |
|
| 53 | - * Note 4: All methods called must have "public" visibility if you know the principle of |
|
| 54 | - * Object Oriented Programming, you know what visibility means (public, protected, private). |
|
| 55 | - * |
|
| 56 | - * In the index of your route, you can use the markers (:num), (:alpha), (:alnum) and (:any) which correspond |
|
| 57 | - * respectively to the regular expression [0-9], [a-zA-Z], [a-zA-Z0-9] and. *. |
|
| 58 | - * For example : |
|
| 59 | - * |
|
| 60 | - * - $route['/profile/(:num)'] = 'UsersController@profile'; => http://yoursite.com/profile/4 will be captured but |
|
| 61 | - * http://yoursite.com/profile/a will not captured. |
|
| 62 | - * |
|
| 63 | - * - $route['/profile/(:alpha)'] = 'UsersController@profile'; => http://yoursite.com/profile/a will be captured |
|
| 64 | - * but http://yoursite.com/profile/1457 will not captured. |
|
| 65 | - * |
|
| 66 | - * - $route['/profile/(:alnum)'] = 'UsersController@profile'; => http://yoursite.com/profile/4a, |
|
| 67 | - * http://yoursite.com/profile/7 will be captured but http://yoursite.com/profile/7-dangerous will not captured. |
|
| 68 | - * |
|
| 69 | - * - $route['/(:any)'] = 'ArticleController@read'; => http://yoursite.com/1-my-super-article, |
|
| 70 | - * http://yoursite.com/7, will be captured. |
|
| 71 | - * |
|
| 72 | - * Note 5: The order of definition of each route is important. |
|
| 73 | - * For example, the following definitions work: |
|
| 74 | - * |
|
| 75 | - * $route['/article/add'] = 'Article@add'; |
|
| 76 | - * $route['article/(:any)'] = 'Article@read'; |
|
| 77 | - * |
|
| 78 | - * however, the following definitions does not work as intended |
|
| 79 | - * |
|
| 80 | - * $route['article/(:any)'] = 'Article@read'; |
|
| 81 | - * $route['/article/add'] = 'Article@add'; |
|
| 82 | - * |
|
| 83 | - */ |
|
| 27 | + /** |
|
| 28 | + * This file contains the configuration of your routes that is to say that links to your URLs. |
|
| 29 | + * The index of the $route array contains the url address to capture and the value contains |
|
| 30 | + * the name of the module, controller and the method to call. |
|
| 31 | + * For example : |
|
| 32 | + * |
|
| 33 | + * $route['/users/login'] = 'moduleUsers#UsersController@login_action'; |
|
| 34 | + * |
|
| 35 | + * it means, if the user type in the address bar an URL like http://yoursite.com/users/login, |
|
| 36 | + * that will call the module "moduleUsers", the controller "UsersController" and the method "login_action". |
|
| 37 | + * Note 1: it is recommended that each index in the $route array start with a slash "/" |
|
| 38 | + * otherwise on some system this will not work. |
|
| 39 | + * Note 2: to define the default controller route (homepage) of your application you use only the index "/" |
|
| 40 | + * for example the following route represents the homepage: |
|
| 41 | + * |
|
| 42 | + * $route['/'] = 'Home'; //only the controller or module name |
|
| 43 | + * |
|
| 44 | + * $route['/'] = 'Home@index'; //only the controller or module name with the method |
|
| 45 | + * |
|
| 46 | + * $route['/'] = 'module#Home@index'; //with module name, controller and method |
|
| 47 | + * |
|
| 48 | + * Note 3: If the method is not specified then the "index" method will be used as |
|
| 49 | + * default method. For example in the case of our homepage, this will be able to make: |
|
| 50 | + * |
|
| 51 | + * $route['/'] = 'Home'; |
|
| 52 | + * |
|
| 53 | + * Note 4: All methods called must have "public" visibility if you know the principle of |
|
| 54 | + * Object Oriented Programming, you know what visibility means (public, protected, private). |
|
| 55 | + * |
|
| 56 | + * In the index of your route, you can use the markers (:num), (:alpha), (:alnum) and (:any) which correspond |
|
| 57 | + * respectively to the regular expression [0-9], [a-zA-Z], [a-zA-Z0-9] and. *. |
|
| 58 | + * For example : |
|
| 59 | + * |
|
| 60 | + * - $route['/profile/(:num)'] = 'UsersController@profile'; => http://yoursite.com/profile/4 will be captured but |
|
| 61 | + * http://yoursite.com/profile/a will not captured. |
|
| 62 | + * |
|
| 63 | + * - $route['/profile/(:alpha)'] = 'UsersController@profile'; => http://yoursite.com/profile/a will be captured |
|
| 64 | + * but http://yoursite.com/profile/1457 will not captured. |
|
| 65 | + * |
|
| 66 | + * - $route['/profile/(:alnum)'] = 'UsersController@profile'; => http://yoursite.com/profile/4a, |
|
| 67 | + * http://yoursite.com/profile/7 will be captured but http://yoursite.com/profile/7-dangerous will not captured. |
|
| 68 | + * |
|
| 69 | + * - $route['/(:any)'] = 'ArticleController@read'; => http://yoursite.com/1-my-super-article, |
|
| 70 | + * http://yoursite.com/7, will be captured. |
|
| 71 | + * |
|
| 72 | + * Note 5: The order of definition of each route is important. |
|
| 73 | + * For example, the following definitions work: |
|
| 74 | + * |
|
| 75 | + * $route['/article/add'] = 'Article@add'; |
|
| 76 | + * $route['article/(:any)'] = 'Article@read'; |
|
| 77 | + * |
|
| 78 | + * however, the following definitions does not work as intended |
|
| 79 | + * |
|
| 80 | + * $route['article/(:any)'] = 'Article@read'; |
|
| 81 | + * $route['/article/add'] = 'Article@add'; |
|
| 82 | + * |
|
| 83 | + */ |
|
| 84 | 84 | |
| 85 | - /** |
|
| 86 | - * The default route like your home page |
|
| 87 | - */ |
|
| 88 | - $route['/'] = 'Home'; |
|
| 89 | 85 | \ No newline at end of file |
| 86 | + /** |
|
| 87 | + * The default route like your home page |
|
| 88 | + */ |
|
| 89 | + $route['/'] = 'Home'; |
|
| 90 | 90 | \ No newline at end of file |
@@ -1,90 +1,90 @@ |
||
| 1 | 1 | <?php |
| 2 | - defined('ROOT_PATH') || exit('Access denied'); |
|
| 3 | - /** |
|
| 4 | - * TNH Framework |
|
| 5 | - * |
|
| 6 | - * A simple PHP framework created using the concept of codeigniter with bootstrap twitter |
|
| 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 created using the concept of codeigniter with bootstrap twitter |
|
| 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 file contains the pagination library configuration of your application |
|
| 29 | - */ |
|
| 27 | + /** |
|
| 28 | + * This file contains the pagination library configuration of your application |
|
| 29 | + */ |
|
| 30 | 30 | |
| 31 | - /** |
|
| 32 | - * Number of pagination digit |
|
| 33 | - */ |
|
| 34 | - $config['nb_link'] = 10; |
|
| 31 | + /** |
|
| 32 | + * Number of pagination digit |
|
| 33 | + */ |
|
| 34 | + $config['nb_link'] = 10; |
|
| 35 | 35 | |
| 36 | - /** |
|
| 37 | - * The pagination. |
|
| 38 | - * |
|
| 39 | - * Represents the number of data to display per page. |
|
| 40 | - * Note: this value must be strictly greater than zero (0) |
|
| 41 | - */ |
|
| 42 | - $config['pagination_per_page'] = 10; |
|
| 36 | + /** |
|
| 37 | + * The pagination. |
|
| 38 | + * |
|
| 39 | + * Represents the number of data to display per page. |
|
| 40 | + * Note: this value must be strictly greater than zero (0) |
|
| 41 | + */ |
|
| 42 | + $config['pagination_per_page'] = 10; |
|
| 43 | 43 | |
| 44 | 44 | |
| 45 | - /** |
|
| 46 | - * The query string name used to fetch the current page |
|
| 47 | - */ |
|
| 48 | - $config['page_query_string_name'] = 'page'; |
|
| 45 | + /** |
|
| 46 | + * The query string name used to fetch the current page |
|
| 47 | + */ |
|
| 48 | + $config['page_query_string_name'] = 'page'; |
|
| 49 | 49 | |
| 50 | - /** |
|
| 51 | - * The opened and closed tag for active link |
|
| 52 | - */ |
|
| 53 | - $config['active_link_open'] = '<li class = "active"><a href = "#">'; |
|
| 54 | - $config['active_link_close'] = '</a></li>'; |
|
| 50 | + /** |
|
| 51 | + * The opened and closed tag for active link |
|
| 52 | + */ |
|
| 53 | + $config['active_link_open'] = '<li class = "active"><a href = "#">'; |
|
| 54 | + $config['active_link_close'] = '</a></li>'; |
|
| 55 | 55 | |
| 56 | - /** |
|
| 57 | - * The opened and closed tag for previous link |
|
| 58 | - */ |
|
| 59 | - $config['previous_open'] = '<li>'; |
|
| 60 | - $config['previous_close'] = '</li>'; |
|
| 56 | + /** |
|
| 57 | + * The opened and closed tag for previous link |
|
| 58 | + */ |
|
| 59 | + $config['previous_open'] = '<li>'; |
|
| 60 | + $config['previous_close'] = '</li>'; |
|
| 61 | 61 | |
| 62 | - /** |
|
| 63 | - * The opened and closed tag for next link |
|
| 64 | - */ |
|
| 65 | - $config['next_open'] = '<li>'; |
|
| 66 | - $config['next_close'] = '</li>'; |
|
| 62 | + /** |
|
| 63 | + * The opened and closed tag for next link |
|
| 64 | + */ |
|
| 65 | + $config['next_open'] = '<li>'; |
|
| 66 | + $config['next_close'] = '</li>'; |
|
| 67 | 67 | |
| 68 | 68 | |
| 69 | - /** |
|
| 70 | - * The displayed text for previous and next link |
|
| 71 | - */ |
|
| 72 | - $config['previous_text'] = '««'; |
|
| 73 | - $config['next_text'] = '»»'; |
|
| 69 | + /** |
|
| 70 | + * The displayed text for previous and next link |
|
| 71 | + */ |
|
| 72 | + $config['previous_text'] = '««'; |
|
| 73 | + $config['next_text'] = '»»'; |
|
| 74 | 74 | |
| 75 | - /** |
|
| 76 | - * The opened and closed tag for the pagination bloc |
|
| 77 | - */ |
|
| 78 | - $config['pagination_open'] = '<ul class = "pagination">'; |
|
| 79 | - $config['pagination_close'] = '</ul>'; |
|
| 75 | + /** |
|
| 76 | + * The opened and closed tag for the pagination bloc |
|
| 77 | + */ |
|
| 78 | + $config['pagination_open'] = '<ul class = "pagination">'; |
|
| 79 | + $config['pagination_close'] = '</ul>'; |
|
| 80 | 80 | |
| 81 | - /** |
|
| 82 | - * The opened and closed tag for each link digit |
|
| 83 | - */ |
|
| 84 | - $config['digit_open'] = '<li>'; |
|
| 85 | - $config['digit_close'] = '</li>'; |
|
| 81 | + /** |
|
| 82 | + * The opened and closed tag for each link digit |
|
| 83 | + */ |
|
| 84 | + $config['digit_open'] = '<li>'; |
|
| 85 | + $config['digit_close'] = '</li>'; |
|
| 86 | 86 | |
| 87 | - /** |
|
| 88 | - * The HTML attributes to use in each link |
|
| 89 | - */ |
|
| 90 | - $config['attributes'] = array(); |
|
| 91 | 87 | \ No newline at end of file |
| 88 | + /** |
|
| 89 | + * The HTML attributes to use in each link |
|
| 90 | + */ |
|
| 91 | + $config['attributes'] = array(); |
|
| 92 | 92 | \ No newline at end of file |