├── app ├── Filters │ └── .gitkeep ├── Helpers │ ├── .gitkeep │ └── phpjwt_helper.php ├── Language │ └── .gitkeep ├── Libraries │ └── .gitkeep ├── Models │ └── .gitkeep ├── ThirdParty │ └── .gitkeep ├── Database │ ├── Seeds │ │ └── .gitkeep │ └── Migrations │ │ └── .gitkeep ├── Config │ ├── ForeignCharacters.php │ ├── Honeypot.php │ ├── Images.php │ ├── Boot │ │ ├── production.php │ │ ├── testing.php │ │ └── development.php │ ├── Filters.php │ ├── Services.php │ ├── Pager.php │ ├── Encryption.php │ ├── View.php │ ├── Exceptions.php │ ├── Events.php │ ├── Migrations.php │ ├── ContentSecurityPolicy.php │ ├── Modules.php │ ├── Validation.php │ ├── Format.php │ └── DocTypes.php ├── .htaccess ├── Views │ ├── errors │ │ ├── cli │ │ │ ├── error_404.php │ │ │ ├── production.php │ │ │ └── error_exception.php │ │ └── html │ │ │ ├── production.php │ │ │ └── error_404.php │ ├── posts │ │ └── post.php │ ├── templates │ │ └── footer.php │ ├── welcome_message.php │ └── login.php ├── index.html ├── Common.php └── Controllers │ ├── Home.php │ ├── BaseController.php │ └── Login.php ├── tests └── _support │ ├── HTTP │ ├── Files │ │ ├── CookiesHolder.txt │ │ └── tmp │ │ │ ├── fileA.txt │ │ │ └── fileB.txt │ ├── MockIncomingRequest.php │ ├── MockResponse.php │ └── MockCURLRequest.php │ ├── View │ ├── Views │ │ ├── simpler.php │ │ └── simple.php │ ├── MockTable.php │ └── SampleClass.php │ ├── Autoloader │ └── UnnamespacedClass.php │ ├── Images │ ├── ci-logo.gif │ ├── ci-logo.jpeg │ ├── ci-logo.png │ ├── EXIFsamples │ │ ├── up.jpg │ │ ├── down.jpg │ │ ├── left.jpg │ │ ├── right.jpg │ │ ├── up-mirrored.jpg │ │ ├── down-mirrored.jpg │ │ ├── left-mirrored.jpg │ │ └── right-mirrored.jpg │ └── Steveston_dusk.JPG │ ├── Database │ ├── MockTestClass.php │ ├── MockQuery.php │ ├── MockBuilder.php │ ├── SupportMigrations │ │ └── 001_Some_migration.php │ ├── Seeds │ │ └── CITestSeeder.php │ └── MockResult.php │ ├── Validation │ ├── uploads │ │ └── phpUxc0ty │ └── TestRules.php │ ├── CIUnitTestCase.php │ ├── CIDatabaseTestCase.php │ ├── Language │ ├── ru │ │ └── Language.php │ ├── ab │ │ └── Allin.php │ ├── en-ZZ │ │ └── More.php │ ├── en │ │ ├── Allin.php │ │ ├── More.php │ │ └── Core.php │ ├── ab-CD │ │ └── Allin.php │ ├── SecondMockLanguage.php │ └── MockLanguage.php │ ├── Config │ ├── Routes.php │ ├── BadRegistrar.php │ ├── Registrar.php │ ├── MockAutoload.php │ ├── MockServices.php │ ├── MockCLIConfig.php │ └── MockAppConfig.php │ ├── Files │ ├── able │ │ ├── apple.php │ │ ├── fig_3.php │ │ └── prune_ripe.php │ └── baker │ │ └── banana.php │ ├── SomeEntity.php │ ├── MockCodeIgniter.php │ ├── RESTful │ ├── Worker.php │ ├── Worker2.php │ ├── MockResourcePresenter.php │ └── MockResourceController.php │ ├── Commands │ ├── AbstractInfo.php │ ├── CommandsTestStreamFilter.php │ └── AppInfo.php │ ├── Models │ ├── SimpleEntity.php │ ├── SecondaryModel.php │ ├── JobModel.php │ ├── EntityModel.php │ ├── UserModel.php │ ├── ValidErrorsModel.php │ ├── ValidModel.php │ └── EventModel.php │ ├── Security │ └── MockSecurity.php │ ├── Log │ ├── Handlers │ │ ├── MockChromeHandler.php │ │ ├── MockFileHandler.php │ │ └── TestHandler.php │ └── TestLogger.php │ ├── MigrationTestMigrations │ └── Database │ │ └── Migrations │ │ ├── 2018-01-24-102301_Some_migration.php │ │ ├── 2018-01-24-102300_Another_migration.py │ │ └── 2018-01-24-102302_Another_migration.php │ ├── MockCommon.php │ ├── _bootstrap.php │ ├── Controllers │ └── Popcorn.php │ ├── Services.php │ ├── Session │ └── MockSession.php │ └── Events │ └── MockEvents.php ├── public ├── robots.txt ├── favicon.ico ├── favicon-16x16.png ├── favicon-32x32.png ├── apple-touch-icon.png ├── android-chrome-192x192.png ├── android-chrome-512x512.png ├── chosen │ └── chosen_v1.8.7 │ │ ├── chosen-sprite.png │ │ ├── chosen-sprite@2x.png │ │ ├── docsupport │ │ ├── chosen.png │ │ ├── oss-credit.png │ │ ├── init.js │ │ ├── init.proto.js │ │ └── prism.css │ │ ├── composer.json │ │ └── LICENSE.md ├── manifest.json ├── ckeditor5 │ ├── package.json │ ├── src │ │ └── ckeditor.js │ ├── LICENSE.md │ └── webpack.config.js ├── index.php └── .htaccess ├── system ├── Validation │ ├── Views │ │ ├── single.php │ │ └── list.php │ └── Exceptions │ │ └── ValidationException.php ├── ThirdParty │ ├── Kint │ │ └── kint.php │ ├── PSR │ │ └── Log │ │ │ ├── InvalidArgumentException.php │ │ │ ├── LoggerAwareInterface.php │ │ │ ├── LogLevel.php │ │ │ ├── LoggerAwareTrait.php │ │ │ └── NullLogger.php │ └── ZendEscaper │ │ └── Exception │ │ ├── ExceptionInterface.php │ │ ├── RuntimeException.php │ │ └── InvalidArgumentException.php ├── .htaccess ├── Exceptions │ ├── EmergencyError.php │ ├── AlertError.php │ ├── CriticalError.php │ ├── ExceptionInterface.php │ ├── ConfigException.php │ ├── ModelException.php │ ├── PageNotFoundException.php │ ├── FrameworkException.php │ ├── DownloadException.php │ └── CastException.php ├── index.html ├── Router │ └── Exceptions │ │ ├── RedirectException.php │ │ └── RouterException.php ├── Cache │ └── Exceptions │ │ ├── ExceptionInterface.php │ │ └── CacheException.php ├── Files │ └── Exceptions │ │ ├── FileNotFoundException.php │ │ └── FileException.php ├── Database │ ├── Exceptions │ │ ├── ExceptionInterface.php │ │ ├── DataException.php │ │ └── DatabaseException.php │ ├── MySQLi │ │ ├── Builder.php │ │ └── Utils.php │ └── SQLite3 │ │ └── Utils.php ├── Debug │ └── Toolbar │ │ ├── Views │ │ ├── _files.tpl │ │ ├── _database.tpl │ │ ├── _events.tpl │ │ ├── _logs.tpl │ │ ├── _history.tpl │ │ ├── _routes.tpl │ │ └── _config.tpl │ │ └── Collectors │ │ └── Config.php ├── Security │ └── Exceptions │ │ └── SecurityException.php ├── Log │ └── Exceptions │ │ └── LogException.php ├── CLI │ └── Exceptions │ │ └── CLIException.php ├── Pager │ ├── Views │ │ ├── default_head.php │ │ ├── default_simple.php │ │ └── default_full.php │ └── Exceptions │ │ └── PagerException.php ├── Language │ └── en │ │ ├── Log.php │ │ ├── RESTful.php │ │ ├── Entity.php │ │ ├── Redirect.php │ │ ├── Files.php │ │ ├── Language.php │ │ ├── Format.php │ │ ├── Filters.php │ │ ├── Router.php │ │ ├── CLI.php │ │ ├── Cache.php │ │ ├── Core.php │ │ ├── Number.php │ │ ├── Cast.php │ │ ├── Encryption.php │ │ ├── View.php │ │ ├── Pager.php │ │ ├── Session.php │ │ ├── Time.php │ │ ├── Database.php │ │ ├── Email.php │ │ ├── Images.php │ │ └── Migrations.php ├── Filters │ └── Exceptions │ │ └── FilterException.php ├── Format │ ├── Exceptions │ │ └── FormatException.php │ ├── FormatterInterface.php │ └── JSONFormatter.php ├── Honeypot │ └── Exceptions │ │ └── HoneypotException.php ├── Session │ └── Exceptions │ │ └── SessionException.php ├── Encryption │ ├── Exceptions │ │ └── EncryptionException.php │ └── EncrypterInterface.php ├── I18n │ └── Exceptions │ │ └── I18nException.php ├── Commands │ ├── Server │ │ └── rewrite.php │ └── Sessions │ │ └── Views │ │ └── migration.tpl.php ├── View │ └── Exceptions │ │ └── ViewException.php └── Images │ └── Exceptions │ └── ImageException.php ├── writable ├── .htaccess ├── cache │ └── index.html ├── logs │ └── index.html ├── session │ └── index.html └── uploads │ └── index.html ├── phpunit.xml.dist ├── README.md ├── composer.json ├── spark └── .gitignore /app/Filters/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/Helpers/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/Language/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/Libraries/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/Models/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/ThirdParty/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/Database/Seeds/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/Database/Migrations/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/_support/HTTP/Files/CookiesHolder.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/_support/HTTP/Files/tmp/fileA.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/_support/HTTP/Files/tmp/fileB.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /tests/_support/View/Views/simpler.php: -------------------------------------------------------------------------------- 1 |

{testString}

-------------------------------------------------------------------------------- /tests/_support/View/Views/simple.php: -------------------------------------------------------------------------------- 1 |

