├── .gitattributes ├── .gitignore ├── .htaccess ├── LICENSE ├── README.md ├── app ├── .htaccess ├── Common.php ├── Config │ ├── App.php │ ├── Autoload.php │ ├── Boot │ │ ├── development.php │ │ ├── production.php │ │ └── testing.php │ ├── Cache.php │ ├── Constants.php │ ├── ContentSecurityPolicy.php │ ├── Cookie.php │ ├── Database.php │ ├── DocTypes.php │ ├── Email.php │ ├── Encryption.php │ ├── Events.php │ ├── Exceptions.php │ ├── Filters.php │ ├── ForeignCharacters.php │ ├── Format.php │ ├── Generators.php │ ├── Honeypot.php │ ├── Images.php │ ├── Kint.php │ ├── Logger.php │ ├── Migrations.php │ ├── Mimes.php │ ├── Modules.php │ ├── Pager.php │ ├── Paths.php │ ├── Routes.php │ ├── Security.php │ ├── Services.php │ ├── Toolbar.php │ ├── UserAgents.php │ ├── Validation.php │ └── View.php ├── Controllers │ ├── BaseController.php │ ├── Create.php │ ├── Delete.php │ ├── Home.php │ ├── Read.php │ ├── Rohit.php │ └── Update.php ├── Database │ ├── Migrations │ │ └── .gitkeep │ └── Seeds │ │ └── .gitkeep ├── Filters │ └── .gitkeep ├── Helpers │ └── .gitkeep ├── Language │ ├── .gitkeep │ └── en │ │ └── Validation.php ├── Libraries │ └── .gitkeep ├── Models │ ├── .gitkeep │ ├── Auth.php │ └── CheckImage.php ├── ThirdParty │ └── .gitkeep ├── Views │ ├── errors │ │ ├── cli │ │ │ ├── error_404.php │ │ │ ├── error_exception.php │ │ │ └── production.php │ │ └── html │ │ │ ├── debug.css │ │ │ ├── debug.js │ │ │ ├── error_404.php │ │ │ ├── error_exception.php │ │ │ └── production.php │ └── welcome_message.php └── index.html ├── ci.jpg ├── composer.json ├── crud-working.png ├── env ├── favicon.ico ├── index.php ├── joins-working.jpg ├── phpunit.xml.dist ├── robots.txt ├── spark ├── system ├── .htaccess ├── API │ └── ResponseTrait.php ├── Autoloader │ ├── Autoloader.php │ └── FileLocator.php ├── BaseModel.php ├── CLI │ ├── BaseCommand.php │ ├── CLI.php │ ├── CommandRunner.php │ ├── Commands.php │ ├── Console.php │ ├── Exceptions │ │ └── CLIException.php │ └── GeneratorTrait.php ├── Cache │ ├── CacheFactory.php │ ├── CacheInterface.php │ ├── Exceptions │ │ ├── CacheException.php │ │ └── ExceptionInterface.php │ └── Handlers │ │ ├── BaseHandler.php │ │ ├── DummyHandler.php │ │ ├── FileHandler.php │ │ ├── MemcachedHandler.php │ │ ├── PredisHandler.php │ │ ├── RedisHandler.php │ │ └── WincacheHandler.php ├── CodeIgniter.php ├── Commands │ ├── Cache │ │ ├── ClearCache.php │ │ └── InfoCache.php │ ├── Database │ │ ├── CreateDatabase.php │ │ ├── Migrate.php │ │ ├── MigrateRefresh.php │ │ ├── MigrateRollback.php │ │ ├── MigrateStatus.php │ │ └── Seed.php │ ├── Encryption │ │ └── GenerateKey.php │ ├── Generators │ │ ├── CommandGenerator.php │ │ ├── ConfigGenerator.php │ │ ├── ControllerGenerator.php │ │ ├── EntityGenerator.php │ │ ├── FilterGenerator.php │ │ ├── MigrateCreate.php │ │ ├── MigrationGenerator.php │ │ ├── ModelGenerator.php │ │ ├── ScaffoldGenerator.php │ │ ├── SeederGenerator.php │ │ ├── SessionMigrationGenerator.php │ │ ├── ValidationGenerator.php │ │ └── Views │ │ │ ├── command.tpl.php │ │ │ ├── config.tpl.php │ │ │ ├── controller.tpl.php │ │ │ ├── entity.tpl.php │ │ │ ├── filter.tpl.php │ │ │ ├── migration.tpl.php │ │ │ ├── model.tpl.php │ │ │ ├── seeder.tpl.php │ │ │ └── validation.tpl.php │ ├── Help.php │ ├── Housekeeping │ │ ├── ClearDebugbar.php │ │ └── ClearLogs.php │ ├── ListCommands.php │ ├── Server │ │ ├── Serve.php │ │ └── rewrite.php │ └── Utilities │ │ ├── Environment.php │ │ ├── Namespaces.php │ │ └── Routes.php ├── Common.php ├── ComposerScripts.php ├── Config │ ├── AutoloadConfig.php │ ├── BaseConfig.php │ ├── BaseService.php │ ├── Config.php │ ├── DotEnv.php │ ├── Factories.php │ ├── Factory.php │ ├── ForeignCharacters.php │ ├── Routes.php │ ├── Services.php │ └── View.php ├── Controller.php ├── Cookie │ ├── CloneableCookieInterface.php │ ├── Cookie.php │ ├── CookieInterface.php │ ├── CookieStore.php │ └── Exceptions │ │ └── CookieException.php ├── Database │ ├── BaseBuilder.php │ ├── BaseConnection.php │ ├── BasePreparedQuery.php │ ├── BaseResult.php │ ├── BaseUtils.php │ ├── Config.php │ ├── ConnectionInterface.php │ ├── Database.php │ ├── Exceptions │ │ ├── DataException.php │ │ ├── DatabaseException.php │ │ └── ExceptionInterface.php │ ├── Forge.php │ ├── Migration.php │ ├── MigrationRunner.php │ ├── ModelFactory.php │ ├── MySQLi │ │ ├── Builder.php │ │ ├── Connection.php │ │ ├── Forge.php │ │ ├── PreparedQuery.php │ │ ├── Result.php │ │ └── Utils.php │ ├── Postgre │ │ ├── Builder.php │ │ ├── Connection.php │ │ ├── Forge.php │ │ ├── PreparedQuery.php │ │ ├── Result.php │ │ └── Utils.php │ ├── PreparedQueryInterface.php │ ├── Query.php │ ├── QueryInterface.php │ ├── ResultInterface.php │ ├── SQLSRV │ │ ├── Builder.php │ │ ├── Connection.php │ │ ├── Forge.php │ │ ├── PreparedQuery.php │ │ ├── Result.php │ │ └── Utils.php │ ├── SQLite3 │ │ ├── Builder.php │ │ ├── Connection.php │ │ ├── Forge.php │ │ ├── PreparedQuery.php │ │ ├── Result.php │ │ ├── Table.php │ │ └── Utils.php │ └── Seeder.php ├── Debug │ ├── Exceptions.php │ ├── Iterator.php │ ├── Timer.php │ ├── Toolbar.php │ └── Toolbar │ │ ├── Collectors │ │ ├── BaseCollector.php │ │ ├── Config.php │ │ ├── Database.php │ │ ├── Events.php │ │ ├── Files.php │ │ ├── History.php │ │ ├── Logs.php │ │ ├── Routes.php │ │ ├── Timers.php │ │ └── Views.php │ │ └── Views │ │ ├── _config.tpl │ │ ├── _database.tpl │ │ ├── _events.tpl │ │ ├── _files.tpl │ │ ├── _history.tpl │ │ ├── _logs.tpl │ │ ├── _routes.tpl │ │ ├── toolbar.css │ │ ├── toolbar.js │ │ ├── toolbar.tpl.php │ │ └── toolbarloader.js.php ├── Email │ └── Email.php ├── Encryption │ ├── EncrypterInterface.php │ ├── Encryption.php │ ├── Exceptions │ │ └── EncryptionException.php │ └── Handlers │ │ ├── BaseHandler.php │ │ ├── OpenSSLHandler.php │ │ └── SodiumHandler.php ├── Entity.php ├── Entity │ ├── Cast │ │ ├── ArrayCast.php │ │ ├── BaseCast.php │ │ ├── BooleanCast.php │ │ ├── CSVCast.php │ │ ├── CastInterface.php │ │ ├── DatetimeCast.php │ │ ├── FloatCast.php │ │ ├── IntegerCast.php │ │ ├── JsonCast.php │ │ ├── ObjectCast.php │ │ ├── StringCast.php │ │ ├── TimestampCast.php │ │ └── URICast.php │ ├── Entity.php │ └── Exceptions │ │ └── CastException.php ├── Events │ └── Events.php ├── Exceptions │ ├── AlertError.php │ ├── CastException.php │ ├── ConfigException.php │ ├── CriticalError.php │ ├── DebugTraceableTrait.php │ ├── DownloadException.php │ ├── EmergencyError.php │ ├── ExceptionInterface.php │ ├── FrameworkException.php │ ├── ModelException.php │ └── PageNotFoundException.php ├── Files │ ├── Exceptions │ │ ├── FileException.php │ │ └── FileNotFoundException.php │ └── File.php ├── Filters │ ├── CSRF.php │ ├── DebugToolbar.php │ ├── Exceptions │ │ └── FilterException.php │ ├── FilterInterface.php │ ├── Filters.php │ └── Honeypot.php ├── Format │ ├── Exceptions │ │ └── FormatException.php │ ├── Format.php │ ├── FormatterInterface.php │ ├── JSONFormatter.php │ └── XMLFormatter.php ├── HTTP │ ├── CLIRequest.php │ ├── CURLRequest.php │ ├── ContentSecurityPolicy.php │ ├── DownloadResponse.php │ ├── Exceptions │ │ └── HTTPException.php │ ├── Files │ │ ├── FileCollection.php │ │ ├── UploadedFile.php │ │ └── UploadedFileInterface.php │ ├── Header.php │ ├── IncomingRequest.php │ ├── Message.php │ ├── MessageInterface.php │ ├── MessageTrait.php │ ├── Negotiate.php │ ├── RedirectResponse.php │ ├── Request.php │ ├── RequestInterface.php │ ├── RequestTrait.php │ ├── Response.php │ ├── ResponseInterface.php │ ├── ResponseTrait.php │ ├── URI.php │ └── UserAgent.php ├── Helpers │ ├── array_helper.php │ ├── cookie_helper.php │ ├── date_helper.php │ ├── filesystem_helper.php │ ├── form_helper.php │ ├── html_helper.php │ ├── inflector_helper.php │ ├── number_helper.php │ ├── security_helper.php │ ├── test_helper.php │ ├── text_helper.php │ ├── url_helper.php │ └── xml_helper.php ├── Honeypot │ ├── Exceptions │ │ └── HoneypotException.php │ └── Honeypot.php ├── I18n │ ├── Exceptions │ │ └── I18nException.php │ ├── Time.php │ └── TimeDifference.php ├── Images │ ├── Exceptions │ │ └── ImageException.php │ ├── Handlers │ │ ├── BaseHandler.php │ │ ├── GDHandler.php │ │ └── ImageMagickHandler.php │ ├── Image.php │ └── ImageHandlerInterface.php ├── Language │ ├── Language.php │ └── en │ │ ├── CLI.php │ │ ├── Cache.php │ │ ├── Cast.php │ │ ├── Cookie.php │ │ ├── Core.php │ │ ├── Database.php │ │ ├── Email.php │ │ ├── Encryption.php │ │ ├── Fabricator.php │ │ ├── Files.php │ │ ├── Filters.php │ │ ├── Format.php │ │ ├── HTTP.php │ │ ├── Images.php │ │ ├── Log.php │ │ ├── Migrations.php │ │ ├── Number.php │ │ ├── Pager.php │ │ ├── RESTful.php │ │ ├── Router.php │ │ ├── Security.php │ │ ├── Session.php │ │ ├── Time.php │ │ ├── Validation.php │ │ └── View.php ├── Log │ ├── Exceptions │ │ └── LogException.php │ ├── Handlers │ │ ├── BaseHandler.php │ │ ├── ChromeLoggerHandler.php │ │ ├── ErrorlogHandler.php │ │ ├── FileHandler.php │ │ └── HandlerInterface.php │ └── Logger.php ├── Model.php ├── Modules │ └── Modules.php ├── Pager │ ├── Exceptions │ │ └── PagerException.php │ ├── Pager.php │ ├── PagerInterface.php │ ├── PagerRenderer.php │ └── Views │ │ ├── default_full.php │ │ ├── default_head.php │ │ └── default_simple.php ├── RESTful │ ├── BaseResource.php │ ├── ResourceController.php │ └── ResourcePresenter.php ├── Router │ ├── Exceptions │ │ ├── RedirectException.php │ │ └── RouterException.php │ ├── RouteCollection.php │ ├── RouteCollectionInterface.php │ ├── Router.php │ └── RouterInterface.php ├── Security │ ├── Exceptions │ │ └── SecurityException.php │ ├── Security.php │ └── SecurityInterface.php ├── Session │ ├── Exceptions │ │ └── SessionException.php │ ├── Handlers │ │ ├── ArrayHandler.php │ │ ├── BaseHandler.php │ │ ├── DatabaseHandler.php │ │ ├── FileHandler.php │ │ ├── MemcachedHandler.php │ │ └── RedisHandler.php │ ├── Session.php │ └── SessionInterface.php ├── Test │ ├── CIDatabaseTestCase.php │ ├── CIUnitTestCase.php │ ├── Constraints │ │ └── SeeInDatabase.php │ ├── ControllerResponse.php │ ├── ControllerTestTrait.php │ ├── ControllerTester.php │ ├── DOMParser.php │ ├── DatabaseTestTrait.php │ ├── Fabricator.php │ ├── FeatureResponse.php │ ├── FeatureTestCase.php │ ├── FeatureTestTrait.php │ ├── FilterTestTrait.php │ ├── Filters │ │ └── CITestStreamFilter.php │ ├── Interfaces │ │ └── FabricatorModel.php │ ├── Mock │ │ ├── MockAppConfig.php │ │ ├── MockAutoload.php │ │ ├── MockBuilder.php │ │ ├── MockCLIConfig.php │ │ ├── MockCURLRequest.php │ │ ├── MockCache.php │ │ ├── MockCodeIgniter.php │ │ ├── MockCommon.php │ │ ├── MockConnection.php │ │ ├── MockEmail.php │ │ ├── MockEvents.php │ │ ├── MockFileLogger.php │ │ ├── MockIncomingRequest.php │ │ ├── MockLanguage.php │ │ ├── MockLogger.php │ │ ├── MockQuery.php │ │ ├── MockResourceController.php │ │ ├── MockResourcePresenter.php │ │ ├── MockResponse.php │ │ ├── MockResult.php │ │ ├── MockSecurity.php │ │ ├── MockSecurityConfig.php │ │ ├── MockServices.php │ │ ├── MockSession.php │ │ └── MockTable.php │ ├── ReflectionHelper.php │ ├── TestLogger.php │ ├── TestResponse.php │ └── bootstrap.php ├── ThirdParty │ ├── Escaper │ │ ├── Escaper.php │ │ └── Exception │ │ │ ├── ExceptionInterface.php │ │ │ ├── InvalidArgumentException.php │ │ │ └── RuntimeException.php │ ├── Kint │ │ ├── CallFinder.php │ │ ├── Kint.php │ │ ├── Object │ │ │ ├── BasicObject.php │ │ │ ├── BlobObject.php │ │ │ ├── ClosureObject.php │ │ │ ├── DateTimeObject.php │ │ │ ├── InstanceObject.php │ │ │ ├── MethodObject.php │ │ │ ├── ParameterObject.php │ │ │ ├── Representation │ │ │ │ ├── ColorRepresentation.php │ │ │ │ ├── DocstringRepresentation.php │ │ │ │ ├── MicrotimeRepresentation.php │ │ │ │ ├── Representation.php │ │ │ │ ├── SourceRepresentation.php │ │ │ │ └── SplFileInfoRepresentation.php │ │ │ ├── ResourceObject.php │ │ │ ├── StreamObject.php │ │ │ ├── ThrowableObject.php │ │ │ ├── TraceFrameObject.php │ │ │ └── TraceObject.php │ │ ├── Parser │ │ │ ├── ArrayObjectPlugin.php │ │ │ ├── Base64Plugin.php │ │ │ ├── BinaryPlugin.php │ │ │ ├── BlacklistPlugin.php │ │ │ ├── ClassMethodsPlugin.php │ │ │ ├── ClassStaticsPlugin.php │ │ │ ├── ClosurePlugin.php │ │ │ ├── ColorPlugin.php │ │ │ ├── DOMDocumentPlugin.php │ │ │ ├── DateTimePlugin.php │ │ │ ├── FsPathPlugin.php │ │ │ ├── IteratorPlugin.php │ │ │ ├── JsonPlugin.php │ │ │ ├── MicrotimePlugin.php │ │ │ ├── MysqliPlugin.php │ │ │ ├── Parser.php │ │ │ ├── Plugin.php │ │ │ ├── ProxyPlugin.php │ │ │ ├── SerializePlugin.php │ │ │ ├── SimpleXMLElementPlugin.php │ │ │ ├── SplFileInfoPlugin.php │ │ │ ├── SplObjectStoragePlugin.php │ │ │ ├── StreamPlugin.php │ │ │ ├── TablePlugin.php │ │ │ ├── ThrowablePlugin.php │ │ │ ├── TimestampPlugin.php │ │ │ ├── ToStringPlugin.php │ │ │ ├── TracePlugin.php │ │ │ └── XmlPlugin.php │ │ ├── Renderer │ │ │ ├── CliRenderer.php │ │ │ ├── PlainRenderer.php │ │ │ ├── Renderer.php │ │ │ ├── Rich │ │ │ │ ├── BinaryPlugin.php │ │ │ │ ├── BlacklistPlugin.php │ │ │ │ ├── CallablePlugin.php │ │ │ │ ├── ClosurePlugin.php │ │ │ │ ├── ColorPlugin.php │ │ │ │ ├── DepthLimitPlugin.php │ │ │ │ ├── DocstringPlugin.php │ │ │ │ ├── MicrotimePlugin.php │ │ │ │ ├── ObjectPluginInterface.php │ │ │ │ ├── Plugin.php │ │ │ │ ├── PluginInterface.php │ │ │ │ ├── RecursionPlugin.php │ │ │ │ ├── SimpleXMLElementPlugin.php │ │ │ │ ├── SourcePlugin.php │ │ │ │ ├── TabPluginInterface.php │ │ │ │ ├── TablePlugin.php │ │ │ │ ├── TimestampPlugin.php │ │ │ │ └── TraceFramePlugin.php │ │ │ ├── RichRenderer.php │ │ │ ├── Text │ │ │ │ ├── BlacklistPlugin.php │ │ │ │ ├── DepthLimitPlugin.php │ │ │ │ ├── MicrotimePlugin.php │ │ │ │ ├── Plugin.php │ │ │ │ ├── RecursionPlugin.php │ │ │ │ └── TracePlugin.php │ │ │ └── TextRenderer.php │ │ ├── Utils.php │ │ ├── init.php │ │ ├── init_helpers.php │ │ └── resources │ │ │ └── compiled │ │ │ ├── aante-light.css │ │ │ ├── microtime.js │ │ │ ├── original.css │ │ │ ├── plain.css │ │ │ ├── plain.js │ │ │ ├── rich.js │ │ │ ├── shared.js │ │ │ ├── solarized-dark.css │ │ │ └── solarized.css │ └── PSR │ │ └── Log │ │ ├── AbstractLogger.php │ │ ├── InvalidArgumentException.php │ │ ├── LogLevel.php │ │ ├── LoggerAwareInterface.php │ │ ├── LoggerAwareTrait.php │ │ ├── LoggerInterface.php │ │ ├── LoggerTrait.php │ │ └── NullLogger.php ├── Throttle │ ├── Throttler.php │ └── ThrottlerInterface.php ├── Typography │ └── Typography.php ├── Validation │ ├── CreditCardRules.php │ ├── Exceptions │ │ └── ValidationException.php │ ├── FileRules.php │ ├── FormatRules.php │ ├── Rules.php │ ├── Validation.php │ ├── ValidationInterface.php │ └── Views │ │ ├── list.php │ │ └── single.php ├── View │ ├── Cell.php │ ├── Exceptions │ │ └── ViewException.php │ ├── Filters.php │ ├── Parser.php │ ├── Plugins.php │ ├── RendererInterface.php │ ├── Table.php │ └── View.php ├── bootstrap.php └── index.html ├── uploads └── .do_not_delete └── writable ├── .htaccess ├── cache └── index.html ├── logs └── index.html ├── session └── index.html └── uploads └── index.html /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Rohit Chouhan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohit-chouhan/crudigniter/634223a2602b71f3b8b06636b538b25d41793889/README.md -------------------------------------------------------------------------------- /app/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | Require all denied 3 | 4 | 5 | Deny from all 6 | 7 | -------------------------------------------------------------------------------- /app/Common.php: -------------------------------------------------------------------------------- 1 | 0) 34 | { 35 | ob_end_flush(); 36 | } 37 | 38 | ob_start(function ($buffer) { 39 | return $buffer; 40 | }); 41 | } 42 | 43 | /* 44 | * -------------------------------------------------------------------- 45 | * Debug Toolbar Listeners. 46 | * -------------------------------------------------------------------- 47 | * If you delete, they will no longer be collected. 48 | */ 49 | if (CI_DEBUG && ! is_cli()) 50 | { 51 | Events::on('DBQuery', 'CodeIgniter\Debug\Toolbar\Collectors\Database::collect'); 52 | Services::toolbar()->respond(); 53 | } 54 | }); 55 | -------------------------------------------------------------------------------- /app/Config/Filters.php: -------------------------------------------------------------------------------- 1 | CSRF::class, 20 | 'toolbar' => DebugToolbar::class, 21 | 'honeypot' => Honeypot::class, 22 | ]; 23 | 24 | /** 25 | * List of filter aliases that are always 26 | * applied before and after every request. 27 | * 28 | * @var array 29 | */ 30 | public $globals = [ 31 | 'before' => [ 32 | // 'honeypot', 33 | // 'csrf', 34 | ], 35 | 'after' => [ 36 | 'toolbar', 37 | // 'honeypot', 38 | ], 39 | ]; 40 | 41 | /** 42 | * List of filter aliases that works on a 43 | * particular HTTP method (GET, POST, etc.). 44 | * 45 | * Example: 46 | * 'post' => ['csrf', 'throttle'] 47 | * 48 | * @var array 49 | */ 50 | public $methods = []; 51 | 52 | /** 53 | * List of filter aliases that should run on any 54 | * before or after URI patterns. 55 | * 56 | * Example: 57 | * 'isLoggedIn' => ['before' => ['account/*', 'profiles/*']] 58 | * 59 | * @var array 60 | */ 61 | public $filters = []; 62 | } 63 | -------------------------------------------------------------------------------- /app/Config/ForeignCharacters.php: -------------------------------------------------------------------------------- 1 | 27 | */ 28 | public $views = [ 29 | 'make:command' => 'CodeIgniter\Commands\Generators\Views\command.tpl.php', 30 | 'make:controller' => 'CodeIgniter\Commands\Generators\Views\controller.tpl.php', 31 | 'make:entity' => 'CodeIgniter\Commands\Generators\Views\entity.tpl.php', 32 | 'make:filter' => 'CodeIgniter\Commands\Generators\Views\filter.tpl.php', 33 | 'make:migration' => 'CodeIgniter\Commands\Generators\Views\migration.tpl.php', 34 | 'make:model' => 'CodeIgniter\Commands\Generators\Views\model.tpl.php', 35 | 'make:seeder' => 'CodeIgniter\Commands\Generators\Views\seeder.tpl.php', 36 | 'make:validation' => 'CodeIgniter\Commands\Generators\Views\validation.tpl.php', 37 | 'session:migration' => 'CodeIgniter\Commands\Generators\Views\migration.tpl.php', 38 | ]; 39 | } 40 | -------------------------------------------------------------------------------- /app/Config/Honeypot.php: -------------------------------------------------------------------------------- 1 | {label}'; 36 | 37 | /** 38 | * Honeypot container 39 | * 40 | * @var string 41 | */ 42 | public $container = '
{template}
'; 43 | } 44 | -------------------------------------------------------------------------------- /app/Config/Images.php: -------------------------------------------------------------------------------- 1 | 30 | */ 31 | public $handlers = [ 32 | 'gd' => GDHandler::class, 33 | 'imagick' => ImageMagickHandler::class, 34 | ]; 35 | } 36 | -------------------------------------------------------------------------------- /app/Config/Kint.php: -------------------------------------------------------------------------------- 1 | php spark migrate:create 46 | * 47 | * Typical formats: 48 | * - YmdHis_ 49 | * - Y-m-d-His_ 50 | * - Y_m_d_His_ 51 | * 52 | * @var string 53 | */ 54 | public $timestampFormat = 'Y-m-d-His_'; 55 | } 56 | -------------------------------------------------------------------------------- /app/Config/Modules.php: -------------------------------------------------------------------------------- 1 | 22 | */ 23 | public $templates = [ 24 | 'default_full' => 'CodeIgniter\Pager\Views\default_full', 25 | 'default_simple' => 'CodeIgniter\Pager\Views\default_simple', 26 | 'default_head' => 'CodeIgniter\Pager\Views\default_head', 27 | ]; 28 | 29 | /** 30 | * -------------------------------------------------------------------------- 31 | * Items Per Page 32 | * -------------------------------------------------------------------------- 33 | * 34 | * The default number of results shown in a single page. 35 | * 36 | * @var integer 37 | */ 38 | public $perPage = 20; 39 | } 40 | -------------------------------------------------------------------------------- /app/Config/Services.php: -------------------------------------------------------------------------------- 1 | 34 | */ 35 | public $templates = [ 36 | 'list' => 'CodeIgniter\Validation\Views\list', 37 | 'single' => 'CodeIgniter\Validation\Views\single', 38 | ]; 39 | 40 | //-------------------------------------------------------------------- 41 | // Rules 42 | //-------------------------------------------------------------------- 43 | } 44 | -------------------------------------------------------------------------------- /app/Config/View.php: -------------------------------------------------------------------------------- 1 | session = \Config\Services::session(); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /app/Controllers/Home.php: -------------------------------------------------------------------------------- 1 | conn = \Config\Database::connect(); 15 | $this->auth = new \App\Models\Auth(); 16 | } 17 | 18 | 19 | public function index($table) 20 | { 21 | if($this->auth->AuthCheck()){ 22 | $tables = $this->conn->query("SHOW TABLES FROM `" . $this->conn->database . "` WHERE `Tables_in_" . $this->conn->database . "` LIKE '%" . $table . "%'")->getResult(); 23 | $the_table = 'Tables_in_' . $this->conn->database . ''; 24 | if ($tables[0]->$the_table == $table) { 25 | $rawData = file_get_contents("php://input"); 26 | $records = json_decode($rawData, true); 27 | $this->updateData($records, $table, $_GET); 28 | } else { 29 | echo json_encode(array("status" => false, "message" => "Table not found")); 30 | } 31 | } else { 32 | echo json_encode(array("status" => false, "message" => "Failed to auth, token is invalid")); 33 | } 34 | } 35 | public function updateData($arr, $table, $get) 36 | { 37 | $q = $this->conn->table($table); 38 | if (array_key_exists("all", $get)) { 39 | } else { 40 | foreach ($get as $key => $value) { 41 | $q = $q->where($key, $value); 42 | } 43 | } 44 | $data = $arr; 45 | if ($q->update($data)) { 46 | echo json_encode(array("status" => true, "message" => "Update successfully")); 47 | } else { 48 | echo json_encode(array("status" => false, "message" => "Problem while updating data, check your data")); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /app/Database/Migrations/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohit-chouhan/crudigniter/634223a2602b71f3b8b06636b538b25d41793889/app/Database/Migrations/.gitkeep -------------------------------------------------------------------------------- /app/Database/Seeds/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohit-chouhan/crudigniter/634223a2602b71f3b8b06636b538b25d41793889/app/Database/Seeds/.gitkeep -------------------------------------------------------------------------------- /app/Filters/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohit-chouhan/crudigniter/634223a2602b71f3b8b06636b538b25d41793889/app/Filters/.gitkeep -------------------------------------------------------------------------------- /app/Helpers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohit-chouhan/crudigniter/634223a2602b71f3b8b06636b538b25d41793889/app/Helpers/.gitkeep -------------------------------------------------------------------------------- /app/Language/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohit-chouhan/crudigniter/634223a2602b71f3b8b06636b538b25d41793889/app/Language/.gitkeep -------------------------------------------------------------------------------- /app/Language/en/Validation.php: -------------------------------------------------------------------------------- 1 | getToken() == getenv('TOKEN_KEY')) { 13 | return true; 14 | } else { 15 | return false; 16 | } 17 | } else { 18 | return true; 19 | } 20 | } 21 | 22 | //method to read bearer token 23 | public function getToken(){ 24 | $headers = null; 25 | if (isset($_SERVER['Authorization'])) { 26 | $headers = trim($_SERVER["Authorization"]); 27 | } 28 | else if (isset($_SERVER['HTTP_AUTHORIZATION'])) { 29 | $headers = trim($_SERVER["HTTP_AUTHORIZATION"]); 30 | } elseif (function_exists('apache_request_headers')) { 31 | $requestHeaders = apache_request_headers(); 32 | $requestHeaders = array_combine(array_map('ucwords', array_keys($requestHeaders)), array_values($requestHeaders)); 33 | if (isset($requestHeaders['Authorization'])) { 34 | $headers = trim($requestHeaders['Authorization']); 35 | } 36 | } 37 | if (!empty($headers)) { 38 | if (preg_match('/Bearer\s(\S+)/', $headers, $matches)) { 39 | return $matches[1]; 40 | } 41 | return null; 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /app/Models/CheckImage.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/errors/html/production.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/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /ci.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohit-chouhan/crudigniter/634223a2602b71f3b8b06636b538b25d41793889/ci.jpg -------------------------------------------------------------------------------- /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.3||^8.0", 9 | "ext-curl": "*", 10 | "ext-intl": "*", 11 | "ext-json": "*", 12 | "ext-mbstring": "*", 13 | "kint-php/kint": "^3.3", 14 | "laminas/laminas-escaper": "^2.6", 15 | "psr/log": "^1.1" 16 | }, 17 | "require-dev": { 18 | "codeigniter4/codeigniter4-standard": "^1.0", 19 | "fakerphp/faker": "^1.9", 20 | "mikey179/vfsstream": "^1.6", 21 | "phpunit/phpunit": "^9.1", 22 | "predis/predis": "^1.1", 23 | "squizlabs/php_codesniffer": "^3.3" 24 | }, 25 | "suggest": { 26 | "ext-fileinfo": "Improves mime type detection for files" 27 | }, 28 | "autoload": { 29 | "psr-4": { 30 | "CodeIgniter\\": "system/" 31 | }, 32 | "exclude-from-classmap": [ 33 | "**/Database/Migrations/**" 34 | ] 35 | }, 36 | "scripts": { 37 | "post-update-cmd": [ 38 | "CodeIgniter\\ComposerScripts::postUpdate" 39 | ], 40 | "test": "phpunit" 41 | }, 42 | "support": { 43 | "forum": "http://forum.codeigniter.com/", 44 | "source": "https://github.com/codeigniter4/CodeIgniter4", 45 | "slack": "https://codeigniterchat.slack.com" 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /crud-working.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohit-chouhan/crudigniter/634223a2602b71f3b8b06636b538b25d41793889/crud-working.png -------------------------------------------------------------------------------- /env: -------------------------------------------------------------------------------- 1 | # Do not delete this file, this file name always be (.env) 2 | 3 | CI_ENVIRONMENT = production 4 | #CI_ENVIRONMENT = development 5 | 6 | # run it always in producation mode when its ready to deploy 7 | 8 | #-------------------------------------------------------------------- 9 | # CRDUIGNITER CONFIGRATION 10 | #-------------------------------------------------------------------- 11 | 12 | #-------------------------------------------------------------------- 13 | # Your Website Domain Nain 14 | app.baseURL = 'http://example.com' 15 | #-------------------------------------------------------------------- 16 | 17 | 18 | #-------------------------------------------------------------------- 19 | # Subdomain Configuration 20 | SUB_DOMAIN_ENABLE = 1 21 | SUB_DOMAIN = 'api' 22 | 23 | # If SUB_DOMAIN_ENABLE=0, so your domain will example.com 24 | # If SUB_DOMAIN_ENABLE=1, so your domain will api.example.com 25 | #-------------------------------------------------------------------- 26 | 27 | #-------------------------------------------------------------------- 28 | # Security Configuration (Header Autorization) 29 | SECURITY_CONFIG = 0 30 | TOKEN_KEY = '1234' 31 | 32 | 33 | # if SECURITY_CONFIG is 1 thats mean its true, you have to auth TOKEN_KEY as Bearer token everytime 34 | # if SECURITY_CONFIG is 0 thats mean its false, it will work normally, so just ignore it. 35 | #-------------------------------------------------------------------- 36 | 37 | #-------------------------------------------------------------------- 38 | # DATABASE 39 | #-------------------------------------------------------------------- 40 | 41 | database.default.hostname = your_hostname 42 | database.default.database = your_database_name 43 | database.default.username = your_host/db_username 44 | database.default.password = your_host/db_password 45 | database.default.DBDriver = MySQLi 46 | 47 | 48 | -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohit-chouhan/crudigniter/634223a2602b71f3b8b06636b538b25d41793889/favicon.ico -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | systemDirectory, '\\/ ') . DIRECTORY_SEPARATOR . 'bootstrap.php'; 28 | $app = require realpath($bootstrap) ?: $bootstrap; 29 | 30 | /* 31 | *--------------------------------------------------------------- 32 | * LAUNCH THE APPLICATION 33 | *--------------------------------------------------------------- 34 | * Now that everything is setup, it's time to actually fire 35 | * up the engines and make this app do its thang. 36 | */ 37 | $app->run(); 38 | -------------------------------------------------------------------------------- /joins-working.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohit-chouhan/crudigniter/634223a2602b71f3b8b06636b538b25d41793889/joins-working.jpg -------------------------------------------------------------------------------- /robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /system/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | Require all denied 3 | 4 | 5 | Deny from all 6 | 7 | -------------------------------------------------------------------------------- /system/CLI/CommandRunner.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\CLI; 13 | 14 | use CodeIgniter\Controller; 15 | use Config\Services; 16 | use ReflectionException; 17 | 18 | /** 19 | * Command runner 20 | */ 21 | class CommandRunner extends Controller 22 | { 23 | /** 24 | * Instance of class managing the collection of commands 25 | * 26 | * @var Commands 27 | */ 28 | protected $commands; 29 | 30 | /** 31 | * Constructor 32 | */ 33 | public function __construct() 34 | { 35 | $this->commands = Services::commands(); 36 | } 37 | 38 | /** 39 | * We map all un-routed CLI methods through this function 40 | * so we have the chance to look for a Command first. 41 | * 42 | * @param string $method 43 | * @param array ...$params 44 | * 45 | * @return mixed 46 | * @throws ReflectionException 47 | */ 48 | public function _remap($method, ...$params) 49 | { 50 | // The first param is usually empty, so scrap it. 51 | if (empty($params[0])) 52 | { 53 | array_shift($params); 54 | } 55 | 56 | return $this->index($params); 57 | } 58 | 59 | /** 60 | * Default command. 61 | * 62 | * @param array $params 63 | * 64 | * @return mixed 65 | * @throws ReflectionException 66 | */ 67 | public function index(array $params) 68 | { 69 | $command = array_shift($params) ?? 'list'; 70 | 71 | return $this->commands->run($command, $params); 72 | } 73 | 74 | /** 75 | * Allows access to the current commands that have been found. 76 | * 77 | * @return array 78 | */ 79 | public function getCommands(): array 80 | { 81 | return $this->commands->getCommands(); 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /system/CLI/Exceptions/CLIException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\CLI\Exceptions; 13 | 14 | use CodeIgniter\Exceptions\DebugTraceableTrait; 15 | use RuntimeException; 16 | 17 | /** 18 | * CLIException 19 | */ 20 | class CLIException extends RuntimeException 21 | { 22 | use DebugTraceableTrait; 23 | 24 | /** 25 | * Thrown when `$color` specified for `$type` is not within the 26 | * allowed list of colors. 27 | * 28 | * @param string $type 29 | * @param string $color 30 | * 31 | * @return CLIException 32 | */ 33 | public static function forInvalidColor(string $type, string $color) 34 | { 35 | return new static(lang('CLI.invalidColor', [$type, $color])); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /system/Cache/Exceptions/CacheException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Cache\Exceptions; 13 | 14 | use CodeIgniter\Exceptions\DebugTraceableTrait; 15 | use CodeIgniter\Exceptions\ExceptionInterface; 16 | use RuntimeException; 17 | 18 | /** 19 | * CacheException 20 | */ 21 | class CacheException extends RuntimeException implements ExceptionInterface 22 | { 23 | use DebugTraceableTrait; 24 | 25 | /** 26 | * Thrown when handler has no permission to write cache. 27 | * 28 | * @param string $path 29 | * 30 | * @return CacheException 31 | */ 32 | public static function forUnableToWrite(string $path) 33 | { 34 | return new static(lang('Cache.unableToWrite', [$path])); 35 | } 36 | 37 | /** 38 | * Thrown when an unrecognized handler is used. 39 | * 40 | * @return CacheException 41 | */ 42 | public static function forInvalidHandlers() 43 | { 44 | return new static(lang('Cache.invalidHandlers')); 45 | } 46 | 47 | /** 48 | * Thrown when no backup handler is setup in config. 49 | * 50 | * @return CacheException 51 | */ 52 | public static function forNoBackup() 53 | { 54 | return new static(lang('Cache.noBackup')); 55 | } 56 | 57 | /** 58 | * Thrown when specified handler was not found. 59 | * 60 | * @return CacheException 61 | */ 62 | public static function forHandlerNotFound() 63 | { 64 | return new static(lang('Cache.handlerNotFound')); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /system/Cache/Exceptions/ExceptionInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Cache\Exceptions; 13 | 14 | /** 15 | * Provides a domain-level interface for broad capture 16 | * of all framework-related exceptions. 17 | * 18 | * catch (\CodeIgniter\Cache\Exceptions\ExceptionInterface) { ... } 19 | * 20 | * @deprecated 4.1.2 21 | */ 22 | interface ExceptionInterface 23 | { 24 | } 25 | -------------------------------------------------------------------------------- /system/Commands/Generators/Views/command.tpl.php: -------------------------------------------------------------------------------- 1 | <@php 2 | 3 | namespace {namespace}; 4 | 5 | use CodeIgniter\CLI\BaseCommand; 6 | use CodeIgniter\CLI\CLI; 7 | 8 | use CodeIgniter\CLI\GeneratorTrait; 9 | 10 | 11 | class {class} extends BaseCommand 12 | { 13 | 14 | use GeneratorTrait; 15 | 16 | 17 | /** 18 | * The Command's Group 19 | * 20 | * @var string 21 | */ 22 | protected $group = '{group}'; 23 | 24 | /** 25 | * The Command's Name 26 | * 27 | * @var string 28 | */ 29 | protected $name = '{command}'; 30 | 31 | /** 32 | * The Command's Description 33 | * 34 | * @var string 35 | */ 36 | protected $description = ''; 37 | 38 | /** 39 | * The Command's Usage 40 | * 41 | * @var string 42 | */ 43 | protected $usage = '{command} [arguments] [options]'; 44 | 45 | /** 46 | * The Command's Arguments 47 | * 48 | * @var array 49 | */ 50 | protected $arguments = []; 51 | 52 | /** 53 | * The Command's Options 54 | * 55 | * @var array 56 | */ 57 | protected $options = []; 58 | 59 | /** 60 | * Actually execute a command. 61 | * 62 | * @param array $params 63 | */ 64 | public function run(array $params) 65 | { 66 | 67 | $this->component = 'Command'; 68 | $this->directory = 'Commands'; 69 | $this->template = 'command.tpl.php'; 70 | 71 | $this->execute($params); 72 | 73 | // 74 | 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /system/Commands/Generators/Views/config.tpl.php: -------------------------------------------------------------------------------- 1 | <@php 2 | 3 | namespace {namespace}; 4 | 5 | use CodeIgniter\Config\BaseConfig; 6 | 7 | class {class} extends BaseConfig 8 | { 9 | // 10 | } 11 | -------------------------------------------------------------------------------- /system/Commands/Generators/Views/entity.tpl.php: -------------------------------------------------------------------------------- 1 | <@php 2 | 3 | namespace {namespace}; 4 | 5 | use CodeIgniter\Entity\Entity; 6 | 7 | class {class} extends Entity 8 | { 9 | protected $datamap = []; 10 | protected $dates = [ 11 | 'created_at', 12 | 'updated_at', 13 | 'deleted_at', 14 | ]; 15 | protected $casts = []; 16 | } 17 | -------------------------------------------------------------------------------- /system/Commands/Generators/Views/filter.tpl.php: -------------------------------------------------------------------------------- 1 | <@php 2 | 3 | namespace {namespace}; 4 | 5 | use CodeIgniter\Filters\FilterInterface; 6 | use CodeIgniter\HTTP\RequestInterface; 7 | use CodeIgniter\HTTP\ResponseInterface; 8 | 9 | class {class} implements FilterInterface 10 | { 11 | /** 12 | * Do whatever processing this filter needs to do. 13 | * By default it should not return anything during 14 | * normal execution. However, when an abnormal state 15 | * is found, it should return an instance of 16 | * CodeIgniter\HTTP\Response. If it does, script 17 | * execution will end and that Response will be 18 | * sent back to the client, allowing for error pages, 19 | * redirects, etc. 20 | * 21 | * @param RequestInterface $request 22 | * @param array|null $arguments 23 | * 24 | * @return mixed 25 | */ 26 | public function before(RequestInterface $request, $arguments = null) 27 | { 28 | // 29 | } 30 | 31 | /** 32 | * Allows After filters to inspect and modify the response 33 | * object as needed. This method does not allow any way 34 | * to stop execution of other after filters, short of 35 | * throwing an Exception or Error. 36 | * 37 | * @param RequestInterface $request 38 | * @param ResponseInterface $response 39 | * @param array|null $arguments 40 | * 41 | * @return mixed 42 | */ 43 | public function after(RequestInterface $request, ResponseInterface $response, $arguments = null) 44 | { 45 | // 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /system/Commands/Generators/Views/migration.tpl.php: -------------------------------------------------------------------------------- 1 | <@php 2 | 3 | namespace {namespace}; 4 | 5 | use CodeIgniter\Database\Migration; 6 | 7 | class {class} extends Migration 8 | { 9 | 10 | protected $DBGroup = ''; 11 | 12 | public function up() 13 | { 14 | $this->forge->addField([ 15 | 'id' => ['type' => 'VARCHAR', 'constraint' => 128, 'null' => false], 16 | 'ip_address' => ['type' => 'VARCHAR', 'constraint' => 45, 'null' => false], 17 | 'timestamp' => ['type' => 'INT', 'unsigned' => true, 'null' => false, 'default' => 0], 18 | 'data' => ['type' => 'TEXT', 'null' => false, 'default' => ''], 19 | ]); 20 | 21 | $this->forge->addKey(['id', 'ip_address'], true); 22 | 23 | $this->forge->addKey('id', true); 24 | 25 | $this->forge->addKey('timestamp'); 26 | $this->forge->createTable('', true); 27 | } 28 | 29 | public function down() 30 | { 31 | $this->forge->dropTable('', true); 32 | } 33 | 34 | public function up() 35 | { 36 | // 37 | } 38 | 39 | public function down() 40 | { 41 | // 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /system/Commands/Generators/Views/model.tpl.php: -------------------------------------------------------------------------------- 1 | <@php 2 | 3 | namespace {namespace}; 4 | 5 | use CodeIgniter\Model; 6 | 7 | class {class} extends Model 8 | { 9 | protected $DBGroup = '{DBGroup}'; 10 | protected $table = '{table}'; 11 | protected $primaryKey = 'id'; 12 | protected $useAutoIncrement = true; 13 | protected $insertID = 0; 14 | protected $returnType = '{return}'; 15 | protected $useSoftDeletes = false; 16 | protected $protectFields = true; 17 | protected $allowedFields = []; 18 | 19 | // Dates 20 | protected $useTimestamps = false; 21 | protected $dateFormat = 'datetime'; 22 | protected $createdField = 'created_at'; 23 | protected $updatedField = 'updated_at'; 24 | protected $deletedField = 'deleted_at'; 25 | 26 | // Validation 27 | protected $validationRules = []; 28 | protected $validationMessages = []; 29 | protected $skipValidation = false; 30 | protected $cleanValidationRules = true; 31 | 32 | // Callbacks 33 | protected $allowCallbacks = true; 34 | protected $beforeInsert = []; 35 | protected $afterInsert = []; 36 | protected $beforeUpdate = []; 37 | protected $afterUpdate = []; 38 | protected $beforeFind = []; 39 | protected $afterFind = []; 40 | protected $beforeDelete = []; 41 | protected $afterDelete = []; 42 | } 43 | -------------------------------------------------------------------------------- /system/Commands/Generators/Views/seeder.tpl.php: -------------------------------------------------------------------------------- 1 | <@php 2 | 3 | namespace {namespace}; 4 | 5 | use CodeIgniter\Database\Seeder; 6 | 7 | class {class} extends Seeder 8 | { 9 | public function run() 10 | { 11 | // 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /system/Commands/Generators/Views/validation.tpl.php: -------------------------------------------------------------------------------- 1 | <@php 2 | 3 | namespace {namespace}; 4 | 5 | class {class} 6 | { 7 | // public function custom_rule(): bool 8 | // { 9 | // return true; 10 | // } 11 | } 12 | -------------------------------------------------------------------------------- /system/Commands/Housekeeping/ClearDebugbar.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Commands\Housekeeping; 13 | 14 | use CodeIgniter\CLI\BaseCommand; 15 | use CodeIgniter\CLI\CLI; 16 | 17 | /** 18 | * ClearDebugbar Command 19 | */ 20 | class ClearDebugbar extends BaseCommand 21 | { 22 | /** 23 | * The group the command is lumped under 24 | * when listing commands. 25 | * 26 | * @var string 27 | */ 28 | protected $group = 'Housekeeping'; 29 | 30 | /** 31 | * The Command's name 32 | * 33 | * @var string 34 | */ 35 | protected $name = 'debugbar:clear'; 36 | 37 | /** 38 | * The Command's usage 39 | * 40 | * @var string 41 | */ 42 | protected $usage = 'debugbar:clear'; 43 | 44 | /** 45 | * The Command's short description. 46 | * 47 | * @var string 48 | */ 49 | protected $description = 'Clears all debugbar JSON files.'; 50 | 51 | /** 52 | * Actually runs the command. 53 | * 54 | * @param array $params 55 | * 56 | * @return void 57 | */ 58 | public function run(array $params) 59 | { 60 | helper('filesystem'); 61 | 62 | if (! delete_files(WRITEPATH . 'debugbar')) 63 | { 64 | // @codeCoverageIgnoreStart 65 | CLI::error('Error deleting the debugbar JSON files.'); 66 | CLI::newLine(); 67 | return; 68 | // @codeCoverageIgnoreEnd 69 | } 70 | 71 | CLI::write('Debugbar cleared.', 'green'); 72 | CLI::newLine(); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /system/Commands/Server/rewrite.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | /* 13 | * CodeIgniter PHP-Development Server Rewrite Rules 14 | * 15 | * This script works with the CLI serve command to help run a seamless 16 | * development server based around PHP's built-in development 17 | * server. This file simply tries to mimic Apache's mod_rewrite 18 | * functionality so the site will operate as normal. 19 | */ 20 | 21 | // @codeCoverageIgnoreStart 22 | // Avoid this file run when listing commands 23 | if (PHP_SAPI === 'cli') 24 | { 25 | return; 26 | } 27 | 28 | $uri = urldecode(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)); 29 | 30 | // Front Controller path - expected to be in the default folder 31 | $fcpath = $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR; 32 | 33 | // Full path 34 | $path = $fcpath . ltrim($uri, '/'); 35 | 36 | // If $path is an existing file or folder within the public folder 37 | // then let the request handle it like normal. 38 | if ($uri !== '/' && (is_file($path) || is_dir($path))) 39 | { 40 | return false; 41 | } 42 | 43 | // Otherwise, we'll load the index file and let 44 | // the framework handle the request from here. 45 | require_once $fcpath . 'index.php'; 46 | // @codeCoverageIgnoreEnd 47 | -------------------------------------------------------------------------------- /system/Config/Config.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Config; 13 | 14 | /** 15 | * Class Config 16 | * 17 | * @deprecated Use CodeIgniter\Config\Factories::config() 18 | */ 19 | class Config 20 | { 21 | /** 22 | * Create new configuration instances or return 23 | * a shared instance 24 | * 25 | * @param string $name Configuration name 26 | * @param boolean $getShared Use shared instance 27 | * 28 | * @return mixed|null 29 | */ 30 | public static function get(string $name, bool $getShared = true) 31 | { 32 | return Factories::config($name, ['getShared' => $getShared]); 33 | } 34 | 35 | /** 36 | * Helper method for injecting mock instances while testing. 37 | * 38 | * @param string $name 39 | * @param object $instance 40 | */ 41 | public static function injectMock(string $name, $instance) 42 | { 43 | Factories::injectMock('config', $name, $instance); 44 | } 45 | 46 | /** 47 | * Resets the static arrays 48 | */ 49 | public static function reset() 50 | { 51 | Factories::reset('config'); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /system/Config/Factory.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Config; 13 | 14 | /** 15 | * Factories Configuration file. 16 | * 17 | * Provides overriding directives for how 18 | * Factories should handle discovery and 19 | * instantiation of specific components. 20 | * Each property should correspond to the 21 | * lowercase, plural component name. 22 | */ 23 | class Factory extends BaseConfig 24 | { 25 | /** 26 | * Supplies a default set of options to merge for 27 | * all unspecified factory components. 28 | * 29 | * @var array 30 | */ 31 | public static $default = [ 32 | 'component' => null, 33 | 'path' => null, 34 | 'instanceOf' => null, 35 | 'getShared' => true, 36 | 'preferApp' => true, 37 | ]; 38 | 39 | /** 40 | * Specifies that Models should always favor child 41 | * classes to allow easy extension of module Models. 42 | * 43 | * @var array 44 | */ 45 | public $models = [ 46 | 'preferApp' => true, 47 | ]; 48 | } 49 | -------------------------------------------------------------------------------- /system/Config/Routes.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | use CodeIgniter\Exceptions\PageNotFoundException; 13 | 14 | /** 15 | * System URI Routing 16 | * 17 | * This file contains any routing to system tools, such as command-line 18 | * tools for migrations, etc. 19 | * 20 | * It is called by Config\Routes, and has the $routes RouteCollection 21 | * already loaded up and ready for us to use. 22 | */ 23 | 24 | // Prevent access to BaseController 25 | $routes->add('BaseController(:any)', function () { 26 | throw PageNotFoundException::forPageNotFound(); 27 | }); 28 | 29 | // Prevent access to initController method 30 | $routes->add('(:any)/initController', function () { 31 | throw PageNotFoundException::forPageNotFound(); 32 | }); 33 | 34 | // Migrations 35 | $routes->cli('migrations/(:segment)/(:segment)', '\CodeIgniter\Commands\MigrationsCommand::$1/$2'); 36 | $routes->cli('migrations/(:segment)', '\CodeIgniter\Commands\MigrationsCommand::$1'); 37 | $routes->cli('migrations', '\CodeIgniter\Commands\MigrationsCommand::index'); 38 | 39 | // CLI Catchall - uses a _remap to call Commands 40 | $routes->cli('ci(:any)', '\CodeIgniter\CLI\CommandRunner::index/$1'); 41 | -------------------------------------------------------------------------------- /system/Database/Exceptions/DatabaseException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Database\Exceptions; 13 | 14 | use Error; 15 | 16 | class DatabaseException extends Error implements ExceptionInterface 17 | { 18 | /** 19 | * Exit status code 20 | * 21 | * @var integer 22 | */ 23 | protected $code = 8; 24 | } 25 | -------------------------------------------------------------------------------- /system/Database/Exceptions/ExceptionInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Database\Exceptions; 13 | 14 | /** 15 | * Provides a domain-level interface for broad capture 16 | * of all database-related exceptions. 17 | * 18 | * catch (\CodeIgniter\Database\Exceptions\ExceptionInterface) { ... } 19 | */ 20 | interface ExceptionInterface extends \CodeIgniter\Exceptions\ExceptionInterface 21 | { 22 | } 23 | -------------------------------------------------------------------------------- /system/Database/ModelFactory.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Database; 13 | 14 | use CodeIgniter\Config\Factories; 15 | 16 | /** 17 | * Returns new or shared Model instances 18 | * 19 | * @deprecated Use CodeIgniter\Config\Factories::models() 20 | * 21 | * @codeCoverageIgnore 22 | */ 23 | class ModelFactory 24 | { 25 | /** 26 | * Creates new Model instances or returns a shared instance 27 | * 28 | * @param string $name Model name, namespace optional 29 | * @param boolean $getShared Use shared instance 30 | * @param ConnectionInterface $connection 31 | * 32 | * @return mixed|null 33 | */ 34 | public static function get(string $name, bool $getShared = true, ConnectionInterface $connection = null) 35 | { 36 | return Factories::models($name, ['getShared' => $getShared], $connection); 37 | } 38 | 39 | /** 40 | * Helper method for injecting mock instances while testing. 41 | * 42 | * @param string $name 43 | * @param object $instance 44 | */ 45 | public static function injectMock(string $name, $instance) 46 | { 47 | Factories::injectMock('models', $name, $instance); 48 | } 49 | 50 | /** 51 | * Resets the static arrays 52 | */ 53 | public static function reset() 54 | { 55 | Factories::reset('models'); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /system/Database/MySQLi/Builder.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Database\MySQLi; 13 | 14 | use CodeIgniter\Database\BaseBuilder; 15 | 16 | /** 17 | * Builder for MySQLi 18 | */ 19 | class Builder extends BaseBuilder 20 | { 21 | /** 22 | * Identifier escape character 23 | * 24 | * @var string 25 | */ 26 | protected $escapeChar = '`'; 27 | 28 | /** 29 | * Specifies which sql statements 30 | * support the ignore option. 31 | * 32 | * @var array 33 | */ 34 | protected $supportedIgnoreStatements = [ 35 | 'update' => 'IGNORE', 36 | 'insert' => 'IGNORE', 37 | 'delete' => 'IGNORE', 38 | ]; 39 | 40 | /** 41 | * FROM tables 42 | * 43 | * Groups tables in FROM clauses if needed, so there is no confusion 44 | * about operator precedence. 45 | * 46 | * Note: This is only used (and overridden) by MySQL. 47 | * 48 | * @return string 49 | */ 50 | protected function _fromTables(): string 51 | { 52 | if (! empty($this->QBJoin) && count($this->QBFrom) > 1) 53 | { 54 | return '(' . implode(', ', $this->QBFrom) . ')'; 55 | } 56 | 57 | return implode(', ', $this->QBFrom); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /system/Database/MySQLi/Utils.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Database\MySQLi; 13 | 14 | use CodeIgniter\Database\BaseUtils; 15 | use CodeIgniter\Database\Exceptions\DatabaseException; 16 | 17 | /** 18 | * Utils for MySQLi 19 | */ 20 | class Utils extends BaseUtils 21 | { 22 | /** 23 | * List databases statement 24 | * 25 | * @var string 26 | */ 27 | protected $listDatabases = 'SHOW DATABASES'; 28 | 29 | /** 30 | * OPTIMIZE TABLE statement 31 | * 32 | * @var string 33 | */ 34 | protected $optimizeTable = 'OPTIMIZE TABLE %s'; 35 | 36 | //-------------------------------------------------------------------- 37 | 38 | /** 39 | * Platform dependent version of the backup function. 40 | * 41 | * @param array|null $prefs 42 | * 43 | * @return mixed 44 | */ 45 | public function _backup(array $prefs = null) 46 | { 47 | throw new DatabaseException('Unsupported feature of the database platform you are using.'); 48 | } 49 | 50 | //-------------------------------------------------------------------- 51 | } 52 | -------------------------------------------------------------------------------- /system/Database/Postgre/Utils.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Database\Postgre; 13 | 14 | use CodeIgniter\Database\BaseUtils; 15 | use CodeIgniter\Database\Exceptions\DatabaseException; 16 | 17 | /** 18 | * Utils for Postgre 19 | */ 20 | class Utils extends BaseUtils 21 | { 22 | /** 23 | * List databases statement 24 | * 25 | * @var string 26 | */ 27 | protected $listDatabases = 'SELECT datname FROM pg_database'; 28 | 29 | /** 30 | * OPTIMIZE TABLE statement 31 | * 32 | * @var string 33 | */ 34 | protected $optimizeTable = 'REINDEX TABLE %s'; 35 | 36 | //-------------------------------------------------------------------- 37 | 38 | /** 39 | * Platform dependent version of the backup function. 40 | * 41 | * @param array|null $prefs 42 | * 43 | * @return mixed 44 | */ 45 | public function _backup(array $prefs = null) 46 | { 47 | throw new DatabaseException('Unsupported feature of the database platform you are using.'); 48 | } 49 | 50 | //-------------------------------------------------------------------- 51 | } 52 | -------------------------------------------------------------------------------- /system/Database/SQLSRV/Utils.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Database\SQLSRV; 13 | 14 | use CodeIgniter\Database\BaseUtils; 15 | use CodeIgniter\Database\Exceptions\DatabaseException; 16 | 17 | /** 18 | * Utils for SQLSRV 19 | */ 20 | class Utils extends BaseUtils 21 | { 22 | /** 23 | * List databases statement 24 | * 25 | * @var string 26 | */ 27 | protected $listDatabases = 'EXEC sp_helpdb'; // Can also be: EXEC sp_databases 28 | 29 | /** 30 | * OPTIMIZE TABLE statement 31 | * 32 | * @var string 33 | */ 34 | protected $optimizeTable = 'ALTER INDEX all ON %s REORGANIZE'; 35 | 36 | //-------------------------------------------------------------------- 37 | 38 | /** 39 | * Platform dependent version of the backup function. 40 | * 41 | * @param array|null $prefs 42 | * 43 | * @return mixed 44 | */ 45 | public function _backup(array $prefs = null) 46 | { 47 | throw new DatabaseException('Unsupported feature of the database platform you are using.'); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /system/Database/SQLite3/Utils.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Database\SQLite3; 13 | 14 | use CodeIgniter\Database\BaseUtils; 15 | use CodeIgniter\Database\Exceptions\DatabaseException; 16 | 17 | /** 18 | * Utils for SQLite3 19 | */ 20 | class Utils extends BaseUtils 21 | { 22 | /** 23 | * OPTIMIZE TABLE statement 24 | * 25 | * @var string 26 | */ 27 | protected $optimizeTable = 'REINDEX %s'; 28 | 29 | //-------------------------------------------------------------------- 30 | 31 | /** 32 | * Platform dependent version of the backup function. 33 | * 34 | * @param array|null $prefs 35 | * 36 | * @return mixed 37 | */ 38 | public function _backup(array $prefs = null) 39 | { 40 | throw new DatabaseException('Unsupported feature of the database platform you are using.'); 41 | } 42 | 43 | //-------------------------------------------------------------------- 44 | } 45 | -------------------------------------------------------------------------------- /system/Debug/Toolbar/Collectors/Config.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Debug\Toolbar\Collectors; 13 | 14 | use CodeIgniter\CodeIgniter; 15 | use Config\App; 16 | use Config\Services; 17 | 18 | /** 19 | * Debug toolbar configuration 20 | */ 21 | class Config 22 | { 23 | /** 24 | * Return toolbar config values as an array. 25 | * 26 | * @return array 27 | */ 28 | public static function display(): array 29 | { 30 | $config = config(App::class); 31 | 32 | return [ 33 | 'ciVersion' => CodeIgniter::CI_VERSION, 34 | 'phpVersion' => phpversion(), 35 | 'phpSAPI' => php_sapi_name(), 36 | 'environment' => ENVIRONMENT, 37 | 'baseURL' => $config->baseURL, 38 | 'timezone' => app_timezone(), 39 | 'locale' => Services::request()->getLocale(), 40 | 'cspEnabled' => $config->CSPEnabled, 41 | ]; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /system/Debug/Toolbar/Collectors/Timers.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Debug\Toolbar\Collectors; 13 | 14 | use Config\Services; 15 | 16 | /** 17 | * Timers collector 18 | */ 19 | class Timers extends BaseCollector 20 | { 21 | /** 22 | * Whether this collector has data that can 23 | * be displayed in the Timeline. 24 | * 25 | * @var boolean 26 | */ 27 | protected $hasTimeline = true; 28 | 29 | /** 30 | * Whether this collector needs to display 31 | * content in a tab or not. 32 | * 33 | * @var boolean 34 | */ 35 | protected $hasTabContent = false; 36 | 37 | /** 38 | * The 'title' of this Collector. 39 | * Used to name things in the toolbar HTML. 40 | * 41 | * @var string 42 | */ 43 | protected $title = 'Timers'; 44 | 45 | //-------------------------------------------------------------------- 46 | 47 | /** 48 | * Child classes should implement this to return the timeline data 49 | * formatted for correct usage. 50 | * 51 | * @return array 52 | */ 53 | protected function formatTimelineData(): array 54 | { 55 | $data = []; 56 | 57 | $benchmark = Services::timer(true); 58 | $rows = $benchmark->getTimers(6); 59 | 60 | foreach ($rows as $name => $info) 61 | { 62 | if ($name === 'total_execution') 63 | { 64 | continue; 65 | } 66 | 67 | $data[] = [ 68 | 'name' => ucwords(str_replace('_', ' ', $name)), 69 | 'component' => 'Timer', 70 | 'start' => $info['start'], 71 | 'duration' => $info['end'] - $info['start'], 72 | ]; 73 | } 74 | 75 | return $data; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /system/Debug/Toolbar/Views/_config.tpl: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /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/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/Debug/Toolbar/Views/_files.tpl: -------------------------------------------------------------------------------- 1 | 2 | 3 | {userFiles} 4 | 5 | 6 | 7 | 8 | {/userFiles} 9 | {coreFiles} 10 | 11 | 12 | 13 | 14 | {/coreFiles} 15 | 16 |
{name}{path}
{name}{path}
17 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | {routes} 45 | 46 | 47 | 48 | 49 | 50 | {/routes} 51 | 52 |
MethodRouteHandler
{method}{route}{handler}
53 | -------------------------------------------------------------------------------- /system/Encryption/EncrypterInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Encryption; 13 | 14 | use CodeIgniter\Encryption\Exceptions\EncryptionException; 15 | 16 | /** 17 | * CodeIgniter Encryption Handler 18 | * 19 | * Provides two-way keyed encryption 20 | */ 21 | interface EncrypterInterface 22 | { 23 | /** 24 | * Encrypt - convert plaintext into ciphertext 25 | * 26 | * @param string $data Input data 27 | * @param array|string|null $params Overridden parameters, specifically the key 28 | * 29 | * @throws EncryptionException 30 | * 31 | * @return string 32 | */ 33 | public function encrypt($data, $params = null); 34 | 35 | /** 36 | * Decrypt - convert ciphertext into plaintext 37 | * 38 | * @param string $data Encrypted data 39 | * @param array|string|null $params Overridden parameters, specifically the key 40 | * 41 | * @throws EncryptionException 42 | * 43 | * @return string 44 | */ 45 | public function decrypt($data, $params = null); 46 | } 47 | -------------------------------------------------------------------------------- /system/Entity.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter; 13 | 14 | use CodeIgniter\Entity\Entity as CoreEntity; 15 | 16 | /** 17 | * Entity encapsulation, for use with CodeIgniter\Model 18 | * 19 | * @deprecated use CodeIgniter\Entity\Entity class instead 20 | */ 21 | class Entity extends CoreEntity 22 | { 23 | } 24 | -------------------------------------------------------------------------------- /system/Entity/Cast/ArrayCast.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Entity\Cast; 13 | 14 | /** 15 | * Class ArrayCast 16 | */ 17 | class ArrayCast extends BaseCast 18 | { 19 | /** 20 | * @inheritDoc 21 | */ 22 | public static function get($value, array $params = []): array 23 | { 24 | if (is_string($value) && (strpos($value, 'a:') === 0 || strpos($value, 's:') === 0)) 25 | { 26 | $value = unserialize($value); 27 | } 28 | 29 | return (array) $value; 30 | } 31 | 32 | /** 33 | * @inheritDoc 34 | */ 35 | public static function set($value, array $params = []): string 36 | { 37 | return serialize($value); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /system/Entity/Cast/BaseCast.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Entity\Cast; 13 | 14 | /** 15 | * Class BaseCast 16 | */ 17 | abstract class BaseCast implements CastInterface 18 | { 19 | /** 20 | * Get 21 | * 22 | * @param mixed $value Data 23 | * @param array $params Additional param 24 | * 25 | * @return mixed 26 | */ 27 | public static function get($value, array $params = []) 28 | { 29 | return $value; 30 | } 31 | 32 | /** 33 | * Set 34 | * 35 | * @param mixed $value Data 36 | * @param array $params Additional param 37 | * 38 | * @return mixed 39 | */ 40 | public static function set($value, array $params = []) 41 | { 42 | return $value; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /system/Entity/Cast/BooleanCast.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Entity\Cast; 13 | 14 | /** 15 | * Class BooleanCast 16 | */ 17 | class BooleanCast extends BaseCast 18 | { 19 | /** 20 | * @inheritDoc 21 | */ 22 | public static function get($value, array $params = []): bool 23 | { 24 | return (bool) $value; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /system/Entity/Cast/CSVCast.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Entity\Cast; 13 | 14 | /** 15 | * Class CSVCast 16 | */ 17 | class CSVCast extends BaseCast 18 | { 19 | /** 20 | * @inheritDoc 21 | */ 22 | public static function get($value, array $params = []): array 23 | { 24 | return explode(',', $value); 25 | } 26 | 27 | /** 28 | * @inheritDoc 29 | */ 30 | public static function set($value, array $params = []): string 31 | { 32 | return implode(',', $value); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /system/Entity/Cast/CastInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Entity\Cast; 13 | 14 | /** 15 | * Interface CastInterface 16 | */ 17 | interface CastInterface 18 | { 19 | /** 20 | * Get 21 | * 22 | * @param mixed $value Data 23 | * @param array $params Additional param 24 | * 25 | * @return mixed 26 | */ 27 | public static function get($value, array $params = []); 28 | 29 | /** 30 | * Set 31 | * 32 | * @param mixed $value Data 33 | * @param array $params Additional param 34 | * 35 | * @return mixed 36 | */ 37 | public static function set($value, array $params = []); 38 | } 39 | -------------------------------------------------------------------------------- /system/Entity/Cast/DatetimeCast.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Entity\Cast; 13 | 14 | use CodeIgniter\I18n\Time; 15 | use DateTime; 16 | use Exception; 17 | 18 | /** 19 | * Class DatetimeCast 20 | */ 21 | class DatetimeCast extends BaseCast 22 | { 23 | /** 24 | * @inheritDoc 25 | * 26 | * @throws Exception 27 | */ 28 | public static function get($value, array $params = []) 29 | { 30 | if ($value instanceof Time) 31 | { 32 | return $value; 33 | } 34 | 35 | if ($value instanceof DateTime) 36 | { 37 | return Time::instance($value); 38 | } 39 | 40 | if (is_numeric($value)) 41 | { 42 | return Time::createFromTimestamp($value); 43 | } 44 | 45 | if (is_string($value)) 46 | { 47 | return Time::parse($value); 48 | } 49 | 50 | return $value; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /system/Entity/Cast/FloatCast.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Entity\Cast; 13 | 14 | /** 15 | * Class FloatCast 16 | */ 17 | class FloatCast extends BaseCast 18 | { 19 | /** 20 | * @inheritDoc 21 | */ 22 | public static function get($value, array $params = []): float 23 | { 24 | return (float) $value; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /system/Entity/Cast/IntegerCast.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Entity\Cast; 13 | 14 | /** 15 | * Class IntegerCast 16 | */ 17 | class IntegerCast extends BaseCast 18 | { 19 | /** 20 | * @inheritDoc 21 | */ 22 | public static function get($value, array $params = []): int 23 | { 24 | return (int) $value; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /system/Entity/Cast/JsonCast.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Entity\Cast; 13 | 14 | use CodeIgniter\Entity\Exceptions\CastException; 15 | use JsonException; 16 | use stdClass; 17 | 18 | /** 19 | * Class JsonCast 20 | */ 21 | class JsonCast extends BaseCast 22 | { 23 | /** 24 | * @inheritDoc 25 | */ 26 | public static function get($value, array $params = []) 27 | { 28 | $associative = in_array('array', $params, true); 29 | $tmp = ! is_null($value) ? ($associative ? [] : new stdClass) : null; 30 | 31 | if (function_exists('json_decode') 32 | && ((is_string($value) 33 | && strlen($value) > 1 34 | && in_array($value[0], ['[', '{', '"'], true)) 35 | || is_numeric($value) 36 | ) 37 | ) 38 | { 39 | try 40 | { 41 | $tmp = json_decode($value, $associative, 512, JSON_THROW_ON_ERROR); 42 | } 43 | catch (JsonException $e) 44 | { 45 | throw CastException::forInvalidJsonFormat($e->getCode()); 46 | } 47 | } 48 | 49 | return $tmp; 50 | } 51 | 52 | /** 53 | * @inheritDoc 54 | */ 55 | public static function set($value, array $params = []): string 56 | { 57 | if (function_exists('json_encode')) 58 | { 59 | try 60 | { 61 | $value = json_encode($value, JSON_UNESCAPED_UNICODE | JSON_THROW_ON_ERROR); 62 | } 63 | catch (JsonException $e) 64 | { 65 | throw CastException::forInvalidJsonFormat($e->getCode()); 66 | } 67 | } 68 | 69 | return $value; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /system/Entity/Cast/ObjectCast.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Entity\Cast; 13 | 14 | /** 15 | * Class ObjectCast 16 | */ 17 | class ObjectCast extends BaseCast 18 | { 19 | /** 20 | * @inheritDoc 21 | */ 22 | public static function get($value, array $params = []): object 23 | { 24 | return (object) $value; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /system/Entity/Cast/StringCast.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Entity\Cast; 13 | 14 | /** 15 | * Class StringCast 16 | */ 17 | class StringCast extends BaseCast 18 | { 19 | /** 20 | * @inheritDoc 21 | */ 22 | public static function get($value, array $params = []): string 23 | { 24 | return (string) $value; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /system/Entity/Cast/TimestampCast.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Entity\Cast; 13 | 14 | use CodeIgniter\Entity\Exceptions\CastException; 15 | 16 | /** 17 | * Class TimestampCast 18 | */ 19 | class TimestampCast extends BaseCast 20 | { 21 | /** 22 | * @inheritDoc 23 | */ 24 | public static function get($value, array $params = []) 25 | { 26 | $value = strtotime($value); 27 | 28 | if ($value === false) 29 | { 30 | throw CastException::forInvalidTimestamp(); 31 | } 32 | 33 | return $value; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /system/Entity/Cast/URICast.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Entity\Cast; 13 | 14 | use CodeIgniter\HTTP\URI; 15 | 16 | /** 17 | * Class URICast 18 | */ 19 | class URICast extends BaseCast 20 | { 21 | /** 22 | * @inheritDoc 23 | */ 24 | public static function get($value, array $params = []): URI 25 | { 26 | return $value instanceof URI ? $value : new URI($value); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /system/Exceptions/AlertError.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Exceptions; 13 | 14 | use Error; 15 | 16 | /** 17 | * Error: Action must be taken immediately (system/db down, etc) 18 | */ 19 | class AlertError extends Error 20 | { 21 | } 22 | -------------------------------------------------------------------------------- /system/Exceptions/CastException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Exceptions; 13 | 14 | /** 15 | * Cast Exceptions. 16 | * 17 | * @deprecated use CodeIgniter\Entity\Exceptions\CastException instead. 18 | * 19 | * @codeCoverageIgnore 20 | */ 21 | class CastException extends CriticalError 22 | { 23 | use DebugTraceableTrait; 24 | 25 | /** 26 | * Error code 27 | * 28 | * @var integer 29 | */ 30 | protected $code = 3; 31 | 32 | public static function forInvalidJsonFormatException(int $error) 33 | { 34 | switch ($error) 35 | { 36 | case JSON_ERROR_DEPTH: 37 | return new static(lang('Cast.jsonErrorDepth')); 38 | case JSON_ERROR_STATE_MISMATCH: 39 | return new static(lang('Cast.jsonErrorStateMismatch')); 40 | case JSON_ERROR_CTRL_CHAR: 41 | return new static(lang('Cast.jsonErrorCtrlChar')); 42 | case JSON_ERROR_SYNTAX: 43 | return new static(lang('Cast.jsonErrorSyntax')); 44 | case JSON_ERROR_UTF8: 45 | return new static(lang('Cast.jsonErrorUtf8')); 46 | default: 47 | return new static(lang('Cast.jsonErrorUnknown')); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /system/Exceptions/ConfigException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Exceptions; 13 | 14 | /** 15 | * Exception for automatic logging. 16 | */ 17 | class ConfigException extends CriticalError 18 | { 19 | use DebugTraceableTrait; 20 | 21 | /** 22 | * Error code 23 | * 24 | * @var integer 25 | */ 26 | protected $code = 3; 27 | 28 | public static function forDisabledMigrations() 29 | { 30 | return new static(lang('Migrations.disabled')); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /system/Exceptions/CriticalError.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Exceptions; 13 | 14 | use Error; 15 | 16 | /** 17 | * Error: Critical conditions, like component unavailable, etc. 18 | */ 19 | class CriticalError extends Error 20 | { 21 | } 22 | -------------------------------------------------------------------------------- /system/Exceptions/DebugTraceableTrait.php: -------------------------------------------------------------------------------- 1 | getTrace()[0]; 28 | 29 | if (isset($trace['class']) && $trace['class'] === static::class) 30 | { 31 | [ 32 | 'line' => $this->line, 33 | 'file' => $this->file, 34 | ] = $trace; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /system/Exceptions/DownloadException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Exceptions; 13 | 14 | use RuntimeException; 15 | 16 | /** 17 | * Class DownloadException 18 | */ 19 | class DownloadException extends RuntimeException implements ExceptionInterface 20 | { 21 | use DebugTraceableTrait; 22 | 23 | public static function forCannotSetFilePath(string $path) 24 | { 25 | return new static(lang('HTTP.cannotSetFilepath', [$path])); 26 | } 27 | 28 | public static function forCannotSetBinary() 29 | { 30 | return new static(lang('HTTP.cannotSetBinary')); 31 | } 32 | 33 | public static function forNotFoundDownloadSource() 34 | { 35 | return new static(lang('HTTP.notFoundDownloadSource')); 36 | } 37 | 38 | public static function forCannotSetCache() 39 | { 40 | return new static(lang('HTTP.cannotSetCache')); 41 | } 42 | 43 | public static function forCannotSetStatusCode(int $code, string $reason) 44 | { 45 | return new static(lang('HTTP.cannotSetStatusCode', [$code, $reason])); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /system/Exceptions/EmergencyError.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Exceptions; 13 | 14 | use Error; 15 | 16 | /** 17 | * Error: system is unusable 18 | */ 19 | class EmergencyError extends Error 20 | { 21 | } 22 | -------------------------------------------------------------------------------- /system/Exceptions/ExceptionInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Exceptions; 13 | 14 | /** 15 | * Provides a domain-level interface for broad capture 16 | * of all framework-related exceptions. 17 | * 18 | * catch (\CodeIgniter\Exceptions\ExceptionInterface) { ... } 19 | */ 20 | 21 | interface ExceptionInterface 22 | { 23 | } 24 | -------------------------------------------------------------------------------- /system/Exceptions/FrameworkException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Exceptions; 13 | 14 | use RuntimeException; 15 | 16 | /** 17 | * Class FrameworkException 18 | * 19 | * A collection of exceptions thrown by the framework 20 | * that can only be determined at run time. 21 | */ 22 | class FrameworkException extends RuntimeException implements ExceptionInterface 23 | { 24 | use DebugTraceableTrait; 25 | 26 | public static function forEnabledZlibOutputCompression() 27 | { 28 | return new static(lang('Core.enabledZlibOutputCompression')); 29 | } 30 | 31 | public static function forInvalidFile(string $path) 32 | { 33 | return new static(lang('Core.invalidFile', [$path])); 34 | } 35 | 36 | public static function forCopyError(string $path) 37 | { 38 | return new static(lang('Core.copyError', [$path])); 39 | } 40 | 41 | public static function forMissingExtension(string $extension) 42 | { 43 | if (strpos($extension, 'intl') !== false) 44 | { 45 | // @codeCoverageIgnoreStart 46 | $message = sprintf( 47 | 'The framework needs the following extension(s) installed and loaded: %s.', 48 | $extension 49 | ); 50 | // @codeCoverageIgnoreEnd 51 | } 52 | else 53 | { 54 | $message = lang('Core.missingExtension', [$extension]); 55 | } 56 | 57 | return new static($message); 58 | } 59 | 60 | public static function forNoHandlers(string $class) 61 | { 62 | return new static(lang('Core.noHandlers', [$class])); 63 | } 64 | 65 | public static function forFabricatorCreateFailed(string $table, string $reason) 66 | { 67 | return new static(lang('Fabricator.createFailed', [$table, $reason])); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /system/Exceptions/ModelException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Exceptions; 13 | 14 | /** 15 | * Model Exceptions. 16 | */ 17 | 18 | class ModelException extends FrameworkException 19 | { 20 | public static function forNoPrimaryKey(string $modelName) 21 | { 22 | return new static(lang('Database.noPrimaryKey', [$modelName])); 23 | } 24 | 25 | public static function forNoDateFormat(string $modelName) 26 | { 27 | return new static(lang('Database.noDateFormat', [$modelName])); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /system/Exceptions/PageNotFoundException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Exceptions; 13 | 14 | use OutOfBoundsException; 15 | 16 | class PageNotFoundException extends OutOfBoundsException implements ExceptionInterface 17 | { 18 | use DebugTraceableTrait; 19 | 20 | /** 21 | * Error code 22 | * 23 | * @var integer 24 | */ 25 | protected $code = 404; 26 | 27 | public static function forPageNotFound(string $message = null) 28 | { 29 | return new static($message ?? lang('HTTP.pageNotFound')); 30 | } 31 | 32 | public static function forEmptyController() 33 | { 34 | return new static(lang('HTTP.emptyController')); 35 | } 36 | 37 | public static function forControllerNotFound(string $controller, string $method) 38 | { 39 | return new static(lang('HTTP.controllerNotFound', [$controller, $method])); 40 | } 41 | 42 | public static function forMethodNotFound(string $method) 43 | { 44 | return new static(lang('HTTP.methodNotFound', [$method])); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /system/Files/Exceptions/FileException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Files\Exceptions; 13 | 14 | use CodeIgniter\Exceptions\DebugTraceableTrait; 15 | use CodeIgniter\Exceptions\ExceptionInterface; 16 | use RuntimeException; 17 | 18 | class FileException extends RuntimeException implements ExceptionInterface 19 | { 20 | use DebugTraceableTrait; 21 | 22 | public static function forUnableToMove(string $from = null, string $to = null, string $error = null) 23 | { 24 | return new static(lang('Files.cannotMove', [$from, $to, $error])); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /system/Files/Exceptions/FileNotFoundException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Files\Exceptions; 13 | 14 | use CodeIgniter\Exceptions\DebugTraceableTrait; 15 | use CodeIgniter\Exceptions\ExceptionInterface; 16 | use RuntimeException; 17 | 18 | class FileNotFoundException extends RuntimeException implements ExceptionInterface 19 | { 20 | use DebugTraceableTrait; 21 | 22 | public static function forFileNotFound(string $path) 23 | { 24 | return new static(lang('Files.fileNotFound', [$path])); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /system/Filters/DebugToolbar.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Filters; 13 | 14 | use CodeIgniter\HTTP\IncomingRequest; 15 | use CodeIgniter\HTTP\RequestInterface; 16 | use CodeIgniter\HTTP\Response; 17 | use CodeIgniter\HTTP\ResponseInterface; 18 | use Config\Services; 19 | 20 | /** 21 | * Debug toolbar filter 22 | */ 23 | class DebugToolbar implements FilterInterface 24 | { 25 | /** 26 | * We don't need to do anything here. 27 | * 28 | * @param RequestInterface|IncomingRequest $request 29 | * @param array|null $arguments 30 | * 31 | * @return void 32 | */ 33 | public function before(RequestInterface $request, $arguments = null) 34 | { 35 | } 36 | 37 | //-------------------------------------------------------------------- 38 | 39 | /** 40 | * If the debug flag is set (CI_DEBUG) then collect performance 41 | * and debug information and display it in a toolbar. 42 | * 43 | * @param RequestInterface|IncomingRequest $request 44 | * @param ResponseInterface|Response $response 45 | * @param array|null $arguments 46 | * 47 | * @return void 48 | */ 49 | public function after(RequestInterface $request, ResponseInterface $response, $arguments = null) 50 | { 51 | Services::toolbar()->prepare($request, $response); 52 | } 53 | 54 | //-------------------------------------------------------------------- 55 | } 56 | -------------------------------------------------------------------------------- /system/Filters/Exceptions/FilterException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Filters\Exceptions; 13 | 14 | use CodeIgniter\Exceptions\ConfigException; 15 | use CodeIgniter\Exceptions\ExceptionInterface; 16 | 17 | /** 18 | * FilterException 19 | */ 20 | class FilterException extends ConfigException implements ExceptionInterface 21 | { 22 | /** 23 | * Thrown when the provided alias is not within 24 | * the list of configured filter aliases. 25 | * 26 | * @param string $alias 27 | * 28 | * @return static 29 | */ 30 | public static function forNoAlias(string $alias) 31 | { 32 | return new static(lang('Filters.noFilter', [$alias])); 33 | } 34 | 35 | /** 36 | * Thrown when the filter class does not implement FilterInterface. 37 | * 38 | * @param string $class 39 | * 40 | * @return static 41 | */ 42 | public static function forIncorrectInterface(string $class) 43 | { 44 | return new static(lang('Filters.incorrectInterface', [$class])); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /system/Filters/FilterInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Filters; 13 | 14 | use CodeIgniter\HTTP\RequestInterface; 15 | use CodeIgniter\HTTP\ResponseInterface; 16 | 17 | /** 18 | * Filter interface 19 | */ 20 | interface FilterInterface 21 | { 22 | /** 23 | * Do whatever processing this filter needs to do. 24 | * By default it should not return anything during 25 | * normal execution. However, when an abnormal state 26 | * is found, it should return an instance of 27 | * CodeIgniter\HTTP\Response. If it does, script 28 | * execution will end and that Response will be 29 | * sent back to the client, allowing for error pages, 30 | * redirects, etc. 31 | * 32 | * @param RequestInterface $request 33 | * @param null $arguments 34 | * 35 | * @return mixed 36 | */ 37 | public function before(RequestInterface $request, $arguments = null); 38 | 39 | //-------------------------------------------------------------------- 40 | 41 | /** 42 | * Allows After filters to inspect and modify the response 43 | * object as needed. This method does not allow any way 44 | * to stop execution of other after filters, short of 45 | * throwing an Exception or Error. 46 | * 47 | * @param RequestInterface $request 48 | * @param ResponseInterface $response 49 | * @param null $arguments 50 | * 51 | * @return mixed 52 | */ 53 | public function after(RequestInterface $request, ResponseInterface $response, $arguments = null); 54 | 55 | //-------------------------------------------------------------------- 56 | } 57 | -------------------------------------------------------------------------------- /system/Filters/Honeypot.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Filters; 13 | 14 | use CodeIgniter\Honeypot\Exceptions\HoneypotException; 15 | use CodeIgniter\HTTP\RequestInterface; 16 | use CodeIgniter\HTTP\ResponseInterface; 17 | use Config\Services; 18 | 19 | /** 20 | * Honeypot filter 21 | */ 22 | class Honeypot implements FilterInterface 23 | { 24 | /** 25 | * Checks if Honeypot field is empty; if not 26 | * then the requester is a bot 27 | * 28 | * @param RequestInterface $request 29 | * @param array|null $arguments 30 | * 31 | * @return void 32 | */ 33 | public function before(RequestInterface $request, $arguments = null) 34 | { 35 | $honeypot = Services::honeypot(new \Config\Honeypot()); 36 | if ($honeypot->hasContent($request)) 37 | { 38 | throw HoneypotException::isBot(); 39 | } 40 | } 41 | 42 | /** 43 | * Attach a honeypot to the current response. 44 | * 45 | * @param RequestInterface $request 46 | * @param ResponseInterface $response 47 | * @param array|null $arguments 48 | * 49 | * @return void 50 | */ 51 | public function after(RequestInterface $request, ResponseInterface $response, $arguments = null) 52 | { 53 | $honeypot = Services::honeypot(new \Config\Honeypot()); 54 | $honeypot->attachHoneypot($response); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /system/Format/Format.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Format; 13 | 14 | use CodeIgniter\Format\Exceptions\FormatException; 15 | use Config\Format as FormatConfig; 16 | 17 | /** 18 | * The Format class is a convenient place to create Formatters. 19 | */ 20 | class Format 21 | { 22 | /** 23 | * Configuration instance 24 | * 25 | * @var FormatConfig 26 | */ 27 | protected $config; 28 | 29 | /** 30 | * Constructor. 31 | * 32 | * @param FormatConfig $config 33 | */ 34 | public function __construct(FormatConfig $config) 35 | { 36 | $this->config = $config; 37 | } 38 | 39 | /** 40 | * Returns the current configuration instance. 41 | * 42 | * @return FormatConfig 43 | */ 44 | public function getConfig() 45 | { 46 | return $this->config; 47 | } 48 | 49 | /** 50 | * A Factory method to return the appropriate formatter for the given mime type. 51 | * 52 | * @param string $mime 53 | * 54 | * @throws FormatException 55 | * 56 | * @return FormatterInterface 57 | */ 58 | public function getFormatter(string $mime): FormatterInterface 59 | { 60 | if (! array_key_exists($mime, $this->config->formatters)) 61 | { 62 | throw FormatException::forInvalidMime($mime); 63 | } 64 | 65 | $className = $this->config->formatters[$mime]; 66 | 67 | if (! class_exists($className)) 68 | { 69 | throw FormatException::forInvalidFormatter($className); 70 | } 71 | 72 | $class = new $className(); 73 | 74 | if (! $class instanceof FormatterInterface) 75 | { 76 | throw FormatException::forInvalidFormatter($className); 77 | } 78 | 79 | return $class; 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /system/Format/FormatterInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Format; 13 | 14 | /** 15 | * Formatter interface 16 | */ 17 | interface FormatterInterface 18 | { 19 | /** 20 | * Takes the given data and formats it. 21 | * 22 | * @param string|array $data 23 | * 24 | * @return mixed 25 | */ 26 | public function format($data); 27 | } 28 | -------------------------------------------------------------------------------- /system/Format/JSONFormatter.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Format; 13 | 14 | use CodeIgniter\Format\Exceptions\FormatException; 15 | use Config\Format; 16 | 17 | /** 18 | * JSON data formatter 19 | */ 20 | class JSONFormatter implements FormatterInterface 21 | { 22 | /** 23 | * Takes the given data and formats it. 24 | * 25 | * @param mixed $data 26 | * 27 | * @return string|boolean (JSON string | false) 28 | */ 29 | public function format($data) 30 | { 31 | $config = new Format(); 32 | 33 | $options = $config->formatterOptions['application/json'] ?? JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES; 34 | $options = $options | JSON_PARTIAL_OUTPUT_ON_ERROR; 35 | 36 | $options = ENVIRONMENT === 'production' ? $options : $options | JSON_PRETTY_PRINT; 37 | 38 | $result = json_encode($data, $options, 512); 39 | 40 | if (! in_array(json_last_error(), [JSON_ERROR_NONE, JSON_ERROR_RECURSION], true)) 41 | { 42 | throw FormatException::forInvalidJSON(json_last_error_msg()); 43 | } 44 | 45 | return $result; 46 | } 47 | 48 | //-------------------------------------------------------------------- 49 | } 50 | -------------------------------------------------------------------------------- /system/Helpers/security_helper.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | use Config\Services; 13 | 14 | /** 15 | * CodeIgniter Security Helpers 16 | */ 17 | 18 | if (! function_exists('sanitize_filename')) 19 | { 20 | /** 21 | * Sanitize a filename to use in a URI. 22 | * 23 | * @param string $filename 24 | * 25 | * @return string 26 | */ 27 | function sanitize_filename(string $filename): string 28 | { 29 | return Services::security()->sanitizeFilename($filename); 30 | } 31 | } 32 | 33 | //-------------------------------------------------------------------- 34 | 35 | if (! function_exists('strip_image_tags')) 36 | { 37 | /** 38 | * Strip Image Tags 39 | * 40 | * @param string $str 41 | * 42 | * @return string 43 | */ 44 | function strip_image_tags(string $str): string 45 | { 46 | return preg_replace([ 47 | '##i', 48 | '#`]+)).*?\>#i', 49 | ], '\\2', $str 50 | ); 51 | } 52 | } 53 | 54 | //-------------------------------------------------------------------- 55 | 56 | if (! function_exists('encode_php_tags')) 57 | { 58 | /** 59 | * Convert PHP tags to entities 60 | * 61 | * @param string $str 62 | * 63 | * @return string 64 | */ 65 | function encode_php_tags(string $str): string 66 | { 67 | return str_replace([''], ['<?', '?>'], $str); 68 | } 69 | } 70 | 71 | //-------------------------------------------------------------------- 72 | -------------------------------------------------------------------------------- /system/Helpers/test_helper.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | use CodeIgniter\Model; 13 | use CodeIgniter\Test\Fabricator; 14 | 15 | /** 16 | * CodeIgniter Test Helpers 17 | */ 18 | //-------------------------------------------------------------------- 19 | 20 | if (! function_exists('fake')) 21 | { 22 | /** 23 | * Creates a single item using Fabricator. 24 | * 25 | * @param Model|object|string $model Instance or name of the model 26 | * @param array|null $overrides Overriding data to pass to Fabricator::setOverrides() 27 | * 28 | * @return object|array 29 | */ 30 | function fake($model, array $overrides = null, $persist = true) 31 | { 32 | // Get a model-appropriate Fabricator instance 33 | $fabricator = new Fabricator($model); 34 | 35 | // Set overriding data, if necessary 36 | if ($overrides) 37 | { 38 | $fabricator->setOverrides($overrides); 39 | } 40 | 41 | if ($persist) 42 | { 43 | return $fabricator->create(); 44 | } 45 | 46 | return $fabricator->make(); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /system/Helpers/xml_helper.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | /** 13 | * CodeIgniter XML Helpers 14 | */ 15 | 16 | if (! function_exists('xml_convert')) 17 | { 18 | /** 19 | * Convert Reserved XML characters to Entities 20 | * 21 | * @param string $str 22 | * @param boolean $protectAll 23 | * @return string 24 | */ 25 | function xml_convert(string $str, bool $protectAll = false): string 26 | { 27 | $temp = '__TEMP_AMPERSANDS__'; 28 | 29 | // Replace entities to temporary markers so that 30 | // ampersands won't get messed up 31 | $str = preg_replace('/&#(\d+);/', $temp . '\\1;', $str); 32 | 33 | if ($protectAll === true) 34 | { 35 | $str = preg_replace('/&(\w+);/', $temp . '\\1;', $str); 36 | } 37 | 38 | $original = [ 39 | '&', 40 | '<', 41 | '>', 42 | '"', 43 | "'", 44 | '-', 45 | ]; 46 | 47 | $replacement = [ 48 | '&', 49 | '<', 50 | '>', 51 | '"', 52 | ''', 53 | '-', 54 | ]; 55 | 56 | $str = str_replace($original, $replacement, $str); 57 | 58 | // Decode the temp markers back to entities 59 | $str = preg_replace('/' . $temp . '(\d+);/', '&#\\1;', $str); 60 | 61 | if ($protectAll === true) 62 | { 63 | return preg_replace('/' . $temp . '(\w+);/', '&\\1;', $str); 64 | } 65 | 66 | return $str; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /system/Honeypot/Exceptions/HoneypotException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Honeypot\Exceptions; 13 | 14 | use CodeIgniter\Exceptions\ConfigException; 15 | use CodeIgniter\Exceptions\ExceptionInterface; 16 | 17 | class HoneypotException extends ConfigException implements ExceptionInterface 18 | { 19 | public static function forNoTemplate() 20 | { 21 | return new static(lang('Honeypot.noTemplate')); 22 | } 23 | 24 | public static function forNoNameField() 25 | { 26 | return new static(lang('Honeypot.noNameField')); 27 | } 28 | 29 | public static function forNoHiddenValue() 30 | { 31 | return new static(lang('Honeypot.noHiddenValue')); 32 | } 33 | 34 | public static function isBot() 35 | { 36 | return new static(lang('Honeypot.theClientIsABot')); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /system/Images/Exceptions/ImageException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Images\Exceptions; 13 | 14 | use CodeIgniter\Exceptions\ExceptionInterface; 15 | use CodeIgniter\Exceptions\FrameworkException; 16 | 17 | class ImageException extends FrameworkException implements ExceptionInterface 18 | { 19 | public static function forMissingImage() 20 | { 21 | return new static(lang('Images.sourceImageRequired')); 22 | } 23 | 24 | public static function forFileNotSupported() 25 | { 26 | return new static(lang('Images.fileNotSupported')); 27 | } 28 | 29 | public static function forMissingAngle() 30 | { 31 | return new static(lang('Images.rotationAngleRequired')); 32 | } 33 | 34 | public static function forInvalidDirection(string $dir = null) 35 | { 36 | return new static(lang('Images.invalidDirection', [$dir])); 37 | } 38 | 39 | public static function forInvalidPath() 40 | { 41 | return new static(lang('Images.invalidPath')); 42 | } 43 | 44 | public static function forEXIFUnsupported() 45 | { 46 | return new static(lang('Images.exifNotSupported')); 47 | } 48 | 49 | public static function forInvalidImageCreate(string $extra = null) 50 | { 51 | return new static(lang('Images.unsupportedImageCreate') . ' ' . $extra); 52 | } 53 | 54 | public static function forSaveFailed() 55 | { 56 | return new static(lang('Images.saveFailed')); 57 | } 58 | 59 | public static function forInvalidImageLibraryPath(string $path = null) 60 | { 61 | return new static(lang('Images.libPathInvalid', [$path])); 62 | } 63 | 64 | public static function forImageProcessFailed() 65 | { 66 | return new static(lang('Images.imageProcessFailed')); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /system/Language/en/Cache.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | // Cache language settings 13 | return [ 14 | 'unableToWrite' => 'Cache unable to write to {0}.', 15 | 'invalidHandlers' => 'Cache config must have an array of $validHandlers.', 16 | 'noBackup' => 'Cache config must have a handler and backupHandler set.', 17 | 'handlerNotFound' => 'Cache config has an invalid handler or backup handler specified.', 18 | ]; 19 | -------------------------------------------------------------------------------- /system/Language/en/Cast.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | // Cast language settings 13 | return [ 14 | 'baseCastMissing' => 'The "{0}" class must inherit the "CodeIgniter\Entity\Cast\BaseCast" class.', 15 | 'invalidCastMethod' => 'The "{0}" is invalid cast method, valid methods are: ["get", "set"].', 16 | 'invalidTimestamp' => 'Type casting "timestamp" expects a correct timestamp.', 17 | 'jsonErrorCtrlChar' => 'Unexpected control character found.', 18 | 'jsonErrorDepth' => 'Maximum stack depth exceeded.', 19 | 'jsonErrorStateMismatch' => 'Underflow or the modes mismatch.', 20 | 'jsonErrorSyntax' => 'Syntax error, malformed JSON.', 21 | 'jsonErrorUnknown' => 'Unknown error.', 22 | 'jsonErrorUtf8' => 'Malformed UTF-8 characters, possibly incorrectly encoded.', 23 | ]; 24 | -------------------------------------------------------------------------------- /system/Language/en/Cookie.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | // Cookie language settings 13 | return [ 14 | 'invalidExpiresTime' => 'Invalid "{0}" type for "Expires" attribute. Expected: string, integer, DateTimeInterface object.', 15 | 'invalidExpiresValue' => 'The cookie expiration time is not valid.', 16 | 'invalidCookieName' => 'The cookie name "{0}" contains invalid characters.', 17 | 'emptyCookieName' => 'The cookie name cannot be empty.', 18 | 'invalidSecurePrefix' => 'Using the "__Secure-" prefix requires setting the "Secure" attribute.', 19 | 'invalidHostPrefix' => 'Using the "__Host-" prefix must be set with the "Secure" flag, must not have a "Domain" attribute, and the "Path" is set to "/".', 20 | 'invalidSameSite' => 'The SameSite value must be None, Lax, Strict or a blank string, {0} given.', 21 | 'invalidSameSiteNone' => 'Using the "SameSite=None" attribute requires setting the "Secure" attribute.', 22 | 'invalidCookieInstance' => '"{0}" class expected cookies array to be instances of "{1}" but got "{2}" at index {3}.', 23 | 'unknownCookieInstance' => 'Cookie object with name "{0}" and prefix "{1}" was not found in the collection.', 24 | ]; 25 | -------------------------------------------------------------------------------- /system/Language/en/Core.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | // Core language settings 13 | return [ 14 | 'copyError' => 'An error was encountered while attempting to replace the file ({0}). Please make sure your file directory is writable.', 15 | 'enabledZlibOutputCompression' => 'Your zlib.output_compression ini directive is turned on. This will not work well with output buffers.', 16 | 'invalidFile' => 'Invalid file: {0}', 17 | 'invalidPhpVersion' => 'Your PHP version must be {0} or higher to run CodeIgniter. Current version: {1}', 18 | 'missingExtension' => 'The framework needs the following extension(s) installed and loaded: {0}.', 19 | 'noHandlers' => '{0} must provide at least one Handler.', 20 | ]; 21 | -------------------------------------------------------------------------------- /system/Language/en/Database.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | // Database language settings 13 | return [ 14 | 'invalidEvent' => '{0} is not a valid Model Event callback.', 15 | 'invalidArgument' => 'You must provide a valid {0}.', 16 | 'invalidAllowedFields' => 'Allowed fields must be specified for model: {0}', 17 | 'emptyDataset' => 'There is no data to {0}.', 18 | 'emptyPrimaryKey' => 'There is no primary key defined when trying to make {0}.', 19 | 'failGetFieldData' => 'Failed to get field data from database.', 20 | 'failGetIndexData' => 'Failed to get index data from database.', 21 | 'failGetForeignKeyData' => 'Failed to get foreign key data from database.', 22 | 'parseStringFail' => 'Parsing key string failed.', 23 | 'featureUnavailable' => 'This feature is not available for the database you are using.', 24 | 'tableNotFound' => 'Table `{0}` was not found in the current database.', 25 | 'noPrimaryKey' => '`{0}` model class does not specify a Primary Key.', 26 | 'noDateFormat' => '`{0}` model class does not have a valid dateFormat.', 27 | 'fieldNotExists' => 'Field `{0}` not found.', 28 | 'forEmptyInputGiven' => 'Empty statement is given for the field `{0}`', 29 | 'forFindColumnHaveMultipleColumns' => 'Only single column allowed in Column name.', 30 | ]; 31 | -------------------------------------------------------------------------------- /system/Language/en/Encryption.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | // Encryption language settings 13 | return [ 14 | 'noDriverRequested' => 'No driver requested; Miss Daisy will be so upset!', 15 | 'noHandlerAvailable' => 'Unable to find an available {0} encryption handler.', 16 | 'unKnownHandler' => '"{0}" cannot be configured.', 17 | 'starterKeyNeeded' => 'Encrypter needs a starter key.', 18 | 'authenticationFailed' => 'Decrypting: authentication failed.', 19 | 'encryptionFailed' => 'Encryption failed.', 20 | ]; 21 | -------------------------------------------------------------------------------- /system/Language/en/Fabricator.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | // Fabricator language settings 13 | return [ 14 | 'invalidModel' => 'Invalid model supplied for fabrication.', 15 | 'missingFormatters' => 'No valid formatters defined.', 16 | 'createFailed' => 'Fabricator failed to insert on table {0}: {1}', 17 | ]; 18 | -------------------------------------------------------------------------------- /system/Language/en/Files.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | // Files language settings 13 | return [ 14 | 'fileNotFound' => 'File not found: {0}', 15 | 'cannotMove' => 'Could not move file {0} to {1} ({2}).', 16 | ]; 17 | -------------------------------------------------------------------------------- /system/Language/en/Filters.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | // Filters language settings 13 | return [ 14 | 'noFilter' => '{0} filter must have a matching alias defined.', 15 | 'incorrectInterface' => '{0} must implement CodeIgniter\Filters\FilterInterface.', 16 | ]; 17 | -------------------------------------------------------------------------------- /system/Language/en/Format.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | // Format language settings 13 | return [ 14 | 'invalidFormatter' => '"{0}" is not a valid Formatter class.', 15 | 'invalidJSON' => 'Failed to parse json string, error: "{0}".', 16 | 'invalidMime' => 'No Formatter defined for mime type: "{0}".', 17 | 'missingExtension' => 'The SimpleXML extension is required to format XML.', 18 | ]; 19 | -------------------------------------------------------------------------------- /system/Language/en/Log.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | // Log language settings 13 | return [ 14 | 'invalidLogLevel' => '{0} is an invalid log level.', 15 | 'invalidMessageType' => 'The given message type "{0}" is not supported.', 16 | ]; 17 | -------------------------------------------------------------------------------- /system/Language/en/Number.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | // Number language settings 13 | return [ 14 | 'terabyteAbbr' => 'TB', 15 | 'gigabyteAbbr' => 'GB', 16 | 'megabyteAbbr' => 'MB', 17 | 'kilobyteAbbr' => 'KB', 18 | 'bytes' => 'Bytes', 19 | 20 | // don't forget the space in front of these! 21 | 'thousand' => ' thousand', 22 | 'million' => ' million', 23 | 'billion' => ' billion', 24 | 'trillion' => ' trillion', 25 | 'quadrillion' => ' quadrillion', 26 | ]; 27 | -------------------------------------------------------------------------------- /system/Language/en/Pager.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | // Pager language settings 13 | return [ 14 | 'pageNavigation' => 'Page navigation', 15 | 'first' => 'First', 16 | 'previous' => 'Previous', 17 | 'next' => 'Next', 18 | 'last' => 'Last', 19 | 'older' => 'Older', 20 | 'newer' => 'Newer', 21 | 'invalidTemplate' => '{0} is not a valid Pager template.', 22 | 'invalidPaginationGroup' => '{0} is not a valid Pagination group.', 23 | ]; 24 | -------------------------------------------------------------------------------- /system/Language/en/RESTful.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | // RESTful language settings 13 | return [ 14 | 'notImplemented' => '"{0}" action not implemented.', 15 | ]; 16 | -------------------------------------------------------------------------------- /system/Language/en/Router.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | // Router language settings 13 | return [ 14 | 'invalidParameter' => 'A parameter does not match the expected type.', 15 | 'missingDefaultRoute' => 'Unable to determine what should be displayed. A default route has not been specified in the routing file.', 16 | ]; 17 | -------------------------------------------------------------------------------- /system/Language/en/Security.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | // Security language settings 13 | return [ 14 | 'disallowedAction' => 'The action you requested is not allowed.', 15 | 16 | // @deprecated 17 | 'invalidSameSite' => 'The SameSite value must be None, Lax, Strict, or a blank string. Given: {0}', 18 | ]; 19 | -------------------------------------------------------------------------------- /system/Language/en/Session.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | // Session language settings 13 | return [ 14 | 'missingDatabaseTable' => '`sessionSavePath` must have the table name for the Database Session Handler to work.', 15 | 'invalidSavePath' => 'Session: Configured save path "{0}" is not a directory, does not exist or cannot be created.', 16 | 'writeProtectedSavePath' => 'Session: Configured save path "{0}" is not writable by the PHP process.', 17 | 'emptySavePath' => 'Session: No save path configured.', 18 | 'invalidSavePathFormat' => 'Session: Invalid Redis save path format: {0}', 19 | 20 | // @deprecated 21 | 'invalidSameSiteSetting' => 'Session: The SameSite setting must be None, Lax, Strict, or a blank string. Given: {0}', 22 | ]; 23 | -------------------------------------------------------------------------------- /system/Language/en/Time.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | // Time language settings 13 | return [ 14 | 'invalidFormat' => '"{0}" is not a valid datetime format', 15 | 'invalidMonth' => 'Months must be between 1 and 12. Given: {0}', 16 | 'invalidDay' => 'Days must be between 1 and 31. Given: {0}', 17 | 'invalidOverDay' => 'Days must be between 1 and {0}. Given: {1}', 18 | 'invalidHours' => 'Hours must be between 0 and 23. Given: {0}', 19 | 'invalidMinutes' => 'Minutes must be between 0 and 59. Given: {0}', 20 | 'invalidSeconds' => 'Seconds must be between 0 and 59. Given: {0}', 21 | 'years' => '{0, plural, =1{# year} other{# years}}', 22 | 'months' => '{0, plural, =1{# month} other{# months}}', 23 | 'weeks' => '{0, plural, =1{# week} other{# weeks}}', 24 | 'days' => '{0, plural, =1{# day} other{# days}}', 25 | 'hours' => '{0, plural, =1{# hour} other{# hours}}', 26 | 'minutes' => '{0, plural, =1{# minute} other{# minutes}}', 27 | 'seconds' => '{0, plural, =1{# second} other{# seconds}}', 28 | 'ago' => '{0} ago', 29 | 'inFuture' => 'in {0}', 30 | 'yesterday' => 'Yesterday', 31 | 'tomorrow' => 'Tomorrow', 32 | 'now' => 'Just now', 33 | ]; 34 | -------------------------------------------------------------------------------- /system/Language/en/View.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | // View language settings 13 | return [ 14 | 'invalidCellMethod' => '{class}::{method} is not a valid method.', 15 | 'missingCellParameters' => '{class}::{method} has no params.', 16 | 'invalidCellParameter' => '{0} is not a valid param name.', 17 | 'noCellClass' => 'No view cell class provided.', 18 | 'invalidCellClass' => 'Unable to locate view cell class: {0}.', 19 | 'tagSyntaxError' => 'You have a syntax error in your Parser tags: {0}', 20 | ]; 21 | -------------------------------------------------------------------------------- /system/Log/Exceptions/LogException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Log\Exceptions; 13 | 14 | use CodeIgniter\Exceptions\FrameworkException; 15 | 16 | class LogException extends FrameworkException 17 | { 18 | public static function forInvalidLogLevel(string $level) 19 | { 20 | return new static(lang('Log.invalidLogLevel', [$level])); 21 | } 22 | 23 | public static function forInvalidMessageType(string $messageType) 24 | { 25 | return new static(lang('Log.invalidMessageType', [$messageType])); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /system/Log/Handlers/HandlerInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Log\Handlers; 13 | 14 | /** 15 | * Expected behavior for a Log handler 16 | */ 17 | interface HandlerInterface 18 | { 19 | /** 20 | * Handles logging the message. 21 | * If the handler returns false, then execution of handlers 22 | * will stop. Any handlers that have not run, yet, will not 23 | * be run. 24 | * 25 | * @param string $level 26 | * @param string $message 27 | * 28 | * @return boolean 29 | */ 30 | public function handle($level, $message): bool; 31 | 32 | //-------------------------------------------------------------------- 33 | 34 | /** 35 | * Checks whether the Handler will handle logging items of this 36 | * log Level. 37 | * 38 | * @param string $level 39 | * 40 | * @return boolean 41 | */ 42 | public function canHandle(string $level): bool; 43 | 44 | //-------------------------------------------------------------------- 45 | 46 | /** 47 | * Sets the preferred date format to use when logging. 48 | * 49 | * @param string $format 50 | * 51 | * @return HandlerInterface 52 | */ 53 | public function setDateFormat(string $format); 54 | 55 | //-------------------------------------------------------------------- 56 | } 57 | -------------------------------------------------------------------------------- /system/Modules/Modules.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Modules; 13 | 14 | /** 15 | * Modules Class 16 | * 17 | * @link https://codeigniter.com/user_guide/general/modules.html 18 | */ 19 | class Modules 20 | { 21 | /** 22 | * Auto-Discover 23 | * 24 | * @var boolean 25 | */ 26 | public $enabled = true; 27 | 28 | /** 29 | * Auto-Discovery Within Composer Packages 30 | * 31 | * @var boolean 32 | */ 33 | public $discoverInComposer = true; 34 | 35 | /** 36 | * Auto-Discover Rules Handler 37 | * 38 | * @var array 39 | */ 40 | public $aliases = []; 41 | 42 | /** 43 | * Should the application auto-discover the requested resource. 44 | * 45 | * @param string $alias 46 | * 47 | * @return boolean 48 | */ 49 | public function shouldDiscover(string $alias): bool 50 | { 51 | if (! $this->enabled) 52 | { 53 | return false; 54 | } 55 | 56 | return in_array(strtolower($alias), $this->aliases, true); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /system/Pager/Exceptions/PagerException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Pager\Exceptions; 13 | 14 | use CodeIgniter\Exceptions\FrameworkException; 15 | 16 | class PagerException extends FrameworkException 17 | { 18 | public static function forInvalidTemplate(string $template = null) 19 | { 20 | return new static(lang('Pager.invalidTemplate', [$template])); 21 | } 22 | 23 | public static function forInvalidPaginationGroup(string $group = null) 24 | { 25 | return new static(lang('Pager.invalidPaginationGroup', [$group])); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /system/Pager/Views/default_full.php: -------------------------------------------------------------------------------- 1 | setSurroundCount(2); 9 | ?> 10 | 11 | 48 | -------------------------------------------------------------------------------- /system/Pager/Views/default_head.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | use CodeIgniter\Pager\PagerRenderer; 13 | 14 | /** 15 | * @var PagerRenderer $pager 16 | */ 17 | $pager->setSurroundCount(0); 18 | 19 | if ($pager->hasPrevious()) 20 | { 21 | echo '' . PHP_EOL; 22 | } 23 | 24 | echo '' . PHP_EOL; 25 | 26 | if ($pager->hasNext()) 27 | { 28 | echo '' . PHP_EOL; 29 | } 30 | -------------------------------------------------------------------------------- /system/Pager/Views/default_simple.php: -------------------------------------------------------------------------------- 1 | setSurroundCount(0); 9 | ?> 10 | 24 | -------------------------------------------------------------------------------- /system/Router/Exceptions/RedirectException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Router\Exceptions; 13 | 14 | use Exception; 15 | 16 | /** 17 | * RedirectException 18 | */ 19 | class RedirectException extends Exception 20 | { 21 | /** 22 | * Status code for redirects 23 | * 24 | * @var integer 25 | */ 26 | protected $code = 302; 27 | } 28 | -------------------------------------------------------------------------------- /system/Router/Exceptions/RouterException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Router\Exceptions; 13 | 14 | use CodeIgniter\Exceptions\FrameworkException; 15 | 16 | /** 17 | * RouterException 18 | */ 19 | class RouterException extends FrameworkException 20 | { 21 | /** 22 | * Thrown when the actual parameter type does not match 23 | * the expected types. 24 | * 25 | * @return RouterException 26 | */ 27 | public static function forInvalidParameterType() 28 | { 29 | return new static(lang('Router.invalidParameterType')); 30 | } 31 | 32 | /** 33 | * Thrown when a default route is not set. 34 | * 35 | * @return RouterException 36 | */ 37 | public static function forMissingDefaultRoute() 38 | { 39 | return new static(lang('Router.missingDefaultRoute')); 40 | } 41 | 42 | /** 43 | * Throw when controller or its method is not found. 44 | * 45 | * @param string $controller 46 | * @param string $method 47 | * 48 | * @return RouterException 49 | */ 50 | public static function forControllerNotFound(string $controller, string $method) 51 | { 52 | return new static(lang('HTTP.controllerNotFound', [$controller, $method])); 53 | } 54 | 55 | /** 56 | * Throw when route is not valid. 57 | * 58 | * @param string $route 59 | * 60 | * @return RouterException 61 | */ 62 | public static function forInvalidRoute(string $route) 63 | { 64 | return new static(lang('HTTP.invalidRoute', [$route])); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /system/Security/Exceptions/SecurityException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Security\Exceptions; 13 | 14 | use CodeIgniter\Exceptions\FrameworkException; 15 | 16 | class SecurityException extends FrameworkException 17 | { 18 | public static function forDisallowedAction() 19 | { 20 | return new static(lang('Security.disallowedAction'), 403); 21 | } 22 | 23 | /** 24 | * @deprecated Use `CookieException::forInvalidSameSite()` instead. 25 | * 26 | * @codeCoverageIgnore 27 | */ 28 | public static function forInvalidSameSite(string $samesite) 29 | { 30 | return new static(lang('Security.invalidSameSite', [$samesite])); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /system/Session/Exceptions/SessionException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Session\Exceptions; 13 | 14 | use CodeIgniter\Exceptions\FrameworkException; 15 | 16 | class SessionException extends FrameworkException 17 | { 18 | public static function forMissingDatabaseTable() 19 | { 20 | return new static(lang('Session.missingDatabaseTable')); 21 | } 22 | 23 | public static function forInvalidSavePath(string $path = null) 24 | { 25 | return new static(lang('Session.invalidSavePath', [$path])); 26 | } 27 | 28 | public static function forWriteProtectedSavePath(string $path = null) 29 | { 30 | return new static(lang('Session.writeProtectedSavePath', [$path])); 31 | } 32 | 33 | public static function forEmptySavepath() 34 | { 35 | return new static(lang('Session.emptySavePath')); 36 | } 37 | 38 | public static function forInvalidSavePathFormat(string $path) 39 | { 40 | return new static(lang('Session.invalidSavePathFormat', [$path])); 41 | } 42 | 43 | /** 44 | * @deprecated 45 | * 46 | * @codeCoverageIgnore 47 | */ 48 | public static function forInvalidSameSiteSetting(string $samesite) 49 | { 50 | return new static(lang('Session.invalidSameSiteSetting', [$samesite])); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /system/Test/CIDatabaseTestCase.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Test; 13 | 14 | /** 15 | * CIDatabaseTestCase 16 | * 17 | * Use DatabaseTestTrait instead. 18 | * 19 | * @deprecated 4.1.2 20 | */ 21 | abstract class CIDatabaseTestCase extends CIUnitTestCase 22 | { 23 | use DatabaseTestTrait; 24 | } 25 | -------------------------------------------------------------------------------- /system/Test/FeatureResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Test; 13 | 14 | /** 15 | * Assertions for a response 16 | * 17 | * @deprecated Use TestResponse directly 18 | */ 19 | class FeatureResponse extends TestResponse 20 | { 21 | /** 22 | * @deprecated Will be protected in a future release, use response() instead 23 | */ 24 | public $response; 25 | } 26 | -------------------------------------------------------------------------------- /system/Test/Filters/CITestStreamFilter.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Test\Filters; 13 | 14 | use php_user_filter; 15 | 16 | /** 17 | * Class to extract an output snapshot. 18 | * Used to capture output during unit testing, so that it can 19 | * be used in assertions. 20 | */ 21 | class CITestStreamFilter extends php_user_filter 22 | { 23 | /** 24 | * Buffer to capture stream content. 25 | * 26 | * @var string 27 | */ 28 | public static $buffer = ''; 29 | 30 | /** 31 | * Output filtering - catch it all. 32 | * 33 | * @param resource $in 34 | * @param resource $out 35 | * @param integer $consumed 36 | * @param boolean $closing 37 | * 38 | * @return integer 39 | */ 40 | public function filter($in, $out, &$consumed, $closing) 41 | { 42 | while ($bucket = stream_bucket_make_writeable($in)) 43 | { 44 | static::$buffer .= $bucket->data; 45 | 46 | $consumed += $bucket->datalen; 47 | } 48 | 49 | // @phpstan-ignore-next-line 50 | return PSFS_PASS_ON; 51 | } 52 | } 53 | 54 | // @codeCoverageIgnoreStart 55 | stream_filter_register('CITestStreamFilter', 'CodeIgniter\Test\Filters\CITestStreamFilter'); 56 | // @codeCoverageIgnoreEnd 57 | -------------------------------------------------------------------------------- /system/Test/Mock/MockAppConfig.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Test\Mock; 13 | 14 | use Config\App; 15 | 16 | class MockAppConfig extends App 17 | { 18 | public $baseURL = 'http://example.com/'; 19 | 20 | public $uriProtocol = 'REQUEST_URI'; 21 | 22 | public $cookiePrefix = ''; 23 | public $cookieDomain = ''; 24 | public $cookiePath = '/'; 25 | public $cookieSecure = false; 26 | public $cookieHTTPOnly = false; 27 | public $cookieSameSite = 'Lax'; 28 | 29 | public $proxyIPs = ''; 30 | 31 | public $CSRFProtection = false; 32 | public $CSRFTokenName = 'csrf_test_name'; 33 | public $CSRFHeaderName = 'X-CSRF-TOKEN'; 34 | public $CSRFCookieName = 'csrf_cookie_name'; 35 | public $CSRFExpire = 7200; 36 | public $CSRFRegenerate = true; 37 | public $CSRFExcludeURIs = ['http://example.com']; 38 | public $CSRFRedirect = false; 39 | public $CSRFSameSite = 'Lax'; 40 | 41 | public $CSPEnabled = false; 42 | 43 | public $defaultLocale = 'en'; 44 | public $negotiateLocale = false; 45 | public $supportedLocales = [ 46 | 'en', 47 | 'es', 48 | ]; 49 | } 50 | -------------------------------------------------------------------------------- /system/Test/Mock/MockAutoload.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Test\Mock; 13 | 14 | use Config\Autoload; 15 | 16 | class MockAutoload extends Autoload 17 | { 18 | public $psr4 = []; 19 | 20 | public $classmap = []; 21 | 22 | public function __construct() 23 | { 24 | // Don't call the parent since we don't want the default mappings. 25 | // parent::__construct(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /system/Test/Mock/MockBuilder.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Test\Mock; 13 | 14 | use CodeIgniter\Database\BaseBuilder; 15 | use CodeIgniter\Database\ConnectionInterface; 16 | 17 | class MockBuilder extends BaseBuilder 18 | { 19 | public function __construct($tableName, ConnectionInterface &$db, array $options = null) 20 | { 21 | parent::__construct($tableName, $db, $options); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /system/Test/Mock/MockCLIConfig.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Test\Mock; 13 | 14 | use Config\App; 15 | 16 | class MockCLIConfig extends App 17 | { 18 | public $baseURL = 'http://example.com/'; 19 | 20 | public $uriProtocol = 'REQUEST_URI'; 21 | 22 | public $cookiePrefix = ''; 23 | public $cookieDomain = ''; 24 | public $cookiePath = '/'; 25 | public $cookieSecure = false; 26 | public $cookieHTTPOnly = false; 27 | public $cookieSameSite = 'Lax'; 28 | 29 | public $proxyIPs = ''; 30 | 31 | public $CSRFProtection = false; 32 | public $CSRFTokenName = 'csrf_test_name'; 33 | public $CSRFCookieName = 'csrf_cookie_name'; 34 | public $CSRFExpire = 7200; 35 | public $CSRFRegenerate = true; 36 | public $CSRFExcludeURIs = ['http://example.com']; 37 | public $CSRFSameSite = 'Lax'; 38 | 39 | public $CSPEnabled = false; 40 | 41 | public $defaultLocale = 'en'; 42 | public $negotiateLocale = false; 43 | public $supportedLocales = [ 44 | 'en', 45 | 'es', 46 | ]; 47 | } 48 | -------------------------------------------------------------------------------- /system/Test/Mock/MockCURLRequest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Test\Mock; 13 | 14 | use CodeIgniter\HTTP\CURLRequest; 15 | 16 | /** 17 | * Class MockCURLRequest 18 | * 19 | * Simply allows us to not actually call cURL during the 20 | * test runs. Instead, we can set the desired output 21 | * and get back the set options. 22 | */ 23 | class MockCURLRequest extends CURLRequest 24 | { 25 | public $curl_options; 26 | 27 | protected $output = ''; 28 | 29 | //-------------------------------------------------------------------- 30 | 31 | public function setOutput($output) 32 | { 33 | $this->output = $output; 34 | 35 | return $this; 36 | } 37 | 38 | //-------------------------------------------------------------------- 39 | 40 | protected function sendRequest(array $curlOptions = []): string 41 | { 42 | // Save so we can access later. 43 | $this->curl_options = $curlOptions; 44 | 45 | return $this->output; 46 | } 47 | 48 | //-------------------------------------------------------------------- 49 | // for testing purposes only 50 | public function getBaseURI() 51 | { 52 | return $this->baseURI; 53 | } 54 | 55 | // for testing purposes only 56 | public function getDelay() 57 | { 58 | return $this->delay; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /system/Test/Mock/MockCodeIgniter.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Test\Mock; 13 | 14 | use CodeIgniter\CodeIgniter; 15 | 16 | class MockCodeIgniter extends CodeIgniter 17 | { 18 | protected function callExit($code) 19 | { 20 | // Do not call exit() in testing. 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /system/Test/Mock/MockCommon.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | if (! function_exists('is_cli')) 13 | { 14 | /** 15 | * Is CLI? 16 | * 17 | * Test to see if a request was made from the command line. 18 | * You can set the return value for testing. 19 | * 20 | * @param boolean $newReturn return value to set 21 | * @return boolean 22 | */ 23 | function is_cli(bool $newReturn = null): bool 24 | { 25 | // PHPUnit always runs via CLI. 26 | static $returnValue = true; 27 | 28 | if ($newReturn !== null) 29 | { 30 | $returnValue = $newReturn; 31 | } 32 | 33 | return $returnValue; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /system/Test/Mock/MockEmail.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Test\Mock; 13 | 14 | use CodeIgniter\Email\Email; 15 | use CodeIgniter\Events\Events; 16 | 17 | class MockEmail extends Email 18 | { 19 | /** 20 | * Value to return from mocked send(). 21 | * 22 | * @var boolean 23 | */ 24 | public $returnValue = true; 25 | 26 | public function send($autoClear = true) 27 | { 28 | if ($this->returnValue) 29 | { 30 | $this->setArchiveValues(); 31 | 32 | if ($autoClear) 33 | { 34 | $this->clear(); 35 | } 36 | 37 | Events::trigger('email', $this->archive); 38 | } 39 | 40 | return $this->returnValue; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /system/Test/Mock/MockEvents.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Test\Mock; 13 | 14 | use CodeIgniter\Events\Events; 15 | 16 | /** 17 | * Events 18 | */ 19 | class MockEvents extends Events 20 | { 21 | public function getListeners() 22 | { 23 | return self::$listeners; 24 | } 25 | 26 | public function getEventsFile() 27 | { 28 | return self::$files; 29 | } 30 | 31 | public function getSimulate() 32 | { 33 | return self::$simulate; 34 | } 35 | 36 | public function unInitialize() 37 | { 38 | static::$initialized = false; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /system/Test/Mock/MockFileLogger.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Test\Mock; 13 | 14 | use CodeIgniter\Log\Handlers\FileHandler; 15 | 16 | /** 17 | * Class MockFileLogger 18 | * 19 | * Extends FileHandler, exposing some inner workings 20 | */ 21 | class MockFileLogger extends FileHandler 22 | { 23 | /** 24 | * Where would the log be written? 25 | */ 26 | public $destination; 27 | 28 | //-------------------------------------------------------------------- 29 | 30 | public function __construct(array $config) 31 | { 32 | parent::__construct($config); 33 | $this->handles = $config['handles'] ?? []; 34 | $this->destination = $this->path . 'log-' . date('Y-m-d') . '.' . $this->fileExtension; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /system/Test/Mock/MockIncomingRequest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Test\Mock; 13 | 14 | use CodeIgniter\HTTP\IncomingRequest; 15 | 16 | class MockIncomingRequest extends IncomingRequest 17 | { 18 | // public function populateHeaders() 19 | // { 20 | // // Don't do anything... force the tester to manually set the headers they want. 21 | // } 22 | 23 | public function detectURI($protocol, $baseURL) 24 | { 25 | // Do nothing... 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /system/Test/Mock/MockLanguage.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Test\Mock; 13 | 14 | use CodeIgniter\Language\Language; 15 | 16 | class MockLanguage extends Language 17 | { 18 | /** 19 | * Stores the data that should be 20 | * returned by the 'requireFile()' method. 21 | * 22 | * @var mixed 23 | */ 24 | protected $data; 25 | 26 | //-------------------------------------------------------------------- 27 | 28 | /** 29 | * Sets the data that should be returned by the 30 | * 'requireFile()' method to allow easy overrides 31 | * during testing. 32 | * 33 | * @param array $data 34 | * @param string $file 35 | * @param string|null $locale 36 | * 37 | * @return $this 38 | */ 39 | public function setData(string $file, array $data, string $locale = null) 40 | { 41 | $this->language[$locale ?? $this->locale][$file] = $data; 42 | 43 | return $this; 44 | } 45 | 46 | //-------------------------------------------------------------------- 47 | 48 | /** 49 | * Provides an override that allows us to set custom 50 | * data to be returned easily during testing. 51 | * 52 | * @param string $path 53 | * 54 | * @return array 55 | */ 56 | protected function requireFile(string $path): array 57 | { 58 | return $this->data ?? []; 59 | } 60 | 61 | //-------------------------------------------------------------------- 62 | 63 | /** 64 | * Arbitrarily turnoff internationalization support for testing 65 | */ 66 | public function disableIntlSupport() 67 | { 68 | $this->intlSupport = false; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /system/Test/Mock/MockQuery.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Test\Mock; 13 | 14 | use CodeIgniter\Database\Query; 15 | 16 | class MockQuery extends Query 17 | { 18 | } 19 | -------------------------------------------------------------------------------- /system/Test/Mock/MockResourceController.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Test\Mock; 13 | 14 | use CodeIgniter\RESTful\ResourceController; 15 | 16 | class MockResourceController extends ResourceController 17 | { 18 | public function getModel() 19 | { 20 | return $this->model; 21 | } 22 | 23 | public function getModelName() 24 | { 25 | return $this->modelName; 26 | } 27 | 28 | public function getFormat() 29 | { 30 | return $this->format; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /system/Test/Mock/MockResourcePresenter.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Test\Mock; 13 | 14 | use CodeIgniter\API\ResponseTrait; 15 | use CodeIgniter\RESTful\ResourcePresenter; 16 | 17 | class MockResourcePresenter extends ResourcePresenter 18 | { 19 | use ResponseTrait; 20 | 21 | public function getModel() 22 | { 23 | return $this->model; 24 | } 25 | 26 | public function getModelName() 27 | { 28 | return $this->modelName; 29 | } 30 | 31 | public function getFormat() 32 | { 33 | return $this->format; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /system/Test/Mock/MockResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Test\Mock; 13 | 14 | use CodeIgniter\HTTP\Response; 15 | 16 | /** 17 | * Class MockResponse 18 | */ 19 | class MockResponse extends Response 20 | { 21 | /** 22 | * If true, will not write output. Useful during testing. 23 | * 24 | * @var boolean 25 | */ 26 | protected $pretend = true; 27 | 28 | // for testing 29 | public function getPretend() 30 | { 31 | return $this->pretend; 32 | } 33 | 34 | // artificial error for testing 35 | public function misbehave() 36 | { 37 | $this->statusCode = 0; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /system/Test/Mock/MockSecurity.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Test\Mock; 13 | 14 | use CodeIgniter\HTTP\RequestInterface; 15 | use CodeIgniter\Security\Security; 16 | 17 | class MockSecurity extends Security 18 | { 19 | public function sendCookie(RequestInterface $request) 20 | { 21 | $_COOKIE['csrf_cookie_name'] = $this->hash; 22 | 23 | return $this; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /system/Test/Mock/MockSecurityConfig.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Test\Mock; 13 | 14 | use CodeIgniter\Config\BaseService; 15 | use CodeIgniter\Autoloader\FileLocator; 16 | 17 | class MockServices extends BaseService 18 | { 19 | public $psr4 = [ 20 | 'Tests/Support' => TESTPATH . '_support/', 21 | ]; 22 | 23 | public $classmap = []; 24 | 25 | //-------------------------------------------------------------------- 26 | 27 | public function __construct() 28 | { 29 | // Don't call the parent since we don't want the default mappings. 30 | // parent::__construct(); 31 | } 32 | 33 | //-------------------------------------------------------------------- 34 | public static function locator(bool $getShared = true) 35 | { 36 | return new FileLocator(static::autoloader()); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /system/Test/Mock/MockSession.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Test\Mock; 13 | 14 | use CodeIgniter\Cookie\Cookie; 15 | use CodeIgniter\Session\Session; 16 | 17 | /** 18 | * Class MockSession 19 | * 20 | * Provides a safe way to test the Session class itself, 21 | * that doesn't interact with the session or cookies at all. 22 | */ 23 | class MockSession extends Session 24 | { 25 | /** 26 | * Holds our "cookie" data. 27 | * 28 | * @var Cookie[] 29 | */ 30 | public $cookies = []; 31 | 32 | public $didRegenerate = false; 33 | 34 | /** 35 | * Sets the driver as the session handler in PHP. 36 | * Extracted for easier testing. 37 | */ 38 | protected function setSaveHandler() 39 | { 40 | // session_set_save_handler($this->driver, true); 41 | } 42 | 43 | /** 44 | * Starts the session. 45 | * Extracted for testing reasons. 46 | */ 47 | protected function startSession() 48 | { 49 | // session_start(); 50 | $this->setCookie(); 51 | } 52 | 53 | /** 54 | * Takes care of setting the cookie on the client side. 55 | * Extracted for testing reasons. 56 | */ 57 | protected function setCookie() 58 | { 59 | $expiration = $this->sessionExpiration === 0 ? 0 : time() + $this->sessionExpiration; 60 | $this->cookie = $this->cookie->withValue(session_id())->withExpires($expiration); 61 | 62 | $this->cookies[] = $this->cookie; 63 | } 64 | 65 | public function regenerate(bool $destroy = false) 66 | { 67 | $this->didRegenerate = true; 68 | $_SESSION['__ci_last_regenerate'] = time(); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /system/Test/Mock/MockTable.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Test\Mock; 13 | 14 | use BadMethodCallException; 15 | use CodeIgniter\View\Table; 16 | 17 | class MockTable extends Table 18 | { 19 | // Override inaccessible protected method 20 | public function __call($method, $params) 21 | { 22 | if (is_callable([$this, '_' . $method])) 23 | { 24 | return call_user_func_array([$this, '_' . $method], $params); 25 | } 26 | 27 | throw new BadMethodCallException('Method ' . $method . ' was not found'); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /system/ThirdParty/Escaper/Exception/ExceptionInterface.php: -------------------------------------------------------------------------------- 1 | resource_type) { 35 | return $this->resource_type.' resource'; 36 | } 37 | 38 | return 'resource'; 39 | } 40 | 41 | public function transplant(BasicObject $old) 42 | { 43 | parent::transplant($old); 44 | 45 | if ($old instanceof self) { 46 | $this->resource_type = $old->resource_type; 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /system/ThirdParty/Kint/Object/TraceObject.php: -------------------------------------------------------------------------------- 1 | size) { 40 | return 'empty'; 41 | } 42 | 43 | return parent::getSize(); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /system/ThirdParty/Kint/Renderer/Rich/BlacklistPlugin.php: -------------------------------------------------------------------------------- 1 | '.$this->renderLockedHeader($o, 'Blacklisted').''; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /system/ThirdParty/Kint/Renderer/Rich/DepthLimitPlugin.php: -------------------------------------------------------------------------------- 1 | '.$this->renderLockedHeader($o, 'Depth Limit').''; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /system/ThirdParty/Kint/Renderer/Rich/ObjectPluginInterface.php: -------------------------------------------------------------------------------- 1 | '.$this->renderLockedHeader($o, 'Recursion').''; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /system/ThirdParty/Kint/Renderer/Rich/TabPluginInterface.php: -------------------------------------------------------------------------------- 1 | contents); 37 | 38 | if ($dt) { 39 | return '
'.$dt->setTimeZone(new DateTimeZone('UTC'))->format('Y-m-d H:i:s T').'
'; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /system/ThirdParty/Kint/Renderer/Text/BlacklistPlugin.php: -------------------------------------------------------------------------------- 1 | depth) { 37 | $out .= $this->renderer->colorTitle($this->renderer->renderTitle($o)).PHP_EOL; 38 | } 39 | 40 | $out .= $this->renderer->renderHeader($o).' '.$this->renderer->colorValue('BLACKLISTED').PHP_EOL; 41 | 42 | return $out; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /system/ThirdParty/Kint/Renderer/Text/DepthLimitPlugin.php: -------------------------------------------------------------------------------- 1 | depth) { 37 | $out .= $this->renderer->colorTitle($this->renderer->renderTitle($o)).PHP_EOL; 38 | } 39 | 40 | $out .= $this->renderer->renderHeader($o).' '.$this->renderer->colorValue('DEPTH LIMIT').PHP_EOL; 41 | 42 | return $out; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /system/ThirdParty/Kint/Renderer/Text/Plugin.php: -------------------------------------------------------------------------------- 1 | renderer = $r; 38 | } 39 | 40 | abstract public function render(BasicObject $o); 41 | } 42 | -------------------------------------------------------------------------------- /system/ThirdParty/Kint/Renderer/Text/RecursionPlugin.php: -------------------------------------------------------------------------------- 1 | depth) { 37 | $out .= $this->renderer->colorTitle($this->renderer->renderTitle($o)).PHP_EOL; 38 | } 39 | 40 | $out .= $this->renderer->renderHeader($o).' '.$this->renderer->colorValue('RECURSION').PHP_EOL; 41 | 42 | return $out; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /system/ThirdParty/Kint/resources/compiled/microtime.js: -------------------------------------------------------------------------------- 1 | void 0===window.kintMicrotimeInitialized&&(window.kintMicrotimeInitialized=1,window.addEventListener("load",function(){"use strict";var c={},i=Array.prototype.slice.call(document.querySelectorAll("[data-kint-microtime-group]"),0);i.forEach(function(i){if(i.querySelector(".kint-microtime-lap")){var t=i.getAttribute("data-kint-microtime-group"),e=parseFloat(i.querySelector(".kint-microtime-lap").innerHTML),r=parseFloat(i.querySelector(".kint-microtime-avg").innerHTML);void 0===c[t]&&(c[t]={}),(void 0===c[t].min||c[t].min>e)&&(c[t].min=e),(void 0===c[t].max||c[t].maxlogger = $logger; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /system/ThirdParty/PSR/Log/NullLogger.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 | * 22 | * @return void 23 | * 24 | * @throws \Psr\Log\InvalidArgumentException 25 | */ 26 | public function log($level, $message, array $context = array()) 27 | { 28 | // noop 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /system/Throttle/ThrottlerInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Throttle; 13 | 14 | /** 15 | * Expected behavior of a Throttler 16 | */ 17 | interface ThrottlerInterface 18 | { 19 | /** 20 | * Restricts the number of requests made by a single key within 21 | * a set number of seconds. 22 | * 23 | * Example: 24 | * 25 | * if (! $throttler->checkIPAddress($request->ipAddress(), 60, MINUTE)) 26 | * { 27 | * die('You submitted over 60 requests within a minute.'); 28 | * } 29 | * 30 | * @param string $key The name to use as the "bucket" name. 31 | * @param integer $capacity The number of requests the "bucket" can hold 32 | * @param integer $seconds The time it takes the "bucket" to completely refill 33 | * @param integer $cost The number of tokens this action uses. 34 | * 35 | * @return boolean 36 | */ 37 | public function check(string $key, int $capacity, int $seconds, int $cost); 38 | 39 | //-------------------------------------------------------------------- 40 | 41 | /** 42 | * Returns the number of seconds until the next available token will 43 | * be released for usage. 44 | * 45 | * @return integer 46 | */ 47 | public function getTokenTime(): int; 48 | } 49 | -------------------------------------------------------------------------------- /system/Validation/Exceptions/ValidationException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\Validation\Exceptions; 13 | 14 | use CodeIgniter\Exceptions\FrameworkException; 15 | 16 | class ValidationException extends FrameworkException 17 | { 18 | public static function forRuleNotFound(string $rule = null) 19 | { 20 | return new static(lang('Validation.ruleNotFound', [$rule])); 21 | } 22 | 23 | public static function forGroupNotFound(string $group = null) 24 | { 25 | return new static(lang('Validation.groupNotFound', [$group])); 26 | } 27 | 28 | public static function forGroupNotArray(string $group = null) 29 | { 30 | return new static(lang('Validation.groupNotArray', [$group])); 31 | } 32 | 33 | public static function forInvalidTemplate(string $template = null) 34 | { 35 | return new static(lang('Validation.invalidTemplate', [$template])); 36 | } 37 | 38 | public static function forNoRuleSets() 39 | { 40 | return new static(lang('Validation.noRuleSets')); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /system/Validation/Views/list.php: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | -------------------------------------------------------------------------------- /system/Validation/Views/single.php: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /system/View/Exceptions/ViewException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CodeIgniter\View\Exceptions; 13 | 14 | use CodeIgniter\Exceptions\FrameworkException; 15 | 16 | class ViewException extends FrameworkException 17 | { 18 | public static function forInvalidCellMethod(string $class, string $method) 19 | { 20 | return new static(lang('View.invalidCellMethod', ['class' => $class, 'method' => $method])); 21 | } 22 | 23 | public static function forMissingCellParameters(string $class, string $method) 24 | { 25 | return new static(lang('View.missingCellParameters', ['class' => $class, 'method' => $method])); 26 | } 27 | 28 | public static function forInvalidCellParameter(string $key) 29 | { 30 | return new static(lang('View.invalidCellParameter', [$key])); 31 | } 32 | 33 | public static function forNoCellClass() 34 | { 35 | return new static(lang('View.noCellClass')); 36 | } 37 | 38 | public static function forInvalidCellClass(string $class = null) 39 | { 40 | return new static(lang('View.invalidCellClass', [$class])); 41 | } 42 | 43 | public static function forTagSyntaxError(string $output) 44 | { 45 | return new static(lang('View.tagSyntaxError', [$output])); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /system/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 403 Forbidden 5 | 6 | 7 | 8 |

Directory access is forbidden.

9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /uploads/.do_not_delete: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /writable/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | Require all denied 3 | 4 | 5 | Deny from all 6 | 7 | -------------------------------------------------------------------------------- /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 | --------------------------------------------------------------------------------