-------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thiru112/CI4-Blog/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /system/Validation/Views/single.php: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /public/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thiru112/CI4-Blog/HEAD/public/favicon-16x16.png -------------------------------------------------------------------------------- /public/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thiru112/CI4-Blog/HEAD/public/favicon-32x32.png -------------------------------------------------------------------------------- /tests/_support/Autoloader/UnnamespacedClass.php: -------------------------------------------------------------------------------- 1 | 2 | Require all denied 3 | 4 | 5 | Deny from all 6 | 7 | -------------------------------------------------------------------------------- /tests/_support/Images/EXIFsamples/down-mirrored.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thiru112/CI4-Blog/HEAD/tests/_support/Images/EXIFsamples/down-mirrored.jpg -------------------------------------------------------------------------------- /tests/_support/Images/EXIFsamples/left-mirrored.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thiru112/CI4-Blog/HEAD/tests/_support/Images/EXIFsamples/left-mirrored.jpg -------------------------------------------------------------------------------- /tests/_support/Images/EXIFsamples/right-mirrored.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thiru112/CI4-Blog/HEAD/tests/_support/Images/EXIFsamples/right-mirrored.jpg -------------------------------------------------------------------------------- /app/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | Require all denied 3 | 4 | 5 | Deny from all 6 | 7 | -------------------------------------------------------------------------------- /app/Views/errors/cli/error_404.php: -------------------------------------------------------------------------------- 1 | 'Whatever this would be, translated', 5 | ]; 6 | -------------------------------------------------------------------------------- /writable/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | Require all denied 3 | 4 | 5 | Deny from all 6 | 7 | -------------------------------------------------------------------------------- /system/ThirdParty/PSR/Log/InvalidArgumentException.php: -------------------------------------------------------------------------------- 1 | 'gluttony', 5 | 'tre' => 'greed', 6 | 'six' => 'envy', 7 | 'sev' => 'pride', 8 | ]; 9 | -------------------------------------------------------------------------------- /app/Views/errors/cli/production.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /tests/_support/Config/Routes.php: -------------------------------------------------------------------------------- 1 | add('testing', 'TestController::index'); 8 | -------------------------------------------------------------------------------- /system/Exceptions/EmergencyError.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /writable/cache/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /writable/logs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /writable/session/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /writable/uploads/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /tests/_support/Language/en-ZZ/More.php: -------------------------------------------------------------------------------- 1 | 'These are not the droids you are looking for', 4 | 'notaMoon' => "It's made of cheese", 5 | 'wisdom' => 'There is no try', 6 | ]; 7 | -------------------------------------------------------------------------------- /system/Exceptions/AlertError.php: -------------------------------------------------------------------------------- 1 | 'four calling birds', 5 | 'fiv' => 'five golden rings', 6 | 'six' => 'six geese a laying', 7 | 'sev' => 'seven swans a swimming', 8 | ]; 9 | -------------------------------------------------------------------------------- /system/Router/Exceptions/RedirectException.php: -------------------------------------------------------------------------------- 1 | null, 11 | 'bar' => null, 12 | ]; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /tests/_support/Language/ab-CD/Allin.php: -------------------------------------------------------------------------------- 1 | 'Pyramid of Giza', 5 | 'tre' => 'Colossus of Rhodes', 6 | 'fiv' => 'Temple of Artemis', 7 | 'sev' => 'Hanging Gardens of Babylon', 8 | ]; 9 | -------------------------------------------------------------------------------- /tests/_support/Language/en/More.php: -------------------------------------------------------------------------------- 1 | 'These are not the droids you are looking for', 5 | 'notaMoon' => "That's no moon... it's a space station", 6 | 'cannotMove' => 'I have a very bad feeling about this', 7 | ]; 8 | -------------------------------------------------------------------------------- /system/Validation/Views/list.php: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | -------------------------------------------------------------------------------- /tests/_support/MockCodeIgniter.php: -------------------------------------------------------------------------------- 1 | 2 | $post) : ?> 3 |

4 |
5 |
6 | 7 |
8 | 9 | -------------------------------------------------------------------------------- /system/Files/Exceptions/FileNotFoundException.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | {userFiles} 4 | 5 | {name} 6 | {path} 7 | 8 | {/userFiles} 9 | {coreFiles} 10 | 11 | {name} 12 | {path} 13 | 14 | {/coreFiles} 15 | 16 | 17 | -------------------------------------------------------------------------------- /system/Debug/Toolbar/Views/_database.tpl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | {queries} 10 | 11 | 12 | 13 | 14 | {/queries} 15 | 16 |
TimeQuery String
{duration}{! sql !}
17 | -------------------------------------------------------------------------------- /system/ThirdParty/PSR/Log/LogLevel.php: -------------------------------------------------------------------------------- 1 | CSRFHash; 11 | 12 | return $this; 13 | } 14 | 15 | //-------------------------------------------------------------------- 16 | 17 | } 18 | -------------------------------------------------------------------------------- /tests/_support/Models/JobModel.php: -------------------------------------------------------------------------------- 1 | model; 12 | } 13 | 14 | public function getModelName() 15 | { 16 | return $this->modelName; 17 | } 18 | 19 | public function getFormat() 20 | { 21 | return $this->format; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /tests/_support/View/MockTable.php: -------------------------------------------------------------------------------- 1 | setSurroundCount(0); 7 | 8 | if ($pager->hasPrevious()) 9 | { 10 | echo '' . PHP_EOL; 11 | } 12 | 13 | echo '' . PHP_EOL; 14 | 15 | if ($pager->hasNext()) 16 | { 17 | echo '' . PHP_EOL; 18 | } 19 | -------------------------------------------------------------------------------- /tests/_support/RESTful/MockResourceController.php: -------------------------------------------------------------------------------- 1 | model; 12 | } 13 | 14 | public function getModelName() 15 | { 16 | return $this->modelName; 17 | } 18 | 19 | public function getFormat() 20 | { 21 | return $this->format; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /system/Debug/Toolbar/Views/_events.tpl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | {events} 11 | 12 | 13 | 14 | 15 | 16 | {/events} 17 | 18 |
TimeEvent NameTimes Called
{ duration } ms{event}{count}
19 | -------------------------------------------------------------------------------- /system/ThirdParty/PSR/Log/LoggerAwareTrait.php: -------------------------------------------------------------------------------- 1 | logger = $logger; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tests/_support/Database/MockBuilder.php: -------------------------------------------------------------------------------- 1 | '{0} is an invalid log level.', 19 | ]; 20 | -------------------------------------------------------------------------------- /system/ThirdParty/ZendEscaper/Exception/ExceptionInterface.php: -------------------------------------------------------------------------------- 1 | '"{0}" action not implemented.', 18 | ]; 19 | -------------------------------------------------------------------------------- /public/chosen/chosen_v1.8.7/docsupport/init.js: -------------------------------------------------------------------------------- 1 | var config = { 2 | '.chosen-select' : {}, 3 | '.chosen-select-deselect' : { allow_single_deselect: true }, 4 | '.chosen-select-no-single' : { disable_search_threshold: 10 }, 5 | '.chosen-select-no-results': { no_results_text: 'Oops, nothing found!' }, 6 | '.chosen-select-rtl' : { rtl: true }, 7 | '.chosen-select-width' : { width: '95%' } 8 | } 9 | for (var selector in config) { 10 | $(selector).chosen(config[selector]); 11 | } 12 | -------------------------------------------------------------------------------- /system/Language/en/Entity.php: -------------------------------------------------------------------------------- 1 | 'Trying to access non existent property {0} of {1}', 19 | ]; 20 | -------------------------------------------------------------------------------- /tests/_support/Models/EntityModel.php: -------------------------------------------------------------------------------- 1 | [ 16 | 'first', 17 | 'second', 18 | ], 19 | 'format' => 'nice', 20 | 'fruit' => [ 21 | 'apple', 22 | 'banana', 23 | ], 24 | ]; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /system/Language/en/Redirect.php: -------------------------------------------------------------------------------- 1 | 'Unable to redirect to "{0}". Error status code "{1}"', 19 | ]; 20 | -------------------------------------------------------------------------------- /system/Debug/Toolbar/Views/_logs.tpl: -------------------------------------------------------------------------------- 1 | { if $logs == [] } 2 |

Nothing was logged. If you were expecting logged items, ensure that LoggerConfig file has the correct threshold set.

3 | { else } 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | {logs} 13 | 14 | 15 | 16 | 17 | {/logs} 18 | 19 |
SeverityMessage
{level}{msg}
20 | { endif } 21 | -------------------------------------------------------------------------------- /tests/_support/Models/UserModel.php: -------------------------------------------------------------------------------- 1 | 'File not found: {0}', 18 | 'cannotMove' => 'Could not move file {0} to {1} ({2})', 19 | ]; 20 | -------------------------------------------------------------------------------- /system/Language/en/Language.php: -------------------------------------------------------------------------------- 1 | 'Get line must be a string or array of strings.', 19 | ]; 20 | -------------------------------------------------------------------------------- /tests/_support/Config/MockAutoload.php: -------------------------------------------------------------------------------- 1 | data; 12 | $consumed += $bucket->datalen; 13 | } 14 | return PSFS_PASS_ON; 15 | } 16 | } 17 | 18 | stream_filter_register('CommandsTestStreamFilter', 'CodeIgniter\Commands\CommandsTestStreamFilter'); 19 | -------------------------------------------------------------------------------- /app/Common.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Whoops! 8 | 9 | 12 | 13 | 14 | 15 |
16 | 17 |

Whoops!

18 | 19 |

We seem to have hit a snag. Please try again later...

20 | 21 |
22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /app/Views/templates/footer.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /system/Language/en/Format.php: -------------------------------------------------------------------------------- 1 | 'Failed to parse json string, error: "{0}".', 19 | 'missingExtension' => 'The SimpleXML extension is required to format XML.', 20 | ]; 21 | -------------------------------------------------------------------------------- /tests/_support/Database/SupportMigrations/001_Some_migration.php: -------------------------------------------------------------------------------- 1 | forge->addField([ 8 | 'key' => [ 9 | 'type' => 'VARCHAR', 10 | 'constraint' => 255, 11 | ], 12 | ]); 13 | $this->forge->createTable('foo', true); 14 | 15 | $this->db->table('foo')->insert([ 16 | 'key' => 'foobar', 17 | ]); 18 | } 19 | 20 | public function down() 21 | { 22 | $this->forge->dropTable('foo', true); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /system/ThirdParty/ZendEscaper/Exception/RuntimeException.php: -------------------------------------------------------------------------------- 1 | pretend; 23 | } 24 | 25 | // artificial error for testing 26 | public function misbehave() 27 | { 28 | $this->statusCode = 0; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /system/Language/en/Filters.php: -------------------------------------------------------------------------------- 1 | '{0} filter must have a matching alias defined.', 19 | 'incorrectInterface' => '{0} must implement CodeIgniter\Filters\FilterInterface.', 20 | ]; 21 | -------------------------------------------------------------------------------- /system/Pager/Exceptions/PagerException.php: -------------------------------------------------------------------------------- 1 | start(); 13 | $post_model = new PostModel(); 14 | list($categories, $posts) = $post_model->getAllPost('default'); 15 | $data['posts'] = $posts; 16 | $data['categories'] = $categories; 17 | echo view('templates/header'); 18 | echo view('welcome_message', $data); 19 | echo view('templates/footer'); 20 | } 21 | 22 | //-------------------------------------------------------------------- 23 | 24 | } 25 | -------------------------------------------------------------------------------- /tests/_support/Log/Handlers/MockChromeHandler.php: -------------------------------------------------------------------------------- 1 | json['rows'][0]; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /app/Views/errors/cli/error_exception.php: -------------------------------------------------------------------------------- 1 | An uncaught Exception was encountered 2 | 3 | Type: 4 | Message: 5 | Filename: getFile(), "\n"; ?> 6 | Line Number: getLine(); ?> 7 | 8 | 9 | 10 | Backtrace: 11 | getTrace() as $error): ?> 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /system/Language/en/Router.php: -------------------------------------------------------------------------------- 1 | 'A parameter does not match the expected type.', 19 | 'missingDefaultRoute' => 'Unable to determine what should be displayed. A default route has not been specified in the routing file.', 20 | ]; 21 | -------------------------------------------------------------------------------- /tests/_support/MigrationTestMigrations/Database/Migrations/2018-01-24-102301_Some_migration.php: -------------------------------------------------------------------------------- 1 | forge->addField([ 8 | 'key' => [ 9 | 'type' => 'VARCHAR', 10 | 'constraint' => 255, 11 | ], 12 | ]); 13 | $this->forge->createTable('foo', true); 14 | 15 | $this->db->table('foo')->insert([ 16 | 'key' => 'foobar', 17 | ]); 18 | } 19 | 20 | public function down() 21 | { 22 | $this->forge->dropTable('foo', true); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /tests/_support/Models/ValidErrorsModel.php: -------------------------------------------------------------------------------- 1 | [ 22 | 'required', 23 | 'min_length[10]', 24 | 'errors' => [ 25 | 'min_length' => 'Minimum Length Error', 26 | ] 27 | ], 28 | 'token' => 'in_list[{id}]', 29 | ]; 30 | } 31 | -------------------------------------------------------------------------------- /public/chosen/chosen_v1.8.7/docsupport/init.proto.js: -------------------------------------------------------------------------------- 1 | document.observe('dom:loaded', function(evt) { 2 | var config = { 3 | '.chosen-select' : {}, 4 | '.chosen-select-deselect' : { allow_single_deselect: true }, 5 | '.chosen-select-no-single' : { disable_search_threshold: 10 }, 6 | '.chosen-select-no-results': { no_results_text: 'Oops, nothing found!' }, 7 | '.chosen-select-rtl' : { rtl: true }, 8 | '.chosen-select-width' : { width: '95%' } 9 | } 10 | 11 | for (var selector in config) { 12 | $$(selector).each(function(element) { 13 | new Chosen(element, config[selector]); 14 | }); 15 | } 16 | }); 17 | -------------------------------------------------------------------------------- /tests/_support/MigrationTestMigrations/Database/Migrations/2018-01-24-102300_Another_migration.py: -------------------------------------------------------------------------------- 1 | forge->addField([ 8 | 'key' => [ 9 | 'type' => 'VARCHAR', 10 | 'constraint' => 255, 11 | ], 12 | ]); 13 | $this->forge->createTable('foo', true); 14 | 15 | $this->db->table('foo')->insert([ 16 | 'key' => 'foobar', 17 | ]); 18 | } 19 | 20 | public function down() 21 | { 22 | $this->forge->dropTable('foo', true); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/Config/Honeypot.php: -------------------------------------------------------------------------------- 1 | {label}'; 34 | } 35 | -------------------------------------------------------------------------------- /tests/_support/Language/en/Core.php: -------------------------------------------------------------------------------- 1 | '{0} extension could not be found.', 19 | 'bazillion' => 'billions and billions', // adds a new setting 20 | ]; 21 | -------------------------------------------------------------------------------- /system/Language/en/CLI.php: -------------------------------------------------------------------------------- 1 | 'Command "{0}" not found.', 19 | 'helpUsage' => 'Usage:', 20 | 'helpDescription' => 'Description:', 21 | 'helpOptions' => 'Options:', 22 | 'helpArguments' => 'Arguments:', 23 | 'invalidColor' => 'Invalid {0} color: {1}.', 24 | ]; 25 | -------------------------------------------------------------------------------- /system/Pager/Views/default_simple.php: -------------------------------------------------------------------------------- 1 | setSurroundCount(0); 7 | ?> 8 | 22 | -------------------------------------------------------------------------------- /tests/_support/Log/Handlers/MockFileHandler.php: -------------------------------------------------------------------------------- 1 | handles = $config['handles'] ?? []; 22 | $this->destination = $this->path . 'log-' . date('Y-m-d') . '.' . $this->fileExtension; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | ./tests 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /tests/_support/MigrationTestMigrations/Database/Migrations/2018-01-24-102302_Another_migration.php: -------------------------------------------------------------------------------- 1 | [ 9 | 'type' => 'VARCHAR', 10 | 'constraint' => 255, 11 | ], 12 | ]; 13 | $this->forge->addColumn('foo', $fields); 14 | 15 | $this->db->table('foo')->insert([ 16 | 'key' => 'foobar', 17 | 'value' => 'raboof', 18 | ]); 19 | } 20 | 21 | public function down() 22 | { 23 | if ($this->db->tableExists('foo')) 24 | { 25 | $this->forge->dropColumn('foo', 'value'); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /tests/_support/Models/ValidModel.php: -------------------------------------------------------------------------------- 1 | [ 22 | 'required', 23 | 'min_length[3]', 24 | ], 25 | 'token' => 'in_list[{id}]', 26 | ]; 27 | 28 | protected $validationMessages = [ 29 | 'name' => [ 30 | 'required' => 'You forgot to name the baby.', 31 | 'min_length' => 'Too short, man!', 32 | ], 33 | ]; 34 | } 35 | -------------------------------------------------------------------------------- /tests/_support/Language/SecondMockLanguage.php: -------------------------------------------------------------------------------- 1 | load($file, $locale, $return); 15 | } 16 | 17 | //-------------------------------------------------------------------- 18 | 19 | /** 20 | * Expose the loaded language files 21 | */ 22 | public function loaded(string $locale = 'en') 23 | { 24 | return $this->loadedFiles[$locale]; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /system/Language/en/Cache.php: -------------------------------------------------------------------------------- 1 | 'Cache unable to write to {0}', 19 | 'invalidHandlers' => 'Cache config must have an array of $validHandlers.', 20 | 'noBackup' => 'Cache config must have a handler and backupHandler set.', 21 | 'handlerNotFound' => 'Cache config has an invalid handler or backup handler specified.', 22 | ]; 23 | -------------------------------------------------------------------------------- /app/Config/Images.php: -------------------------------------------------------------------------------- 1 | \CodeIgniter\Images\Handlers\GDHandler::class, 29 | 'imagick' => \CodeIgniter\Images\Handlers\ImageMagickHandler::class, 30 | ]; 31 | } 32 | -------------------------------------------------------------------------------- /system/Language/en/Core.php: -------------------------------------------------------------------------------- 1 | 'Invalid file: {0}', 19 | 'copyError' => 'An error was encountered while attempting to replace the file({0}). Please make sure your file directory is writable.', 20 | 'missingExtension' => '{0} extension is not loaded.', 21 | 'noHandlers' => '{0} must provide at least one Handler.', 22 | ]; 23 | -------------------------------------------------------------------------------- /system/Honeypot/Exceptions/HoneypotException.php: -------------------------------------------------------------------------------- 1 | logger) { }` 11 | * blocks. 12 | */ 13 | class NullLogger extends AbstractLogger 14 | { 15 | /** 16 | * Logs with an arbitrary level. 17 | * 18 | * @param mixed $level 19 | * @param string $message 20 | * @param array $context 21 | * @return null 22 | */ 23 | public function log($level, $message, array $context = []) 24 | { 25 | // noop 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /tests/_support/Config/MockServices.php: -------------------------------------------------------------------------------- 1 | TESTPATH . '_support/', 11 | ]; 12 | public $classmap = []; 13 | 14 | //-------------------------------------------------------------------- 15 | 16 | public function __construct() 17 | { 18 | // Don't call the parent since we don't want the default mappings. 19 | // parent::__construct(); 20 | } 21 | 22 | //-------------------------------------------------------------------- 23 | public static function locator(bool $getShared = true) 24 | { 25 | return new \CodeIgniter\Autoloader\FileLocator(static::autoloader()); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /tests/_support/Commands/AppInfo.php: -------------------------------------------------------------------------------- 1 | showError($oops); 29 | } 30 | } 31 | 32 | public function helpme() 33 | { 34 | $this->call('help'); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /system/Language/en/Number.php: -------------------------------------------------------------------------------- 1 | 'TB', 19 | 'gigabyteAbbr' => 'GB', 20 | 'megabyteAbbr' => 'MB', 21 | 'kilobyteAbbr' => 'KB', 22 | 'bytes' => 'Bytes', 23 | 24 | // don't forget the space in front of these! 25 | 'thousand' => ' thousand', 26 | 'million' => ' million', 27 | 'billion' => ' billion', 28 | 'trillion' => ' trillion', 29 | 'quadrillion' => ' quadrillion', 30 | ]; 31 | -------------------------------------------------------------------------------- /system/Language/en/Cast.php: -------------------------------------------------------------------------------- 1 | 'Maximum stack depth exceeded', 18 | 'jsonErrorStateMismatch' => 'Underflow or the modes mismatch', 19 | 'jsonErrorCtrlChar' => 'Unexpected control character found', 20 | 'jsonErrorSyntax' => 'Syntax error, malformed JSON', 21 | 'jsonErrorUtf8' => 'Malformed UTF-8 characters, possibly incorrectly encoded', 22 | 'jsonErrorUnknown' => 'Unknown error', 23 | ]; 24 | -------------------------------------------------------------------------------- /system/Language/en/Encryption.php: -------------------------------------------------------------------------------- 1 | 'No driver requested; Miss Daisy will be so upset!', 18 | 'noHandlerAvailable' => 'Unable to find an available {0} encryption handler.', 19 | 'unKnownHandler' => '"{0}" cannot be configured.', 20 | 'starterKeyNeeded' => 'Encrypter needs a starter key.', 21 | 'authenticationFailed' => 'Decrypting: authentication failed.', 22 | 'encryptionFailed' => 'Encryption failed.', 23 | ]; 24 | -------------------------------------------------------------------------------- /system/Language/en/View.php: -------------------------------------------------------------------------------- 1 | '{class}::{method} is not a valid method.', 18 | 'missingCellParameters' => '{class}::{method} has no params.', 19 | 'invalidCellParameter' => '{0} is not a valid param name.', 20 | 'noCellClass' => 'No view cell class provided.', 21 | 'invalidCellClass' => 'Unable to locate view cell class: {0}.', 22 | 'tagSyntaxError' => 'You have a syntax error in your Parser tags: {0}', 23 | ]; 24 | -------------------------------------------------------------------------------- /system/Debug/Toolbar/Views/_history.tpl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | {files} 15 | 16 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | {/files} 27 | 28 |
ActionDatetimeStatusMethodURLContent-TypeIs AJAX?
17 | 18 | {datetime}{status}{method}{url}{contentType}{isAJAX}
29 | -------------------------------------------------------------------------------- /tests/_support/MockCommon.php: -------------------------------------------------------------------------------- 1 | 'Page navigation', 19 | 'first' => 'First', 20 | 'previous' => 'Previous', 21 | 'next' => 'Next', 22 | 'last' => 'Last', 23 | 'older' => 'Older', 24 | 'newer' => 'Newer', 25 | 'invalidTemplate' => '{0} is not a valid Pager template.', 26 | 'invalidPaginationGroup' => '{0} is not a valid Pagination group.', 27 | ]; 28 | -------------------------------------------------------------------------------- /tests/_support/Config/MockCLIConfig.php: -------------------------------------------------------------------------------- 1 | If the env file is not configured properly it will break the application. 31 | -------------------------------------------------------------------------------- /app/Config/Boot/production.php: -------------------------------------------------------------------------------- 1 | '`sessionSavePath` must have the table name for the Database Session Handler to work.', 19 | 'invalidSavePath' => 'Session: Configured save path "{0}" is not a directory, does not exist or cannot be created.', 20 | 'writeProtectedSavePath' => 'Session: Configured save path "{0}" is not writable by the PHP process.', 21 | 'emptySavePath' => 'Session: No save path configured.', 22 | 'invalidSavePathFormat' => 'Session: Invalid Redis save path format: {0}', 23 | ]; 24 | -------------------------------------------------------------------------------- /system/Exceptions/FrameworkException.php: -------------------------------------------------------------------------------- 1 | \CodeIgniter\Filters\CSRF::class, 11 | 'toolbar' => \CodeIgniter\Filters\DebugToolbar::class, 12 | 'honeypot' => \CodeIgniter\Filters\Honeypot::class, 13 | ]; 14 | 15 | // Always applied before every request 16 | public $globals = [ 17 | 'before' => [ 18 | //'honeypot' 19 | 'csrf', 20 | ], 21 | 'after' => [ 22 | 'toolbar', 23 | //'honeypot' 24 | ], 25 | ]; 26 | 27 | // Works on all of a particular HTTP method 28 | // (GET, POST, etc) as BEFORE filters only 29 | // like: 'post' => ['CSRF', 'throttle'], 30 | public $methods = []; 31 | 32 | // List filter aliases and any before/after uri patterns 33 | // that they should run on, like: 34 | // 'isLoggedIn' => ['before' => ['account/*', 'profiles/*']], 35 | public $filters = []; 36 | } 37 | -------------------------------------------------------------------------------- /system/Debug/Toolbar/Views/_routes.tpl: -------------------------------------------------------------------------------- 1 |

Matched Route

2 | 3 | 4 | 5 | {matchedRoute} 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | {params} 23 | 24 | 25 | 26 | 27 | {/params} 28 | {/matchedRoute} 29 | 30 |
Directory:{directory}
Controller:{controller}
Method:{method}
Params:{paramCount} / {truePCount}
{name}{value}
31 | 32 | 33 |

Defined Routes

34 | 35 | 36 | 37 | {routes} 38 | 39 | 40 | 41 | 42 | {/routes} 43 | 44 |
{from}{to}
45 | -------------------------------------------------------------------------------- /system/Validation/Exceptions/ValidationException.php: -------------------------------------------------------------------------------- 1 | 'CodeIgniter\Pager\Views\default_full', 22 | 'default_simple' => 'CodeIgniter\Pager\Views\default_simple', 23 | 'default_head' => 'CodeIgniter\Pager\Views\default_head', 24 | ]; 25 | 26 | /* 27 | |-------------------------------------------------------------------------- 28 | | Items Per Page 29 | |-------------------------------------------------------------------------- 30 | | 31 | | The default number of results shown in a single page. 32 | | 33 | */ 34 | public $perPage = 20; 35 | } 36 | -------------------------------------------------------------------------------- /system/Commands/Server/rewrite.php: -------------------------------------------------------------------------------- 1 | 2 | Read the CodeIgniter docs... 3 |

4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 |
CodeIgniter Version:{ ciVersion }
PHP Version:{ phpVersion }
PHP SAPI:{ phpSAPI }
Environment:{ environment }
Base URL: 26 | { if $baseURL == '' } 27 |
28 | The $baseURL should always be set manually to prevent possible URL personification from external parties. 29 |
30 | { else } 31 | { baseURL } 32 | { endif } 33 |
TimeZone:{ timezone }
Locale:{ locale }
Content Security Policy Enabled:{ if $cspEnabled } Yes { else } No { endif }
49 | -------------------------------------------------------------------------------- /app/Config/Encryption.php: -------------------------------------------------------------------------------- 1 | $class, 'method' => $method])); 11 | } 12 | 13 | public static function forMissingCellParameters(string $class, string $method) 14 | { 15 | return new static(lang('View.missingCellParameters', ['class' => $class, 'method' => $method])); 16 | } 17 | 18 | public static function forInvalidCellParameter(string $key) 19 | { 20 | return new static(lang('View.invalidCellParameter', [$key])); 21 | } 22 | 23 | public static function forNoCellClass() 24 | { 25 | return new static(lang('View.noCellClass')); 26 | } 27 | 28 | public static function forInvalidCellClass(string $class = null) 29 | { 30 | return new static(lang('View.invalidCellClass', [$class])); 31 | } 32 | 33 | public static function forTagSyntaxError(string $output) 34 | { 35 | return new static(lang('View.tagSyntaxError', [$output])); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "codeigniter4/framework", 3 | "type": "project", 4 | "description": "The CodeIgniter framework v4", 5 | "homepage": "https://codeigniter.com", 6 | "license": "MIT", 7 | "require": { 8 | "php": ">=7.2", 9 | "ext-curl": "*", 10 | "ext-intl": "*", 11 | "kint-php/kint": "^2.1", 12 | "psr/log": "^1.1", 13 | "zendframework/zend-escaper": "^2.5", 14 | "firebase/php-jwt": "^5.0", 15 | "harvesthq/chosen": "^1.8" 16 | }, 17 | "require-dev": { 18 | "codeigniter4/codeigniter4-standard": "^1.0", 19 | "mikey179/vfsstream": "1.6.*", 20 | "phpunit/phpunit": "^7.0", 21 | "squizlabs/php_codesniffer": "^3.3" 22 | }, 23 | "autoload": { 24 | "psr-4": { 25 | "CodeIgniter\\": "system/" 26 | } 27 | }, 28 | "scripts": { 29 | "post-update-cmd": [ 30 | "@composer dump-autoload", 31 | "CodeIgniter\\ComposerScripts::postUpdate" 32 | ] 33 | }, 34 | "support": { 35 | "forum": "http://forum.codeigniter.com/", 36 | "source": "https://github.com/codeigniter4/CodeIgniter4", 37 | "slack": "https://codeigniterchat.slack.com" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /tests/_support/HTTP/MockCURLRequest.php: -------------------------------------------------------------------------------- 1 | output = $output; 25 | 26 | return $this; 27 | } 28 | 29 | //-------------------------------------------------------------------- 30 | 31 | protected function sendRequest(array $curl_options = []): string 32 | { 33 | // Save so we can access later. 34 | $this->curl_options = $curl_options; 35 | 36 | return $this->output; 37 | } 38 | 39 | //-------------------------------------------------------------------- 40 | // for testing purposes only 41 | public function getBaseURI() 42 | { 43 | return $this->baseURI; 44 | } 45 | 46 | // for testing purposes only 47 | public function getDelay() 48 | { 49 | return $this->delay; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /system/Images/Exceptions/ImageException.php: -------------------------------------------------------------------------------- 1 | setSurroundCount(2); 7 | ?> 8 | 9 | 46 | -------------------------------------------------------------------------------- /app/Config/Boot/testing.php: -------------------------------------------------------------------------------- 1 | base_url(), 18 | "aud" => "user", 19 | "iat" => $time, 20 | "exp" => $time + 36000, 21 | "nbf" => $time, 22 | "id" => $value 23 | ); 24 | 25 | return $jwt = JWT::encode($payload,JWT_KEY); 26 | } 27 | 28 | } 29 | 30 | if (! function_exists('verify_jwt')) { 31 | /** 32 | * 33 | * Verify the JWT token whether the data is tampered or not 34 | * 35 | * @param string $token Token that is got from the user 36 | * 37 | * @return bool 38 | */ 39 | 40 | function verify_jwt(string $token){ 41 | try { 42 | $decoded_token = JWT::decode($token, JWT_KEY, array('HS256')); 43 | return $decoded_token; 44 | } catch (\Firebase\JWT\SignatureInvalidException $th) { 45 | echo $th->getMessage(); 46 | echo "Invalid signature"; 47 | session_destroy(); 48 | return redirect()->to("login"); 49 | } 50 | } 51 | } 52 | 53 | -------------------------------------------------------------------------------- /app/Config/Boot/development.php: -------------------------------------------------------------------------------- 1 | session = \Config\Services::session(); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /system/Commands/Sessions/Views/migration.tpl.php: -------------------------------------------------------------------------------- 1 | @php namespace \Database\Migrations; 2 | 3 | use CodeIgniter\Database\Migration; 4 | 5 | class Migration_create__table extends Migration 6 | { 7 | 8 | protected $DBGroup = ''; 9 | 10 | 11 | public function up() 12 | { 13 | $this->forge->addField([ 14 | 'id' => [ 15 | 'type' => 'VARCHAR', 16 | 'constraint' => 128, 17 | 'null' => false 18 | ], 19 | 'ip_address' => [ 20 | 'type' => 'VARCHAR', 21 | 'constraint' => 45, 22 | 'null' => false 23 | ], 24 | 'timestamp' => [ 25 | 'type' => 'INT', 26 | 'constraint' => 10, 27 | 'unsigned' => true, 28 | 'null' => false, 29 | 'default' => 0 30 | ], 31 | 'data' => [ 32 | 'type' => 'TEXT', 33 | 'null' => false, 34 | 'default' => '' 35 | ], 36 | ]); 37 | 38 | $this->forge->addKey(['id', 'ip_address'], true); 39 | 40 | $this->forge->addKey('id', true); 41 | 42 | $this->forge->addKey('timestamp'); 43 | $this->forge->createTable('', true); 44 | } 45 | 46 | //-------------------------------------------------------------------- 47 | 48 | public function down() 49 | { 50 | $this->forge->dropTable('', true); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /app/Config/Events.php: -------------------------------------------------------------------------------- 1 | 0) 24 | { 25 | \ob_end_flush(); 26 | } 27 | 28 | \ob_start(function ($buffer) { 29 | return $buffer; 30 | }); 31 | 32 | /* 33 | * -------------------------------------------------------------------- 34 | * Debug Toolbar Listeners. 35 | * -------------------------------------------------------------------- 36 | * If you delete, they will no longer be collected. 37 | */ 38 | if (ENVIRONMENT !== 'production') 39 | { 40 | Events::on('DBQuery', 'CodeIgniter\Debug\Toolbar\Collectors\Database::collect'); 41 | Services::toolbar()->respond(); 42 | } 43 | }); 44 | -------------------------------------------------------------------------------- /public/ckeditor5/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ckeditor5-custom-build", 3 | "author": "CKSource", 4 | "description": "A custom CKEditor 5 build made by the CKEditor 5 online builder.", 5 | "version": "0.0.1", 6 | "license": "SEE LICENSE IN LICENSE.md", 7 | "private": true, 8 | "devDependencies": { 9 | "@ckeditor/ckeditor5-adapter-ckfinder": "^17.0.0", 10 | "@ckeditor/ckeditor5-autoformat": "^17.0.0", 11 | "@ckeditor/ckeditor5-basic-styles": "^17.0.0", 12 | "@ckeditor/ckeditor5-block-quote": "^17.0.0", 13 | "@ckeditor/ckeditor5-ckfinder": "^17.0.0", 14 | "@ckeditor/ckeditor5-dev-utils": "^12.0.9", 15 | "@ckeditor/ckeditor5-dev-webpack-plugin": "^8.0.9", 16 | "@ckeditor/ckeditor5-editor-classic": "^17.0.0", 17 | "@ckeditor/ckeditor5-essentials": "^17.0.0", 18 | "@ckeditor/ckeditor5-heading": "^17.0.0", 19 | "@ckeditor/ckeditor5-image": "^17.0.0", 20 | "@ckeditor/ckeditor5-indent": "^17.0.0", 21 | "@ckeditor/ckeditor5-link": "^17.0.0", 22 | "@ckeditor/ckeditor5-list": "^17.0.0", 23 | "@ckeditor/ckeditor5-paragraph": "^17.0.0", 24 | "@ckeditor/ckeditor5-paste-from-office": "^17.0.0", 25 | "@ckeditor/ckeditor5-table": "^17.0.0", 26 | "@ckeditor/ckeditor5-theme-lark": "^17.0.0", 27 | "postcss-loader": "^3.0.0", 28 | "raw-loader": "^3.1.0", 29 | "style-loader": "^1.1.3", 30 | "terser-webpack-plugin": "^2.3.5", 31 | "webpack": "^4.41.6", 32 | "webpack-cli": "^3.3.11" 33 | }, 34 | "scripts": { 35 | "build": "webpack --mode production" 36 | } 37 | } -------------------------------------------------------------------------------- /system/Language/en/Time.php: -------------------------------------------------------------------------------- 1 | 'Months must be between 1 and 12. Given: {0}', 19 | 'invalidDay' => 'Days must be between 1 and 31. Given: {0}', 20 | 'invalidOverDay' => 'Days must be between 1 and {0}. Given: {1}', 21 | 'invalidHours' => 'Hours must be between 0 and 23. Given: {0}', 22 | 'invalidMinutes' => 'Minutes must be between 0 and 59. Given: {0}', 23 | 'invalidSeconds' => 'Seconds must be between 0 and 59. Given: {0}', 24 | 'years' => '{0, plural, =1{# year} other{# years}}', 25 | 'months' => '{0, plural, =1{# month} other{# months}}', 26 | 'weeks' => '{0, plural, =1{# week} other{# weeks}}', 27 | 'days' => '{0, plural, =1{# day} other{# days}}', 28 | 'hours' => '{0, plural, =1{# hour} other{# hours}}', 29 | 'minutes' => '{0, plural, =1{# minute} other{# minutes}}', 30 | 'seconds' => '{0, plural, =1{# second} other{# seconds}}', 31 | 'ago' => '{0} ago', 32 | 'inFuture' => 'in {0}', 33 | 'yesterday' => 'Yesterday', 34 | 'tomorrow' => 'Tomorrow', 35 | 'now' => 'Just now', 36 | ]; 37 | -------------------------------------------------------------------------------- /tests/_support/Language/MockLanguage.php: -------------------------------------------------------------------------------- 1 | language[$locale ?? $this->locale][$file] = $data; 32 | 33 | return $this; 34 | } 35 | 36 | //-------------------------------------------------------------------- 37 | 38 | /** 39 | * Provides an override that allows us to set custom 40 | * data to be returned easily during testing. 41 | * 42 | * @param string $path 43 | * 44 | * @return array|mixed 45 | */ 46 | protected function requireFile(string $path): array 47 | { 48 | return $this->data ?? []; 49 | } 50 | 51 | //-------------------------------------------------------------------- 52 | 53 | /** 54 | * Arbitrarily turnoff internationalization support for testing 55 | */ 56 | public function disableIntlSupport() 57 | { 58 | $this->intlSupport = false; 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /tests/_support/Controllers/Popcorn.php: -------------------------------------------------------------------------------- 1 | respond('Oops', 567, 'Surprise'); 25 | } 26 | 27 | public function popper() 28 | { 29 | throw new \RuntimeException('Surprise', 500); 30 | } 31 | 32 | public function weasel() 33 | { 34 | $this->respond('', 200); 35 | } 36 | 37 | public function oops() 38 | { 39 | $this->failUnauthorized(); 40 | } 41 | 42 | public function goaway() 43 | { 44 | return redirect()->to('/'); 45 | } 46 | 47 | // @see https://github.com/codeigniter4/CodeIgniter4/issues/1834 48 | public function index3() 49 | { 50 | $response = $this->response->setJSON([ 51 | 'lang' => $this->request->getLocale(), 52 | ]); 53 | 54 | // echo var_dump($this->response->getBody()); 55 | return $response; 56 | } 57 | 58 | public function canyon() 59 | { 60 | echo 'Hello-o-o'; 61 | } 62 | 63 | public function cat() 64 | { 65 | } 66 | 67 | public function json() 68 | { 69 | $this->responsd(['answer' => 42]); 70 | } 71 | 72 | public function xml() 73 | { 74 | $this->respond('cat'); 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | systemDirectory, '/ ') . '/bootstrap.php'; 37 | 38 | /* 39 | *--------------------------------------------------------------- 40 | * LAUNCH THE APPLICATION 41 | *--------------------------------------------------------------- 42 | * Now that everything is setup, it's time to actually fire 43 | * up the engines and make this app do its thang. 44 | */ 45 | $app->run(); 46 | -------------------------------------------------------------------------------- /app/Config/Migrations.php: -------------------------------------------------------------------------------- 1 | php spark migrate:create 41 | | 42 | | Typical formats: 43 | | YmdHis_ 44 | | Y-m-d-His_ 45 | | Y_m_d_His_ 46 | | 47 | */ 48 | public $timestampFormat = 'Y-m-d-His_'; 49 | 50 | } 51 | -------------------------------------------------------------------------------- /tests/_support/Log/Handlers/TestHandler.php: -------------------------------------------------------------------------------- 1 | handles = $config['handles'] ?? []; 29 | $this->destination = $this->path . 'log-' . date('Y-m-d') . '.' . $this->fileExtension; 30 | 31 | self::$logs = []; 32 | } 33 | 34 | //-------------------------------------------------------------------- 35 | 36 | /** 37 | * Handles logging the message. 38 | * If the handler returns false, then execution of handlers 39 | * will stop. Any handlers that have not run, yet, will not 40 | * be run. 41 | * 42 | * @param $level 43 | * @param $message 44 | * 45 | * @return boolean 46 | */ 47 | public function handle($level, $message): bool 48 | { 49 | $date = date($this->dateFormat); 50 | 51 | self::$logs[] = strtoupper($level) . ' - ' . $date . ' --> ' . $message; 52 | 53 | return true; 54 | } 55 | 56 | //-------------------------------------------------------------------- 57 | 58 | public static function getLogs() 59 | { 60 | return self::$logs; 61 | } 62 | 63 | //-------------------------------------------------------------------- 64 | } 65 | -------------------------------------------------------------------------------- /tests/_support/Services.php: -------------------------------------------------------------------------------- 1 | '{0} is not a valid Model Event callback.', 19 | 'invalidArgument' => 'You must provide a valid {0}.', 20 | 'invalidAllowedFields' => 'Allowed fields must be specified for model: {0}', 21 | 'emptyDataset' => 'There is no data to {0}.', 22 | 'failGetFieldData' => 'Failed to get field data from database.', 23 | 'failGetIndexData' => 'Failed to get index data from database.', 24 | 'failGetForeignKeyData' => 'Failed to get foreign key data from database.', 25 | 'parseStringFail' => 'Parsing key string failed.', 26 | 'featureUnavailable' => 'This feature is not available for the database you are using.', 27 | 'tableNotFound' => 'Table `{0}` was not found in the current database.', 28 | 'noPrimaryKey' => '`{0}` model class does not specify a Primary Key.', 29 | 'noDateFormat' => '`{0}` model class does not have a valid dateFormat.', 30 | 'fieldNotExists' => 'Field `{0}` not found.', 31 | 'forEmptyInputGiven' => 'Empty statement is given for the field `{0}`', 32 | 'forFindColumnHaveMultipleColumns' => 'Only single column allowed in Column name.', 33 | ]; 34 | -------------------------------------------------------------------------------- /app/Config/ContentSecurityPolicy.php: -------------------------------------------------------------------------------- 1 | 11 | Options +FollowSymlinks 12 | RewriteEngine On 13 | 14 | # If you installed CodeIgniter in a subfolder, you will need to 15 | # change the following line to match the subfolder you need. 16 | # http://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewritebase 17 | # RewriteBase / 18 | 19 | # Redirect Trailing Slashes... 20 | RewriteRule ^(.*)/$ /$1 [L,R=301] 21 | 22 | # Rewrite "www.example.com -> example.com" 23 | RewriteCond %{HTTPS} !=on 24 | RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] 25 | RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L] 26 | 27 | # Checks to see if the user is attempting to access a valid file, 28 | # such as an image or css document, if this isn't true it sends the 29 | # request to the front controller, index.php 30 | RewriteCond %{REQUEST_FILENAME} !-f 31 | RewriteCond %{REQUEST_FILENAME} !-d 32 | RewriteRule ^(.*)$ index.php/$1 [L] 33 | 34 | # Ensure Authorization header is passed along 35 | RewriteCond %{HTTP:Authorization} . 36 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 37 | 38 | 39 | 40 | # If we don't have mod_rewrite installed, all 404's 41 | # can be sent to index.php, and everything works as normal. 42 | ErrorDocument 404 index.php 43 | 44 | 45 | # Disable server signature start 46 | ServerSignature Off 47 | # Disable server signature end 48 | -------------------------------------------------------------------------------- /tests/_support/Models/EventModel.php: -------------------------------------------------------------------------------- 1 | tokens[] = 'beforeInsert'; 35 | 36 | return $data; 37 | } 38 | 39 | protected function afterInsertMethod(array $data) 40 | { 41 | $this->tokens[] = 'afterInsert'; 42 | 43 | return $data; 44 | } 45 | 46 | protected function beforeUpdateMethod(array $data) 47 | { 48 | $this->tokens[] = 'beforeUpdate'; 49 | 50 | return $data; 51 | } 52 | 53 | protected function afterUpdateMethod(array $data) 54 | { 55 | $this->tokens[] = 'afterUpdate'; 56 | 57 | return $data; 58 | } 59 | 60 | protected function afterFindMethod(array $data) 61 | { 62 | $this->tokens[] = 'afterFind'; 63 | 64 | return $data; 65 | } 66 | 67 | protected function afterDeleteMethod(array $data) 68 | { 69 | $this->tokens[] = 'afterDelete'; 70 | 71 | return $data; 72 | } 73 | 74 | public function hasToken(string $token) 75 | { 76 | return in_array($token, $this->tokens); 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /app/Views/errors/html/error_404.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 404 Page Not Found 6 | 7 | 70 | 71 | 72 |
73 |

404 - File Not Found

74 | 75 |

76 | 77 | 78 | 79 | Sorry! Cannot seem to find the page you were looking for. 80 | 81 |

82 |
83 | 84 | 85 | -------------------------------------------------------------------------------- /app/Views/welcome_message.php: -------------------------------------------------------------------------------- 1 |
2 | 8 | 9 |
10 |

No blogs are present

11 |
12 | 13 | $items) : ?> 14 |
15 | $value) : ?> 16 |
17 |
18 |
19 |
20 | 21 | $catg) : ?> 22 | 23 | 24 | 25 |

26 |

27 |

28 | Continue reading 29 |
30 |
31 |
32 |
33 | 34 |
35 | 36 | 37 |
38 | -------------------------------------------------------------------------------- /tests/_support/Session/MockSession.php: -------------------------------------------------------------------------------- 1 | driver, true); 31 | } 32 | 33 | //-------------------------------------------------------------------- 34 | 35 | /** 36 | * Starts the session. 37 | * Extracted for testing reasons. 38 | */ 39 | protected function startSession() 40 | { 41 | // session_start(); 42 | } 43 | 44 | //-------------------------------------------------------------------- 45 | 46 | /** 47 | * Takes care of setting the cookie on the client side. 48 | * Extracted for testing reasons. 49 | */ 50 | protected function setCookie() 51 | { 52 | $this->cookies[] = [ 53 | $this->sessionCookieName, 54 | session_id(), 55 | (empty($this->sessionExpiration) ? 0 : time() + $this->sessionExpiration), 56 | $this->cookiePath, 57 | $this->cookieDomain, 58 | $this->cookieSecure, 59 | true, 60 | ]; 61 | } 62 | 63 | //-------------------------------------------------------------------- 64 | 65 | public function regenerate(bool $destroy = false) 66 | { 67 | $this->didRegenerate = true; 68 | $_SESSION['__ci_last_regenerate'] = time(); 69 | } 70 | 71 | //-------------------------------------------------------------------- 72 | } 73 | -------------------------------------------------------------------------------- /system/Database/Exceptions/DataException.php: -------------------------------------------------------------------------------- 1 | [ 10 | [ 11 | 'name' => 'Derek Jones', 12 | 'email' => 'derek@world.com', 13 | 'country' => 'US', 14 | ], 15 | [ 16 | 'name' => 'Ahmadinejad', 17 | 'email' => 'ahmadinejad@world.com', 18 | 'country' => 'Iran', 19 | ], 20 | [ 21 | 'name' => 'Richard A Causey', 22 | 'email' => 'richard@world.com', 23 | 'country' => 'US', 24 | ], 25 | [ 26 | 'name' => 'Chris Martin', 27 | 'email' => 'chris@world.com', 28 | 'country' => 'UK', 29 | ], 30 | ], 31 | 'job' => [ 32 | [ 33 | 'name' => 'Developer', 34 | 'description' => 'Awesome job, but sometimes makes you bored', 35 | ], 36 | [ 37 | 'name' => 'Politician', 38 | 'description' => 'This is not really a job', 39 | ], 40 | [ 41 | 'name' => 'Accountant', 42 | 'description' => 'Boring job, but you will get free snack at lunch', 43 | ], 44 | [ 45 | 'name' => 'Musician', 46 | 'description' => 'Only Coldplay can actually called Musician', 47 | ], 48 | ], 49 | 'misc' => [ 50 | [ 51 | 'key' => '\\xxxfoo456', 52 | 'value' => 'Entry with \\xxx', 53 | ], 54 | [ 55 | 'key' => '\\%foo456', 56 | 'value' => 'Entry with \\%', 57 | ], 58 | [ 59 | 'key' => 'spaces and tabs', 60 | 'value' => ' One two three tab', 61 | ], 62 | ], 63 | ]; 64 | 65 | foreach ($data as $table => $dummy_data) 66 | { 67 | $this->db->table($table)->truncate(); 68 | 69 | foreach ($dummy_data as $single_dummy_data) 70 | { 71 | $this->db->table($table)->insert($single_dummy_data); 72 | } 73 | } 74 | } 75 | 76 | //-------------------------------------------------------------------- 77 | 78 | } 79 | -------------------------------------------------------------------------------- /system/Database/Exceptions/DatabaseException.php: -------------------------------------------------------------------------------- 1 | enabled) 59 | { 60 | return false; 61 | } 62 | 63 | $alias = strtolower($alias); 64 | 65 | return in_array($alias, $this->activeExplorers); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /system/Format/FormatterInterface.php: -------------------------------------------------------------------------------- 1 | start(); 21 | if (isset($_SESSION['session-id']) and $_SESSION['session-id'] != NULL) { 22 | return redirect()->to(base_url()); 23 | } else { 24 | echo view('templates/header'); 25 | echo view('login'); 26 | echo view('templates/footer'); 27 | } 28 | } 29 | 30 | public function auth() 31 | { 32 | if ($this->request->getMethod() == 'post') { 33 | $session = session(); 34 | $user_model = new UserModel(); 35 | $auth_data = array( 36 | 'user_name' => $this->request->getPost('uname'), 37 | 'user_pass' => $this->request->getPost('password') 38 | ); 39 | $val = $user_model->verify($auth_data); 40 | if ($val === 1) { 41 | $session->start(); 42 | $session->setFlashdata('auth', '1'); 43 | $user_id_result = $user_model->getUserId($this->request->getPost('uname')); 44 | $user_id = $user_id_result['user_rand_id']; 45 | $cookie = create_jwt($user_id); 46 | $session->set('session-id', $cookie); 47 | return redirect()->to(base_url()); //->setCookie('sess',$cookie,time()+3600); 48 | } else { 49 | $session->start(); 50 | $session->setFlashdata('auth', '0'); 51 | echo view('templates/header'); 52 | echo view('login'); 53 | echo view('templates/footer'); 54 | } 55 | } else { 56 | return redirect()->to(base_url()); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /spark: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | systemDirectory, '/ ') . '/bootstrap.php'; 45 | 46 | // Grab our Console 47 | $console = new \CodeIgniter\CLI\Console($app); 48 | 49 | // We want errors to be shown when using it from the CLI. 50 | error_reporting(-1); 51 | ini_set('display_errors', 1); 52 | 53 | // Show basic information before we do anything else. 54 | $console->showHeader(); 55 | 56 | // fire off the command in the main framework. 57 | $response = $console->run(); 58 | if ($response->getStatusCode() >= 300) 59 | { 60 | exit($response->getStatusCode()); 61 | } 62 | -------------------------------------------------------------------------------- /system/Language/en/Email.php: -------------------------------------------------------------------------------- 1 | 'The email validation method must be passed an array.', 18 | 'invalidAddress' => 'Invalid email address: {0}', 19 | 'attachmentMissing' => 'Unable to locate the following email attachment: {0}', 20 | 'attachmentUnreadable' => 'Unable to open this attachment: {0}', 21 | 'noFrom' => 'Cannot send mail with no "From" header.', 22 | 'noRecipients' => 'You must include recipients: To, Cc, or Bcc', 23 | 'sendFailurePHPMail' => 'Unable to send email using PHP mail(). Your server might not be configured to send mail using this method.', 24 | 'sendFailureSendmail' => 'Unable to send email using PHP Sendmail. Your server might not be configured to send mail using this method.', 25 | 'sendFailureSmtp' => 'Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.', 26 | 'sent' => 'Your message has been successfully sent using the following protocol: {0, string}', 27 | 'noSocket' => 'Unable to open a socket to Sendmail. Please check settings.', 28 | 'noHostname' => 'You did not specify a SMTP hostname.', 29 | 'SMTPError' => 'The following SMTP error was encountered: {0}', 30 | 'noSMTPAuth' => 'Error: You must assign a SMTP username and password.', 31 | 'failedSMTPLogin' => 'Failed to send AUTH LOGIN command. Error: {0}', 32 | 'SMTPAuthUsername' => 'Failed to authenticate username. Error: {0}', 33 | 'SMTPAuthPassword' => 'Failed to authenticate password. Error: {0}', 34 | 'SMTPDataFailure' => 'Unable to send data: {0}', 35 | 'exitStatus' => 'Exit status code: {0}', 36 | ]; 37 | -------------------------------------------------------------------------------- /public/chosen/chosen_v1.8.7/docsupport/prism.css: -------------------------------------------------------------------------------- 1 | /** 2 | * okaidia theme for JavaScript, CSS and HTML 3 | * Loosely based on Monokai textmate theme by http://www.monokai.nl/ 4 | * @author ocodia 5 | */ 6 | 7 | code[class*="language-"], 8 | pre[class*="language-"] { 9 | color: #f8f8f2; 10 | text-shadow: 0 1px rgba(0,0,0,0.3); 11 | font-family: Consolas, Monaco, 'Andale Mono', monospace; 12 | direction: ltr; 13 | text-align: left; 14 | white-space: pre; 15 | word-spacing: normal; 16 | 17 | -moz-tab-size: 4; 18 | -o-tab-size: 4; 19 | tab-size: 4; 20 | 21 | -webkit-hyphens: none; 22 | -moz-hyphens: none; 23 | -ms-hyphens: none; 24 | hyphens: none; 25 | } 26 | 27 | /* Code blocks */ 28 | pre[class*="language-"] { 29 | padding: 1em; 30 | margin: .5em 0; 31 | overflow: auto; 32 | border-radius: 0.3em; 33 | } 34 | 35 | :not(pre) > code[class*="language-"], 36 | pre[class*="language-"] { 37 | background: #272822; 38 | } 39 | 40 | /* Inline code */ 41 | :not(pre) > code[class*="language-"] { 42 | padding: .1em; 43 | border-radius: .3em; 44 | } 45 | 46 | .token.comment, 47 | .token.prolog, 48 | .token.doctype, 49 | .token.cdata { 50 | color: slategray; 51 | } 52 | 53 | .token.punctuation { 54 | color: #f8f8f2; 55 | } 56 | 57 | .namespace { 58 | opacity: .7; 59 | } 60 | 61 | .token.property, 62 | .token.tag { 63 | color: #f92672; 64 | } 65 | 66 | .token.boolean, 67 | .token.number{ 68 | color: #ae81ff; 69 | } 70 | 71 | .token.selector, 72 | .token.attr-name, 73 | .token.string { 74 | color: #a6e22e; 75 | } 76 | 77 | 78 | .token.operator, 79 | .token.entity, 80 | .token.url, 81 | .language-css .token.string, 82 | .style .token.string { 83 | color: #f8f8f2; 84 | } 85 | 86 | .token.atrule, 87 | .token.attr-value 88 | { 89 | color: #e6db74; 90 | } 91 | 92 | 93 | .token.keyword{ 94 | color: #66d9ef; 95 | } 96 | 97 | .token.regex, 98 | .token.important { 99 | color: #fd971f; 100 | } 101 | 102 | .token.important { 103 | font-weight: bold; 104 | } 105 | 106 | .token.entity { 107 | cursor: help; 108 | } 109 | -------------------------------------------------------------------------------- /tests/_support/Database/MockResult.php: -------------------------------------------------------------------------------- 1 | 'CodeIgniter\Validation\Views\list', 32 | 'single' => 'CodeIgniter\Validation\Views\single' 33 | ]; 34 | 35 | //-------------------------------------------------------------------- 36 | // Rules 37 | //-------------------------------------------------------------------- 38 | 39 | public $signup = [ 40 | "e_mail" => ["label" => "email", "rules" => "required|valid_email"], 41 | "uname" => ["label" => "Username", "rules" => "required|alpha_numeric"], 42 | "passwd" => ["label" => "pass_wd", "rules" => "required|min_length[5]"], 43 | "confirm_pass" => ["label" => "re-pass", "rules" => "required|matches[passwd]"] 44 | ]; 45 | 46 | public $postvalid = [ 47 | 'post_title' => 'required|alpha_numeric_space', 48 | 'post_content' => 'required', 49 | 'post_category' => 'required' 50 | ]; 51 | 52 | public $postvalid_errors = [ 53 | "post_title" => [ 54 | "required" => "Post title should not be empty" 55 | ], 56 | "post_content" => [ 57 | "required" => "Post content should not be empty" 58 | ], 59 | "post_category" => [ 60 | "required" => "Choose atleast a single category" 61 | ] 62 | ]; 63 | 64 | public $categoryvalid = [ 65 | "category_name" => "required|alpha_space" 66 | ]; 67 | 68 | public $categoryvalid_errors = [ 69 | "category_name" => [ 70 | "required" => "Category cannot be empty", 71 | "alpha_space" => "Should contain only alphabets only" 72 | ] 73 | ]; 74 | } 75 | -------------------------------------------------------------------------------- /tests/_support/Log/TestLogger.php: -------------------------------------------------------------------------------- 1 | assertLogged() methods. 15 | * 16 | * @param string $level 17 | * @param string $message 18 | * @param array $context 19 | * 20 | * @return boolean 21 | */ 22 | public function log($level, $message, array $context = []): bool 23 | { 24 | // While this requires duplicate work, we want to ensure 25 | // we have the final message to test against. 26 | $log_message = $this->interpolate($message, $context); 27 | 28 | // Determine the file and line by finding the first 29 | // backtrace that is not part of our logging system. 30 | $trace = debug_backtrace(); 31 | $file = null; 32 | 33 | foreach ($trace as $row) 34 | { 35 | if (! in_array($row['function'], ['log', 'log_message'])) 36 | { 37 | $file = basename($row['file'] ?? ''); 38 | break; 39 | } 40 | } 41 | 42 | self::$op_logs[] = [ 43 | 'level' => $level, 44 | 'message' => $log_message, 45 | 'file' => $file, 46 | ]; 47 | 48 | // Let the parent do it's thing. 49 | return parent::log($level, $message, $context); 50 | } 51 | 52 | //-------------------------------------------------------------------- 53 | 54 | /** 55 | * Used by CIUnitTestCase class to provide ->assertLogged() methods. 56 | * 57 | * @param string $level 58 | * @param string $message 59 | * 60 | * @return boolean 61 | */ 62 | public static function didLog(string $level, $message) 63 | { 64 | foreach (self::$op_logs as $log) 65 | { 66 | if (strtolower($log['level']) === strtolower($level) && $message === $log['message']) 67 | { 68 | return true; 69 | } 70 | } 71 | 72 | return false; 73 | } 74 | 75 | //-------------------------------------------------------------------- 76 | // Expose cleanFileNames() 77 | public function cleanup($file) 78 | { 79 | return $this->cleanFileNames($file); 80 | } 81 | 82 | } 83 | -------------------------------------------------------------------------------- /public/ckeditor5/src/ckeditor.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license Copyright (c) 2014-2020, CKSource - Frederico Knabben. All rights reserved. 3 | * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license 4 | */ 5 | import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor.js'; 6 | import Autoformat from '@ckeditor/ckeditor5-autoformat/src/autoformat.js'; 7 | import BlockQuote from '@ckeditor/ckeditor5-block-quote/src/blockquote.js'; 8 | import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold.js'; 9 | import CKFinder from '@ckeditor/ckeditor5-ckfinder/src/ckfinder.js'; 10 | import CKFinderUploadAdapter from '@ckeditor/ckeditor5-adapter-ckfinder/src/uploadadapter.js'; 11 | import Heading from '@ckeditor/ckeditor5-heading/src/heading.js'; 12 | import Image from '@ckeditor/ckeditor5-image/src/image.js'; 13 | import ImageCaption from '@ckeditor/ckeditor5-image/src/imagecaption.js'; 14 | import ImageStyle from '@ckeditor/ckeditor5-image/src/imagestyle.js'; 15 | import ImageToolbar from '@ckeditor/ckeditor5-image/src/imagetoolbar.js'; 16 | import ImageUpload from '@ckeditor/ckeditor5-image/src/imageupload.js'; 17 | import Indent from '@ckeditor/ckeditor5-indent/src/indent.js'; 18 | import Italic from '@ckeditor/ckeditor5-basic-styles/src/italic.js'; 19 | import Link from '@ckeditor/ckeditor5-link/src/link.js'; 20 | import List from '@ckeditor/ckeditor5-list/src/list.js'; 21 | import PasteFromOffice from '@ckeditor/ckeditor5-paste-from-office/src/pastefromoffice'; 22 | import Table from '@ckeditor/ckeditor5-table/src/table.js'; 23 | import TableToolbar from '@ckeditor/ckeditor5-table/src/tabletoolbar.js'; 24 | import Essentials from '@ckeditor/ckeditor5-essentials/src/essentials.js'; 25 | import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph.js'; 26 | 27 | export default class Editor extends ClassicEditor {} 28 | 29 | // Plugins to include in the build. 30 | Editor.builtinPlugins = [ 31 | Autoformat, 32 | BlockQuote, 33 | Bold, 34 | CKFinder, 35 | CKFinderUploadAdapter, 36 | Heading, 37 | Image, 38 | ImageCaption, 39 | ImageStyle, 40 | ImageToolbar, 41 | ImageUpload, 42 | Indent, 43 | Italic, 44 | Link, 45 | List, 46 | PasteFromOffice, 47 | Table, 48 | TableToolbar, 49 | Essentials, 50 | Paragraph 51 | ]; 52 | 53 | -------------------------------------------------------------------------------- /tests/_support/Events/MockEvents.php: -------------------------------------------------------------------------------- 1 | 'You must specify a source image in your preferences.', 19 | 'gdRequired' => 'The GD image library is required to use this feature.', 20 | 'gdRequiredForProps' => 'Your server must support the GD image library in order to determine the image properties.', 21 | 'gifNotSupported' => 'GIF images are often not supported due to licensing restrictions. You may have to use JPG or PNG images instead.', 22 | 'jpgNotSupported' => 'JPG images are not supported.', 23 | 'pngNotSupported' => 'PNG images are not supported.', 24 | 'unsupportedImageCreate' => 'Your server does not support the GD function required to process this type of image.', 25 | 'jpgOrPngRequired' => 'The image resize protocol specified in your preferences only works with JPEG or PNG image types.', 26 | 'rotateUnsupported' => 'Image rotation does not appear to be supported by your server.', 27 | 'libPathInvalid' => 'The path to your image library is not correct. Please set the correct path in your image preferences. {0, string)', 28 | 'imageProcessFailed' => 'Image processing failed. Please verify that your server supports the chosen protocol and that the path to your image library is correct.', 29 | 'rotationAngleRequired' => 'An angle of rotation is required to rotate the image.', 30 | 'invalidPath' => 'The path to the image is not correct.', 31 | 'copyFailed' => 'The image copy routine failed.', 32 | 'missingFont' => 'Unable to find a font to use.', 33 | 'saveFailed' => 'Unable to save the image. Please make sure the image and file directory are writable.', 34 | 'invalidDirection' => 'Flip direction can be only `vertical` or `horizontal`. Given: {0}', 35 | 'exifNotSupported' => 'Reading EXIF data is not supported by this PHP installation.', 36 | ]; 37 | -------------------------------------------------------------------------------- /public/ckeditor5/LICENSE.md: -------------------------------------------------------------------------------- 1 | Software License Agreement 2 | ========================== 3 | 4 | Copyright (c) 2014-2020, CKSource - Frederico Knabben. All rights reserved. 5 | 6 | Online builder code samples are licensed under the terms of the MIT License (see Appendix A): 7 | 8 | http://en.wikipedia.org/wiki/MIT_License 9 | 10 | CKEditor 5 collaboration features are only available under a commercial license. [Contact us](https://ckeditor.com/contact/) for more details. 11 | 12 | Free 30-days trials of CKEditor 5 collaboration features are available: 13 | * https://ckeditor.com/collaboration/ - Real-time collaboration (with all features). 14 | * https://ckeditor.com/collaboration/comments/ - Inline comments feature (without real-time collaborative editing). 15 | * https://ckeditor.com/collaboration/track-changes/ - Track changes feature (without real-time collaborative editing). 16 | 17 | Trademarks 18 | ---------- 19 | 20 | CKEditor is a trademark of CKSource - Frederico Knabben. All other brand 21 | and product names are trademarks, registered trademarks or service 22 | marks of their respective holders. 23 | 24 | --- 25 | 26 | Appendix A: The MIT License 27 | --------------------------- 28 | 29 | The MIT License (MIT) 30 | 31 | Copyright (c) 2014-{YEAR}, CKSource - Frederico Knabben 32 | 33 | Permission is hereby granted, free of charge, to any person obtaining a copy 34 | of this software and associated documentation files (the "Software"), to deal 35 | in the Software without restriction, including without limitation the rights 36 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 37 | copies of the Software, and to permit persons to whom the Software is 38 | furnished to do so, subject to the following conditions: 39 | 40 | The above copyright notice and this permission notice shall be included in 41 | all copies or substantial portions of the Software. 42 | 43 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 44 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 45 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 46 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 47 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 48 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 49 | THE SOFTWARE. 50 | -------------------------------------------------------------------------------- /public/ckeditor5/webpack.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license Copyright (c) 2014-2020, CKSource - Frederico Knabben. All rights reserved. 3 | * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license 4 | */ 5 | 6 | 'use strict'; 7 | 8 | /* eslint-env node */ 9 | 10 | const path = require( 'path' ); 11 | const webpack = require( 'webpack' ); 12 | const { bundler, styles } = require( '@ckeditor/ckeditor5-dev-utils' ); 13 | const CKEditorWebpackPlugin = require( '@ckeditor/ckeditor5-dev-webpack-plugin' ); 14 | const TerserWebpackPlugin = require( 'terser-webpack-plugin' ); 15 | 16 | module.exports = { 17 | devtool: 'source-map', 18 | performance: { hints: false }, 19 | 20 | entry: path.resolve( __dirname, 'src', 'ckeditor.js' ), 21 | 22 | output: { 23 | // The name under which the editor will be exported. 24 | library: 'ClassicEditor', 25 | 26 | path: path.resolve( __dirname, 'build' ), 27 | filename: 'ckeditor.js', 28 | libraryTarget: 'umd', 29 | libraryExport: 'default' 30 | }, 31 | 32 | optimization: { 33 | minimizer: [ 34 | new TerserWebpackPlugin( { 35 | sourceMap: true, 36 | terserOptions: { 37 | output: { 38 | // Preserve CKEditor 5 license comments. 39 | comments: /^!/ 40 | } 41 | }, 42 | extractComments: false 43 | } ) 44 | ] 45 | }, 46 | 47 | plugins: [ 48 | new CKEditorWebpackPlugin( { 49 | // UI language. Language codes follow the https://en.wikipedia.org/wiki/ISO_639-1 format. 50 | // When changing the built-in language, remember to also change it in the editor's configuration (src/ckeditor.js). 51 | language: 'en', 52 | additionalLanguages: 'all' 53 | } ), 54 | new webpack.BannerPlugin( { 55 | banner: bundler.getLicenseBanner(), 56 | raw: true 57 | } ) 58 | ], 59 | 60 | module: { 61 | rules: [ 62 | { 63 | test: /\.svg$/, 64 | use: [ 'raw-loader' ] 65 | }, 66 | { 67 | test: /\.css$/, 68 | use: [ 69 | { 70 | loader: 'style-loader', 71 | options: { 72 | injectType: 'singletonStyleTag' 73 | } 74 | }, 75 | { 76 | loader: 'postcss-loader', 77 | options: styles.getPostCssConfig( { 78 | themeImporter: { 79 | themePath: require.resolve( '@ckeditor/ckeditor5-theme-lark' ) 80 | }, 81 | minify: true 82 | } ) 83 | }, 84 | ] 85 | } 86 | ] 87 | } 88 | }; 89 | -------------------------------------------------------------------------------- /app/Config/Format.php: -------------------------------------------------------------------------------- 1 | \CodeIgniter\Format\JSONFormatter::class, 39 | 'application/xml' => \CodeIgniter\Format\XMLFormatter::class, 40 | 'text/xml' => \CodeIgniter\Format\XMLFormatter::class, 41 | ]; 42 | 43 | //-------------------------------------------------------------------- 44 | 45 | /** 46 | * A Factory method to return the appropriate formatter for the given mime type. 47 | * 48 | * @param string $mime 49 | * 50 | * @return \CodeIgniter\Format\FormatterInterface 51 | */ 52 | public function getFormatter(string $mime) 53 | { 54 | if (! array_key_exists($mime, $this->formatters)) 55 | { 56 | throw new \InvalidArgumentException('No Formatter defined for mime type: ' . $mime); 57 | } 58 | 59 | $class = $this->formatters[$mime]; 60 | 61 | if (! class_exists($class)) 62 | { 63 | throw new \BadMethodCallException($class . ' is not a valid Formatter.'); 64 | } 65 | 66 | return new $class(); 67 | } 68 | 69 | //-------------------------------------------------------------------- 70 | 71 | } 72 | -------------------------------------------------------------------------------- /app/Views/login.php: -------------------------------------------------------------------------------- 1 | 10 | 11 |
12 | 13 |
14 |
15 | 16 |
17 |
18 | Sign in 19 |
20 |
21 | 22 | get('auth') == 0):?> 23 | 29 | 30 | 31 | 32 | 33 |
34 | 35 | "mail", "class" => "form-control", "type" => "text", "name" => "uname", "placeholder" => "Username"]; ?> 36 | 37 |
38 | 39 |
40 | 41 | "password", "class" => "form-control", "type" => "password", "name" => "password", "placeholder" => "Password"]; ?> 42 | 43 |
44 | 45 |
46 | 47 |
48 | 49 | 50 |
51 | 52 |
53 |
55 |
56 | New to Blog?
Create an account.
57 |
58 |
59 |
-------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | #------------------------- 2 | # Operating Specific Junk Files 3 | #------------------------- 4 | 5 | # OS X 6 | .DS_Store 7 | .AppleDouble 8 | .LSOverride 9 | 10 | # OS X Thumbnails 11 | ._* 12 | 13 | # Windows image file caches 14 | Thumbs.db 15 | ehthumbs.db 16 | Desktop.ini 17 | 18 | # Recycle Bin used on file shares 19 | $RECYCLE.BIN/ 20 | 21 | # Windows Installer files 22 | *.cab 23 | *.msi 24 | *.msm 25 | *.msp 26 | 27 | # Windows shortcuts 28 | *.lnk 29 | 30 | # Linux 31 | *~ 32 | 33 | # KDE directory preferences 34 | .directory 35 | 36 | # Linux trash folder which might appear on any partition or disk 37 | .Trash-* 38 | 39 | #------------------------- 40 | # Environment Files 41 | #------------------------- 42 | # These should never be under version control, 43 | # as it poses a security risk. 44 | .env 45 | .vagrant 46 | Vagrantfile 47 | 48 | #------------------------- 49 | # Temporary Files 50 | #------------------------- 51 | writable/cache/* 52 | !writable/cache/index.html 53 | 54 | writable/logs/* 55 | !writable/logs/index.html 56 | 57 | writable/session/* 58 | !writable/session/index.html 59 | 60 | writable/uploads/* 61 | !writable/uploads/index.html 62 | 63 | writable/debugbar/* 64 | 65 | php_errors.log 66 | 67 | #------------------------- 68 | # User Guide Temp Files 69 | #------------------------- 70 | user_guide_src/build/* 71 | user_guide_src/cilexer/build/* 72 | user_guide_src/cilexer/dist/* 73 | user_guide_src/cilexer/pycilexer.egg-info/* 74 | 75 | #------------------------- 76 | # Test Files 77 | #------------------------- 78 | tests/coverage* 79 | 80 | # Don't save phpunit under version control. 81 | phpunit 82 | 83 | #------------------------- 84 | # Composer 85 | #------------------------- 86 | vendor/ 87 | composer.lock 88 | 89 | #------------------------- 90 | # IDE / Development Files 91 | #------------------------- 92 | 93 | # Modules Testing 94 | _modules/* 95 | 96 | # phpenv local config 97 | .php-version 98 | 99 | # Jetbrains editors (PHPStorm, etc) 100 | .idea/ 101 | *.iml 102 | 103 | # Netbeans 104 | nbproject/ 105 | build/ 106 | nbbuild/ 107 | dist/ 108 | nbdist/ 109 | nbactions.xml 110 | nb-configuration.xml 111 | .nb-gradle/ 112 | 113 | # Sublime Text 114 | *.tmlanguage.cache 115 | *.tmPreferences.cache 116 | *.stTheme.cache 117 | *.sublime-workspace 118 | *.sublime-project 119 | .phpintel 120 | /api/ 121 | 122 | # Visual Studio Code 123 | .vscode/ 124 | 125 | /results/ 126 | /phpunit*.xml -------------------------------------------------------------------------------- /system/Encryption/EncrypterInterface.php: -------------------------------------------------------------------------------- 1 | CodeIgniter::CI_VERSION, 62 | 'phpVersion' => phpversion(), 63 | 'phpSAPI' => php_sapi_name(), 64 | 'environment' => ENVIRONMENT, 65 | 'baseURL' => $config->baseURL, 66 | 'timezone' => app_timezone(), 67 | 'locale' => Services::request()->getLocale(), 68 | 'cspEnabled' => $config->CSPEnabled, 69 | ]; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /system/Database/MySQLi/Builder.php: -------------------------------------------------------------------------------- 1 | QBJoin) && count($this->QBFrom) > 1) 70 | { 71 | return '(' . implode(', ', $this->QBFrom) . ')'; 72 | } 73 | 74 | return implode(', ', $this->QBFrom); 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /system/Database/SQLite3/Utils.php: -------------------------------------------------------------------------------- 1 | '', 14 | 'xhtml1-strict' => '', 15 | 'xhtml1-trans' => '', 16 | 'xhtml1-frame' => '', 17 | 'xhtml-basic11' => '', 18 | 'html5' => '', 19 | 'html4-strict' => '', 20 | 'html4-trans' => '', 21 | 'html4-frame' => '', 22 | 'mathml1' => '', 23 | 'mathml2' => '', 24 | 'svg10' => '', 25 | 'svg11' => '', 26 | 'svg11-basic' => '', 27 | 'svg11-tiny' => '', 28 | 'xhtml-math-svg-xh' => '', 29 | 'xhtml-math-svg-sh' => '', 30 | 'xhtml-rdfa-1' => '', 31 | 'xhtml-rdfa-2' => '', 32 | ]; 33 | } 34 | -------------------------------------------------------------------------------- /system/Language/en/Migrations.php: -------------------------------------------------------------------------------- 1 | 'Migrations table must be set.', 20 | 'disabled' => 'Migrations have been loaded but are disabled or setup incorrectly.', 21 | 'notFound' => 'Migration file not found: ', 22 | 'batchNotFound' => 'Target batch not found: ', 23 | 'empty' => 'No Migration files found', 24 | 'gap' => 'There is a gap in the migration sequence near version number: ', 25 | 'classNotFound' => 'The migration class "%s" could not be found.', 26 | 'missingMethod' => 'The migration class is missing an "%s" method.', 27 | 28 | // Migration Command 29 | 'migHelpLatest' => "\t\tMigrates database to latest available migration.", 30 | 'migHelpCurrent' => "\t\tMigrates database to version set as 'current' in configuration.", 31 | 'migHelpVersion' => "\tMigrates database to version {v}.", 32 | 'migHelpRollback' => "\tRuns all migrations 'down' to version 0.", 33 | 'migHelpRefresh' => "\t\tUninstalls and re-runs all migrations to freshen database.", 34 | 'migHelpSeed' => "\tRuns the seeder named [name].", 35 | 'migCreate' => "\tCreates a new migration named [name]", 36 | 'nameMigration' => 'Name the migration file', 37 | 'badCreateName' => 'You must provide a migration file name.', 38 | 'writeError' => 'Error trying to create file.', 39 | 'migNumberError' => 'Migration number must be three digits, and there must not be any gaps in the sequence.', 40 | 41 | 'latest' => 'Running all new migrations...', 42 | 'generalFault' => 'Migration failed!', 43 | 'migInvalidVersion' => 'Invalid version number provided.', 44 | 'toVersionPH' => 'Migrating to version %s...', 45 | 'toVersion' => 'Migrating to current version...', 46 | 'rollingBack' => 'Rolling back migrations to batch: ', 47 | 'noneFound' => 'No migrations were found.', 48 | 'on' => 'Migrated On: ', 49 | 'migSeeder' => 'Seeder name', 50 | 'migMissingSeeder' => 'You must provide a seeder name.', 51 | 'removed' => 'Rolling back: ', 52 | 'added' => 'Running: ', 53 | 54 | 'version' => 'Version', 55 | 'filename' => 'Filename', 56 | ]; 57 | -------------------------------------------------------------------------------- /system/Database/MySQLi/Utils.php: -------------------------------------------------------------------------------- 1 |