├── CHANGELOG.md ├── LICENSE ├── README.md ├── SECURITY.md ├── app ├── .htaccess ├── Common.php ├── Config │ ├── App.php │ ├── Autoload.php │ ├── Boot │ │ ├── development.php │ │ ├── production.php │ │ └── testing.php │ ├── CURLRequest.php │ ├── Cache.php │ ├── Constants.php │ ├── ContentSecurityPolicy.php │ ├── Cookie.php │ ├── Cors.php │ ├── Database.php │ ├── DocTypes.php │ ├── Email.php │ ├── Encryption.php │ ├── Events.php │ ├── Exceptions.php │ ├── Feature.php │ ├── Filters.php │ ├── ForeignCharacters.php │ ├── Format.php │ ├── Generators.php │ ├── Honeypot.php │ ├── Images.php │ ├── Kint.php │ ├── Logger.php │ ├── Migrations.php │ ├── Mimes.php │ ├── Modules.php │ ├── Optimize.php │ ├── Pager.php │ ├── Paths.php │ ├── Publisher.php │ ├── Routes.php │ ├── Routing.php │ ├── Security.php │ ├── Services.php │ ├── Session.php │ ├── Toolbar.php │ ├── UserAgents.php │ ├── Validation.php │ └── View.php ├── Controllers │ ├── BaseController.php │ └── Home.php ├── Database │ ├── Migrations │ │ └── .gitkeep │ └── Seeds │ │ └── .gitkeep ├── Filters │ └── .gitkeep ├── Helpers │ └── .gitkeep ├── Language │ ├── .gitkeep │ └── en │ │ └── Validation.php ├── Libraries │ └── .gitkeep ├── Models │ └── .gitkeep ├── ThirdParty │ └── .gitkeep ├── Views │ ├── errors │ │ ├── cli │ │ │ ├── error_404.php │ │ │ ├── error_exception.php │ │ │ └── production.php │ │ └── html │ │ │ ├── debug.css │ │ │ ├── debug.js │ │ │ ├── error_400.php │ │ │ ├── error_404.php │ │ │ ├── error_exception.php │ │ │ └── production.php │ └── welcome_message.php └── index.html ├── changelogs ├── CHANGELOG_4.0.md ├── CHANGELOG_4.1.md ├── CHANGELOG_4.2.md └── CHANGELOG_4.3.md ├── composer.json ├── env ├── preload.php ├── psalm-autoload.php ├── public ├── .htaccess ├── favicon.ico ├── index.php └── robots.txt ├── spark ├── system ├── .htaccess ├── API │ └── ResponseTrait.php ├── Autoloader │ ├── Autoloader.php │ ├── FileLocator.php │ ├── FileLocatorCached.php │ └── FileLocatorInterface.php ├── BaseModel.php ├── Boot.php ├── CLI │ ├── BaseCommand.php │ ├── CLI.php │ ├── Commands.php │ ├── Console.php │ ├── Exceptions │ │ └── CLIException.php │ ├── GeneratorTrait.php │ └── InputOutput.php ├── Cache │ ├── CacheFactory.php │ ├── CacheInterface.php │ ├── Exceptions │ │ └── CacheException.php │ ├── FactoriesCache.php │ ├── FactoriesCache │ │ └── FileVarExportHandler.php │ ├── Handlers │ │ ├── BaseHandler.php │ │ ├── DummyHandler.php │ │ ├── FileHandler.php │ │ ├── MemcachedHandler.php │ │ ├── PredisHandler.php │ │ ├── RedisHandler.php │ │ └── WincacheHandler.php │ └── ResponseCache.php ├── CodeIgniter.php ├── Commands │ ├── Cache │ │ ├── ClearCache.php │ │ └── InfoCache.php │ ├── Database │ │ ├── CreateDatabase.php │ │ ├── Migrate.php │ │ ├── MigrateRefresh.php │ │ ├── MigrateRollback.php │ │ ├── MigrateStatus.php │ │ ├── Seed.php │ │ └── ShowTableInfo.php │ ├── Encryption │ │ └── GenerateKey.php │ ├── Generators │ │ ├── CellGenerator.php │ │ ├── CommandGenerator.php │ │ ├── ConfigGenerator.php │ │ ├── ControllerGenerator.php │ │ ├── EntityGenerator.php │ │ ├── FilterGenerator.php │ │ ├── MigrationGenerator.php │ │ ├── ModelGenerator.php │ │ ├── ScaffoldGenerator.php │ │ ├── SeederGenerator.php │ │ ├── TestGenerator.php │ │ ├── ValidationGenerator.php │ │ └── Views │ │ │ ├── cell.tpl.php │ │ │ ├── cell_view.tpl.php │ │ │ ├── command.tpl.php │ │ │ ├── config.tpl.php │ │ │ ├── controller.tpl.php │ │ │ ├── entity.tpl.php │ │ │ ├── filter.tpl.php │ │ │ ├── migration.tpl.php │ │ │ ├── model.tpl.php │ │ │ ├── seeder.tpl.php │ │ │ ├── test.tpl.php │ │ │ └── validation.tpl.php │ ├── Help.php │ ├── Housekeeping │ │ ├── ClearDebugbar.php │ │ └── ClearLogs.php │ ├── ListCommands.php │ ├── Server │ │ └── Serve.php │ ├── Translation │ │ ├── LocalizationFinder.php │ │ └── LocalizationSync.php │ └── Utilities │ │ ├── ConfigCheck.php │ │ ├── Environment.php │ │ ├── FilterCheck.php │ │ ├── Namespaces.php │ │ ├── Optimize.php │ │ ├── PhpIniCheck.php │ │ ├── Publish.php │ │ ├── Routes.php │ │ └── Routes │ │ ├── AutoRouteCollector.php │ │ ├── AutoRouterImproved │ │ ├── AutoRouteCollector.php │ │ └── ControllerMethodReader.php │ │ ├── ControllerFinder.php │ │ ├── ControllerMethodReader.php │ │ ├── FilterCollector.php │ │ ├── FilterFinder.php │ │ └── SampleURIGenerator.php ├── Common.php ├── ComposerScripts.php ├── Config │ ├── AutoloadConfig.php │ ├── BaseConfig.php │ ├── BaseService.php │ ├── DotEnv.php │ ├── Factories.php │ ├── Factory.php │ ├── Filters.php │ ├── ForeignCharacters.php │ ├── Publisher.php │ ├── Routing.php │ ├── Services.php │ └── View.php ├── Controller.php ├── Cookie │ ├── CloneableCookieInterface.php │ ├── Cookie.php │ ├── CookieInterface.php │ ├── CookieStore.php │ └── Exceptions │ │ └── CookieException.php ├── DataCaster │ ├── Cast │ │ ├── ArrayCast.php │ │ ├── BaseCast.php │ │ ├── BooleanCast.php │ │ ├── CSVCast.php │ │ ├── CastInterface.php │ │ ├── DatetimeCast.php │ │ ├── FloatCast.php │ │ ├── IntBoolCast.php │ │ ├── IntegerCast.php │ │ ├── JsonCast.php │ │ ├── TimestampCast.php │ │ └── URICast.php │ ├── DataCaster.php │ └── Exceptions │ │ └── CastException.php ├── DataConverter │ └── DataConverter.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 │ ├── MySQLi │ │ ├── Builder.php │ │ ├── Connection.php │ │ ├── Forge.php │ │ ├── PreparedQuery.php │ │ ├── Result.php │ │ └── Utils.php │ ├── OCI8 │ │ ├── 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 │ ├── RawSql.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 │ └── TableName.php ├── Debug │ ├── BaseExceptionHandler.php │ ├── ExceptionHandler.php │ ├── ExceptionHandlerInterface.php │ ├── 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 ├── Email │ └── Email.php ├── Encryption │ ├── EncrypterInterface.php │ ├── Encryption.php │ ├── Exceptions │ │ └── EncryptionException.php │ └── Handlers │ │ ├── BaseHandler.php │ │ ├── OpenSSLHandler.php │ │ └── SodiumHandler.php ├── Entity │ ├── Cast │ │ ├── ArrayCast.php │ │ ├── BaseCast.php │ │ ├── BooleanCast.php │ │ ├── CSVCast.php │ │ ├── CastInterface.php │ │ ├── DatetimeCast.php │ │ ├── FloatCast.php │ │ ├── IntBoolCast.php │ │ ├── IntegerCast.php │ │ ├── JsonCast.php │ │ ├── ObjectCast.php │ │ ├── StringCast.php │ │ ├── TimestampCast.php │ │ └── URICast.php │ ├── Entity.php │ └── Exceptions │ │ └── CastException.php ├── Events │ └── Events.php ├── Exceptions │ ├── BadFunctionCallException.php │ ├── BadMethodCallException.php │ ├── ConfigException.php │ ├── CriticalError.php │ ├── DebugTraceableTrait.php │ ├── DownloadException.php │ ├── ExceptionInterface.php │ ├── FrameworkException.php │ ├── HTTPExceptionInterface.php │ ├── HasExitCodeInterface.php │ ├── InvalidArgumentException.php │ ├── LogicException.php │ ├── ModelException.php │ ├── PageNotFoundException.php │ ├── RuntimeException.php │ └── TestException.php ├── Files │ ├── Exceptions │ │ ├── ExceptionInterface.php │ │ ├── FileException.php │ │ └── FileNotFoundException.php │ ├── File.php │ ├── FileCollection.php │ └── FileSizeUnit.php ├── Filters │ ├── CSRF.php │ ├── Cors.php │ ├── DebugToolbar.php │ ├── Exceptions │ │ └── FilterException.php │ ├── FilterInterface.php │ ├── Filters.php │ ├── ForceHTTPS.php │ ├── Honeypot.php │ ├── InvalidChars.php │ ├── PageCache.php │ ├── PerformanceMetrics.php │ └── SecureHeaders.php ├── Format │ ├── Exceptions │ │ └── FormatException.php │ ├── Format.php │ ├── FormatterInterface.php │ ├── JSONFormatter.php │ └── XMLFormatter.php ├── HTTP │ ├── CLIRequest.php │ ├── CURLRequest.php │ ├── ContentSecurityPolicy.php │ ├── Cors.php │ ├── DownloadResponse.php │ ├── Exceptions │ │ ├── BadRequestException.php │ │ ├── ExceptionInterface.php │ │ ├── HTTPException.php │ │ └── RedirectException.php │ ├── Files │ │ ├── FileCollection.php │ │ ├── UploadedFile.php │ │ └── UploadedFileInterface.php │ ├── Header.php │ ├── IncomingRequest.php │ ├── Message.php │ ├── MessageInterface.php │ ├── MessageTrait.php │ ├── Method.php │ ├── Negotiate.php │ ├── OutgoingRequest.php │ ├── OutgoingRequestInterface.php │ ├── RedirectResponse.php │ ├── Request.php │ ├── RequestInterface.php │ ├── RequestTrait.php │ ├── ResponsableInterface.php │ ├── Response.php │ ├── ResponseInterface.php │ ├── ResponseTrait.php │ ├── SiteURI.php │ ├── SiteURIFactory.php │ ├── URI.php │ └── UserAgent.php ├── Helpers │ ├── Array │ │ └── ArrayHelper.php │ ├── array_helper.php │ ├── cookie_helper.php │ ├── date_helper.php │ ├── filesystem_helper.php │ ├── form_helper.php │ ├── html_helper.php │ ├── inflector_helper.php │ ├── kint_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 ├── HotReloader │ ├── DirectoryHasher.php │ ├── HotReloader.php │ └── IteratorFilter.php ├── I18n │ ├── Exceptions │ │ └── I18nException.php │ ├── Time.php │ ├── TimeDifference.php │ ├── TimeLegacy.php │ └── TimeTrait.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 │ │ ├── Errors.php │ │ ├── Fabricator.php │ │ ├── Files.php │ │ ├── Filters.php │ │ ├── Format.php │ │ ├── HTTP.php │ │ ├── Images.php │ │ ├── Language.php │ │ ├── Log.php │ │ ├── Migrations.php │ │ ├── Number.php │ │ ├── Pager.php │ │ ├── Publisher.php │ │ ├── RESTful.php │ │ ├── Router.php │ │ ├── Security.php │ │ ├── Session.php │ │ ├── Test.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 ├── Publisher │ ├── ContentReplacer.php │ ├── Exceptions │ │ └── PublisherException.php │ └── Publisher.php ├── RESTful │ ├── BaseResource.php │ ├── ResourceController.php │ └── ResourcePresenter.php ├── Router │ ├── AutoRouter.php │ ├── AutoRouterImproved.php │ ├── AutoRouterInterface.php │ ├── DefinedRouteCollector.php │ ├── Exceptions │ │ ├── ExceptionInterface.php │ │ ├── MethodNotFoundException.php │ │ └── RouterException.php │ ├── RouteCollection.php │ ├── RouteCollectionInterface.php │ ├── Router.php │ └── RouterInterface.php ├── Security │ ├── CheckPhpIni.php │ ├── Exceptions │ │ └── SecurityException.php │ ├── Security.php │ └── SecurityInterface.php ├── Session │ ├── Exceptions │ │ └── SessionException.php │ ├── Handlers │ │ ├── ArrayHandler.php │ │ ├── BaseHandler.php │ │ ├── Database │ │ │ ├── MySQLiHandler.php │ │ │ └── PostgreHandler.php │ │ ├── DatabaseHandler.php │ │ ├── FileHandler.php │ │ ├── MemcachedHandler.php │ │ └── RedisHandler.php │ ├── Session.php │ └── SessionInterface.php ├── Superglobals.php ├── Test │ ├── CIUnitTestCase.php │ ├── ConfigFromArrayTrait.php │ ├── Constraints │ │ └── SeeInDatabase.php │ ├── ControllerTestTrait.php │ ├── DOMParser.php │ ├── DatabaseTestTrait.php │ ├── Fabricator.php │ ├── FeatureTestTrait.php │ ├── FilterTestTrait.php │ ├── Filters │ │ └── CITestStreamFilter.php │ ├── IniTestTrait.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 │ │ ├── MockInputOutput.php │ │ ├── MockLanguage.php │ │ ├── MockLogger.php │ │ ├── MockQuery.php │ │ ├── MockResourceController.php │ │ ├── MockResourcePresenter.php │ │ ├── MockResponse.php │ │ ├── MockResult.php │ │ ├── MockSecurity.php │ │ ├── MockServices.php │ │ ├── MockSession.php │ │ └── MockTable.php │ ├── PhpStreamWrapper.php │ ├── ReflectionHelper.php │ ├── StreamFilterTrait.php │ ├── TestLogger.php │ ├── TestResponse.php │ └── bootstrap.php ├── ThirdParty │ ├── Escaper │ │ ├── Escaper.php │ │ ├── EscaperInterface.php │ │ ├── Exception │ │ │ ├── ExceptionInterface.php │ │ │ ├── InvalidArgumentException.php │ │ │ └── RuntimeException.php │ │ └── LICENSE.md │ ├── Kint │ │ ├── CallFinder.php │ │ ├── FacadeInterface.php │ │ ├── Kint.php │ │ ├── LICENSE │ │ ├── Parser │ │ │ ├── AbstractPlugin.php │ │ │ ├── ArrayLimitPlugin.php │ │ │ ├── ArrayObjectPlugin.php │ │ │ ├── Base64Plugin.php │ │ │ ├── BinaryPlugin.php │ │ │ ├── BlacklistPlugin.php │ │ │ ├── ClassHooksPlugin.php │ │ │ ├── ClassMethodsPlugin.php │ │ │ ├── ClassStaticsPlugin.php │ │ │ ├── ClassStringsPlugin.php │ │ │ ├── ClosurePlugin.php │ │ │ ├── ColorPlugin.php │ │ │ ├── ConstructablePluginInterface.php │ │ │ ├── DateTimePlugin.php │ │ │ ├── DomPlugin.php │ │ │ ├── EnumPlugin.php │ │ │ ├── FsPathPlugin.php │ │ │ ├── HtmlPlugin.php │ │ │ ├── IteratorPlugin.php │ │ │ ├── JsonPlugin.php │ │ │ ├── MicrotimePlugin.php │ │ │ ├── MysqliPlugin.php │ │ │ ├── Parser.php │ │ │ ├── PluginBeginInterface.php │ │ │ ├── PluginCompleteInterface.php │ │ │ ├── PluginInterface.php │ │ │ ├── ProfilePlugin.php │ │ │ ├── ProxyPlugin.php │ │ │ ├── SerializePlugin.php │ │ │ ├── SimpleXMLElementPlugin.php │ │ │ ├── SplFileInfoPlugin.php │ │ │ ├── StreamPlugin.php │ │ │ ├── TablePlugin.php │ │ │ ├── ThrowablePlugin.php │ │ │ ├── TimestampPlugin.php │ │ │ ├── ToStringPlugin.php │ │ │ ├── TracePlugin.php │ │ │ └── XmlPlugin.php │ │ ├── Renderer │ │ │ ├── AbstractRenderer.php │ │ │ ├── AssetRendererTrait.php │ │ │ ├── CliRenderer.php │ │ │ ├── ConstructableRendererInterface.php │ │ │ ├── PlainRenderer.php │ │ │ ├── RendererInterface.php │ │ │ ├── Rich │ │ │ │ ├── AbstractPlugin.php │ │ │ │ ├── BinaryPlugin.php │ │ │ │ ├── CallableDefinitionPlugin.php │ │ │ │ ├── CallablePlugin.php │ │ │ │ ├── ColorPlugin.php │ │ │ │ ├── LockPlugin.php │ │ │ │ ├── MicrotimePlugin.php │ │ │ │ ├── PluginInterface.php │ │ │ │ ├── ProfilePlugin.php │ │ │ │ ├── SourcePlugin.php │ │ │ │ ├── TabPluginInterface.php │ │ │ │ ├── TablePlugin.php │ │ │ │ ├── TraceFramePlugin.php │ │ │ │ └── ValuePluginInterface.php │ │ │ ├── RichRenderer.php │ │ │ ├── Text │ │ │ │ ├── AbstractPlugin.php │ │ │ │ ├── LockPlugin.php │ │ │ │ ├── MicrotimePlugin.php │ │ │ │ ├── PluginInterface.php │ │ │ │ ├── SplFileInfoPlugin.php │ │ │ │ └── TracePlugin.php │ │ │ └── TextRenderer.php │ │ ├── Utils.php │ │ ├── Value │ │ │ ├── AbstractValue.php │ │ │ ├── ArrayValue.php │ │ │ ├── ClosedResourceValue.php │ │ │ ├── ClosureValue.php │ │ │ ├── ColorValue.php │ │ │ ├── Context │ │ │ │ ├── ArrayContext.php │ │ │ │ ├── BaseContext.php │ │ │ │ ├── ClassConstContext.php │ │ │ │ ├── ClassDeclaredContext.php │ │ │ │ ├── ClassOwnedContext.php │ │ │ │ ├── ContextInterface.php │ │ │ │ ├── DoubleAccessMemberContext.php │ │ │ │ ├── MethodContext.php │ │ │ │ ├── PropertyContext.php │ │ │ │ └── StaticPropertyContext.php │ │ │ ├── DateTimeValue.php │ │ │ ├── DeclaredCallableBag.php │ │ │ ├── DomNodeListValue.php │ │ │ ├── DomNodeValue.php │ │ │ ├── EnumValue.php │ │ │ ├── FixedWidthValue.php │ │ │ ├── FunctionValue.php │ │ │ ├── InstanceValue.php │ │ │ ├── MethodValue.php │ │ │ ├── MicrotimeValue.php │ │ │ ├── ParameterBag.php │ │ │ ├── ParameterHoldingTrait.php │ │ │ ├── Representation │ │ │ │ ├── AbstractRepresentation.php │ │ │ │ ├── BinaryRepresentation.php │ │ │ │ ├── CallableDefinitionRepresentation.php │ │ │ │ ├── ColorRepresentation.php │ │ │ │ ├── ContainerRepresentation.php │ │ │ │ ├── MicrotimeRepresentation.php │ │ │ │ ├── ProfileRepresentation.php │ │ │ │ ├── RepresentationInterface.php │ │ │ │ ├── SourceRepresentation.php │ │ │ │ ├── SplFileInfoRepresentation.php │ │ │ │ ├── StringRepresentation.php │ │ │ │ ├── TableRepresentation.php │ │ │ │ └── ValueRepresentation.php │ │ │ ├── ResourceValue.php │ │ │ ├── SimpleXMLElementValue.php │ │ │ ├── SplFileInfoValue.php │ │ │ ├── StreamValue.php │ │ │ ├── StringValue.php │ │ │ ├── ThrowableValue.php │ │ │ ├── TraceFrameValue.php │ │ │ ├── TraceValue.php │ │ │ ├── UninitializedValue.php │ │ │ ├── UnknownValue.php │ │ │ └── VirtualValue.php │ │ ├── init.php │ │ ├── init_helpers.php │ │ └── resources │ │ │ └── compiled │ │ │ ├── aante-dark.css │ │ │ ├── aante-light.css │ │ │ ├── main.js │ │ │ ├── original.css │ │ │ ├── plain.css │ │ │ ├── solarized-dark.css │ │ │ └── solarized.css │ └── PSR │ │ └── Log │ │ ├── AbstractLogger.php │ │ ├── InvalidArgumentException.php │ │ ├── LICENSE │ │ ├── LogLevel.php │ │ ├── LoggerAwareInterface.php │ │ ├── LoggerAwareTrait.php │ │ ├── LoggerInterface.php │ │ ├── LoggerTrait.php │ │ └── NullLogger.php ├── Throttle │ ├── Throttler.php │ └── ThrottlerInterface.php ├── Traits │ ├── ConditionalTrait.php │ └── PropertiesTrait.php ├── Typography │ └── Typography.php ├── Validation │ ├── CreditCardRules.php │ ├── DotArrayFilter.php │ ├── Exceptions │ │ └── ValidationException.php │ ├── FileRules.php │ ├── FormatRules.php │ ├── Rules.php │ ├── StrictRules │ │ ├── CreditCardRules.php │ │ ├── FileRules.php │ │ ├── FormatRules.php │ │ └── Rules.php │ ├── Validation.php │ ├── ValidationInterface.php │ └── Views │ │ ├── list.php │ │ └── single.php ├── View │ ├── Cell.php │ ├── Cells │ │ └── Cell.php │ ├── Exceptions │ │ └── ViewException.php │ ├── Filters.php │ ├── Parser.php │ ├── Plugins.php │ ├── RendererInterface.php │ ├── Table.php │ ├── View.php │ ├── ViewDecoratorInterface.php │ └── ViewDecoratorTrait.php ├── bootstrap.php ├── index.html ├── rewrite.php └── util_bootstrap.php └── writable ├── .htaccess ├── cache └── index.html ├── debugbar └── index.html ├── index.html ├── logs └── index.html ├── session └── index.html └── uploads └── index.html /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014-2019 British Columbia Institute of Technology 4 | Copyright (c) 2019-present CodeIgniter Foundation 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | The development team and community take all security issues seriously. **Please do not make public any uncovered flaws.** 4 | 5 | ## Reporting a Vulnerability 6 | 7 | Thank you for improving the security of our code! Any assistance in removing security flaws will be acknowledged. 8 | 9 | **Please report security flaws by emailing the development team directly: security@codeigniter.com**. 10 | 11 | The lead maintainer will acknowledge your email within 48 hours, and will send a more detailed response within 48 hours indicating 12 | the next steps in handling your report. After the initial reply to your report, the security team will endeavor to keep you informed of the 13 | progress towards a fix and full announcement, and may ask for additional information or guidance. 14 | 15 | ## Disclosure Policy 16 | 17 | When the security team receives a security bug report, they will assign it to a primary handler. 18 | This person will coordinate the fix and release process, involving the following steps: 19 | 20 | - Confirm the problem and determine the affected versions. 21 | - Audit code to find any potential similar problems. 22 | - Prepare fixes for all releases still under maintenance. These fixes will be released as fast as possible. 23 | - Publish security advisories at https://github.com/codeigniter4/CodeIgniter4/security/advisories 24 | 25 | ## Comments on this Policy 26 | 27 | If you have suggestions on how this process could be improved please submit a Pull Request. 28 | -------------------------------------------------------------------------------- /app/.htaccess: -------------------------------------------------------------------------------- 1 | <IfModule authz_core_module> 2 | Require all denied 3 | </IfModule> 4 | <IfModule !authz_core_module> 5 | Deny from all 6 | </IfModule> 7 | -------------------------------------------------------------------------------- /app/Common.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /** 4 | * The goal of this file is to allow developers a location 5 | * where they can overwrite core procedural functions and 6 | * replace them with their own. This file is loaded during 7 | * the bootstrap process and is called during the framework's 8 | * execution. 9 | * 10 | * This can be looked at as a `master helper` file that is 11 | * loaded early on, and may also contain additional functions 12 | * that you'd like to use throughout your entire application 13 | * 14 | * @see: https://codeigniter.com/user_guide/extending/common.html 15 | */ 16 | -------------------------------------------------------------------------------- /app/Config/Boot/development.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /* 4 | |-------------------------------------------------------------------------- 5 | | ERROR DISPLAY 6 | |-------------------------------------------------------------------------- 7 | | In development, we want to show as many errors as possible to help 8 | | make sure they don't make it to production. And save us hours of 9 | | painful debugging. 10 | | 11 | | If you set 'display_errors' to '1', CI4's detailed error report will show. 12 | */ 13 | error_reporting(E_ALL); 14 | ini_set('display_errors', '1'); 15 | 16 | /* 17 | |-------------------------------------------------------------------------- 18 | | DEBUG BACKTRACES 19 | |-------------------------------------------------------------------------- 20 | | If true, this constant will tell the error screens to display debug 21 | | backtraces along with the other error information. If you would 22 | | prefer to not see this, set this value to false. 23 | */ 24 | defined('SHOW_DEBUG_BACKTRACE') || define('SHOW_DEBUG_BACKTRACE', true); 25 | 26 | /* 27 | |-------------------------------------------------------------------------- 28 | | DEBUG MODE 29 | |-------------------------------------------------------------------------- 30 | | Debug mode is an experimental flag that can allow changes throughout 31 | | the system. This will control whether Kint is loaded, and a few other 32 | | items. It can always be used within your own application too. 33 | */ 34 | defined('CI_DEBUG') || define('CI_DEBUG', true); 35 | -------------------------------------------------------------------------------- /app/Config/Boot/production.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /* 4 | |-------------------------------------------------------------------------- 5 | | ERROR DISPLAY 6 | |-------------------------------------------------------------------------- 7 | | Don't show ANY in production environments. Instead, let the system catch 8 | | it and display a generic error message. 9 | | 10 | | If you set 'display_errors' to '1', CI4's detailed error report will show. 11 | */ 12 | error_reporting(E_ALL & ~E_DEPRECATED); 13 | // If you want to suppress more types of errors. 14 | // error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED); 15 | ini_set('display_errors', '0'); 16 | 17 | /* 18 | |-------------------------------------------------------------------------- 19 | | DEBUG MODE 20 | |-------------------------------------------------------------------------- 21 | | Debug mode is an experimental flag that can allow changes throughout 22 | | the system. It's not widely used currently, and may not survive 23 | | release of the framework. 24 | */ 25 | defined('CI_DEBUG') || define('CI_DEBUG', false); 26 | -------------------------------------------------------------------------------- /app/Config/Boot/testing.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /* 4 | * The environment testing is reserved for PHPUnit testing. It has special 5 | * conditions built into the framework at various places to assist with that. 6 | * You can’t use it for your development. 7 | */ 8 | 9 | /* 10 | |-------------------------------------------------------------------------- 11 | | ERROR DISPLAY 12 | |-------------------------------------------------------------------------- 13 | | In development, we want to show as many errors as possible to help 14 | | make sure they don't make it to production. And save us hours of 15 | | painful debugging. 16 | */ 17 | error_reporting(E_ALL); 18 | ini_set('display_errors', '1'); 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | DEBUG BACKTRACES 23 | |-------------------------------------------------------------------------- 24 | | If true, this constant will tell the error screens to display debug 25 | | backtraces along with the other error information. If you would 26 | | prefer to not see this, set this value to false. 27 | */ 28 | defined('SHOW_DEBUG_BACKTRACE') || define('SHOW_DEBUG_BACKTRACE', true); 29 | 30 | /* 31 | |-------------------------------------------------------------------------- 32 | | DEBUG MODE 33 | |-------------------------------------------------------------------------- 34 | | Debug mode is an experimental flag that can allow changes throughout 35 | | the system. It's not widely used currently, and may not survive 36 | | release of the framework. 37 | */ 38 | defined('CI_DEBUG') || define('CI_DEBUG', true); 39 | -------------------------------------------------------------------------------- /app/Config/CURLRequest.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | namespace Config; 4 | 5 | use CodeIgniter\Config\BaseConfig; 6 | 7 | class CURLRequest extends BaseConfig 8 | { 9 | /** 10 | * -------------------------------------------------------------------------- 11 | * CURLRequest Share Options 12 | * -------------------------------------------------------------------------- 13 | * 14 | * Whether share options between requests or not. 15 | * 16 | * If true, all the options won't be reset between requests. 17 | * It may cause an error request with unnecessary headers. 18 | */ 19 | public bool $shareOptions = false; 20 | } 21 | -------------------------------------------------------------------------------- /app/Config/Feature.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | namespace Config; 4 | 5 | use CodeIgniter\Config\BaseConfig; 6 | 7 | /** 8 | * Enable/disable backward compatibility breaking features. 9 | */ 10 | class Feature extends BaseConfig 11 | { 12 | /** 13 | * Use improved new auto routing instead of the legacy version. 14 | */ 15 | public bool $autoRoutesImproved = true; 16 | 17 | /** 18 | * Use filter execution order in 4.4 or before. 19 | */ 20 | public bool $oldFilterOrder = false; 21 | 22 | /** 23 | * The behavior of `limit(0)` in Query Builder. 24 | * 25 | * If true, `limit(0)` returns all records. (the behavior of 4.4.x or before in version 4.x.) 26 | * If false, `limit(0)` returns no records. (the behavior of 3.1.9 or later in version 3.x.) 27 | */ 28 | public bool $limitZeroAsAll = true; 29 | 30 | /** 31 | * Use strict location negotiation. 32 | * 33 | * By default, the locale is selected based on a loose comparison of the language code (ISO 639-1) 34 | * Enabling strict comparison will also consider the region code (ISO 3166-1 alpha-2). 35 | */ 36 | public bool $strictLocaleNegotiation = false; 37 | } 38 | -------------------------------------------------------------------------------- /app/Config/ForeignCharacters.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | namespace Config; 4 | 5 | use CodeIgniter\Config\ForeignCharacters as BaseForeignCharacters; 6 | 7 | /** 8 | * @immutable 9 | */ 10 | class ForeignCharacters extends BaseForeignCharacters 11 | { 12 | } 13 | -------------------------------------------------------------------------------- /app/Config/Honeypot.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | namespace Config; 4 | 5 | use CodeIgniter\Config\BaseConfig; 6 | 7 | class Honeypot extends BaseConfig 8 | { 9 | /** 10 | * Makes Honeypot visible or not to human 11 | */ 12 | public bool $hidden = true; 13 | 14 | /** 15 | * Honeypot Label Content 16 | */ 17 | public string $label = 'Fill This Field'; 18 | 19 | /** 20 | * Honeypot Field Name 21 | */ 22 | public string $name = 'honeypot'; 23 | 24 | /** 25 | * Honeypot HTML Template 26 | */ 27 | public string $template = '<label>{label}</label><input type="text" name="{name}" value="">'; 28 | 29 | /** 30 | * Honeypot container 31 | * 32 | * If you enabled CSP, you can remove `style="display:none"`. 33 | */ 34 | public string $container = '<div style="display:none">{template}</div>'; 35 | 36 | /** 37 | * The id attribute for Honeypot container tag 38 | * 39 | * Used when CSP is enabled. 40 | */ 41 | public string $containerId = 'hpc'; 42 | } 43 | -------------------------------------------------------------------------------- /app/Config/Images.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | namespace Config; 4 | 5 | use CodeIgniter\Config\BaseConfig; 6 | use CodeIgniter\Images\Handlers\GDHandler; 7 | use CodeIgniter\Images\Handlers\ImageMagickHandler; 8 | 9 | class Images extends BaseConfig 10 | { 11 | /** 12 | * Default handler used if no other handler is specified. 13 | */ 14 | public string $defaultHandler = 'gd'; 15 | 16 | /** 17 | * The path to the image library. 18 | * Required for ImageMagick, GraphicsMagick, or NetPBM. 19 | */ 20 | public string $libraryPath = '/usr/local/bin/convert'; 21 | 22 | /** 23 | * The available handler classes. 24 | * 25 | * @var array<string, string> 26 | */ 27 | public array $handlers = [ 28 | 'gd' => GDHandler::class, 29 | 'imagick' => ImageMagickHandler::class, 30 | ]; 31 | } 32 | -------------------------------------------------------------------------------- /app/Config/Optimize.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | namespace Config; 4 | 5 | /** 6 | * Optimization Configuration. 7 | * 8 | * NOTE: This class does not extend BaseConfig for performance reasons. 9 | * So you cannot replace the property values with Environment Variables. 10 | */ 11 | class Optimize 12 | { 13 | /** 14 | * -------------------------------------------------------------------------- 15 | * Config Caching 16 | * -------------------------------------------------------------------------- 17 | * 18 | * @see https://codeigniter.com/user_guide/concepts/factories.html#config-caching 19 | */ 20 | public bool $configCacheEnabled = false; 21 | 22 | /** 23 | * -------------------------------------------------------------------------- 24 | * Config Caching 25 | * -------------------------------------------------------------------------- 26 | * 27 | * @see https://codeigniter.com/user_guide/concepts/autoloader.html#file-locator-caching 28 | */ 29 | public bool $locatorCacheEnabled = false; 30 | } 31 | -------------------------------------------------------------------------------- /app/Config/Pager.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | namespace Config; 4 | 5 | use CodeIgniter\Config\BaseConfig; 6 | 7 | class Pager extends BaseConfig 8 | { 9 | /** 10 | * -------------------------------------------------------------------------- 11 | * Templates 12 | * -------------------------------------------------------------------------- 13 | * 14 | * Pagination links are rendered out using views to configure their 15 | * appearance. This array contains aliases and the view names to 16 | * use when rendering the links. 17 | * 18 | * Within each view, the Pager object will be available as $pager, 19 | * and the desired group as $pagerGroup; 20 | * 21 | * @var array<string, string> 22 | */ 23 | public array $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 | public int $perPage = 20; 37 | } 38 | -------------------------------------------------------------------------------- /app/Config/Publisher.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | namespace Config; 4 | 5 | use CodeIgniter\Config\Publisher as BasePublisher; 6 | 7 | /** 8 | * Publisher Configuration 9 | * 10 | * Defines basic security restrictions for the Publisher class 11 | * to prevent abuse by injecting malicious files into a project. 12 | */ 13 | class Publisher extends BasePublisher 14 | { 15 | /** 16 | * A list of allowed destinations with a (pseudo-)regex 17 | * of allowed files for each destination. 18 | * Attempts to publish to directories not in this list will 19 | * result in a PublisherException. Files that do no fit the 20 | * pattern will cause copy/merge to fail. 21 | * 22 | * @var array<string, string> 23 | */ 24 | public $restrictions = [ 25 | ROOTPATH => '*', 26 | FCPATH => '#\.(s?css|js|map|html?|xml|json|webmanifest|ttf|eot|woff2?|gif|jpe?g|tiff?|png|webp|bmp|ico|svg)$#i', 27 | ]; 28 | } 29 | -------------------------------------------------------------------------------- /app/Config/Routes.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | use CodeIgniter\Router\RouteCollection; 4 | 5 | /** 6 | * @var RouteCollection $routes 7 | */ 8 | $routes->get('/', 'Home::index'); 9 | -------------------------------------------------------------------------------- /app/Config/Services.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | namespace Config; 4 | 5 | use CodeIgniter\Config\BaseService; 6 | 7 | /** 8 | * Services Configuration file. 9 | * 10 | * Services are simply other classes/libraries that the system uses 11 | * to do its job. This is used by CodeIgniter to allow the core of the 12 | * framework to be swapped out easily without affecting the usage within 13 | * the rest of your application. 14 | * 15 | * This file holds any application-specific services, or service overrides 16 | * that you might need. An example has been included with the general 17 | * method format you should use for your service methods. For more examples, 18 | * see the core Services file at system/Config/Services.php. 19 | */ 20 | class Services extends BaseService 21 | { 22 | /* 23 | * public static function example($getShared = true) 24 | * { 25 | * if ($getShared) { 26 | * return static::getSharedInstance('example'); 27 | * } 28 | * 29 | * return new \CodeIgniter\Example(); 30 | * } 31 | */ 32 | } 33 | -------------------------------------------------------------------------------- /app/Config/Validation.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | namespace Config; 4 | 5 | use CodeIgniter\Config\BaseConfig; 6 | use CodeIgniter\Validation\StrictRules\CreditCardRules; 7 | use CodeIgniter\Validation\StrictRules\FileRules; 8 | use CodeIgniter\Validation\StrictRules\FormatRules; 9 | use CodeIgniter\Validation\StrictRules\Rules; 10 | 11 | class Validation extends BaseConfig 12 | { 13 | // -------------------------------------------------------------------- 14 | // Setup 15 | // -------------------------------------------------------------------- 16 | 17 | /** 18 | * Stores the classes that contain the 19 | * rules that are available. 20 | * 21 | * @var list<string> 22 | */ 23 | public array $ruleSets = [ 24 | Rules::class, 25 | FormatRules::class, 26 | FileRules::class, 27 | CreditCardRules::class, 28 | ]; 29 | 30 | /** 31 | * Specifies the views that are used to display the 32 | * errors. 33 | * 34 | * @var array<string, string> 35 | */ 36 | public array $templates = [ 37 | 'list' => 'CodeIgniter\Validation\Views\list', 38 | 'single' => 'CodeIgniter\Validation\Views\single', 39 | ]; 40 | 41 | // -------------------------------------------------------------------- 42 | // Rules 43 | // -------------------------------------------------------------------- 44 | } 45 | -------------------------------------------------------------------------------- /app/Controllers/Home.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | namespace App\Controllers; 4 | 5 | class Home extends BaseController 6 | { 7 | public function index(): string 8 | { 9 | return view('welcome_message'); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /app/Database/Migrations/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeigniter4/CodeIgniter4/8c7ab80e230e9d613d5dd13583053cf86537a38e/app/Database/Migrations/.gitkeep -------------------------------------------------------------------------------- /app/Database/Seeds/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeigniter4/CodeIgniter4/8c7ab80e230e9d613d5dd13583053cf86537a38e/app/Database/Seeds/.gitkeep -------------------------------------------------------------------------------- /app/Filters/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeigniter4/CodeIgniter4/8c7ab80e230e9d613d5dd13583053cf86537a38e/app/Filters/.gitkeep -------------------------------------------------------------------------------- /app/Helpers/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeigniter4/CodeIgniter4/8c7ab80e230e9d613d5dd13583053cf86537a38e/app/Helpers/.gitkeep -------------------------------------------------------------------------------- /app/Language/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeigniter4/CodeIgniter4/8c7ab80e230e9d613d5dd13583053cf86537a38e/app/Language/.gitkeep -------------------------------------------------------------------------------- /app/Language/en/Validation.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | // override core en language system validation or define your own en language validation message 4 | return []; 5 | -------------------------------------------------------------------------------- /app/Libraries/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeigniter4/CodeIgniter4/8c7ab80e230e9d613d5dd13583053cf86537a38e/app/Libraries/.gitkeep -------------------------------------------------------------------------------- /app/Models/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeigniter4/CodeIgniter4/8c7ab80e230e9d613d5dd13583053cf86537a38e/app/Models/.gitkeep -------------------------------------------------------------------------------- /app/ThirdParty/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeigniter4/CodeIgniter4/8c7ab80e230e9d613d5dd13583053cf86537a38e/app/ThirdParty/.gitkeep -------------------------------------------------------------------------------- /app/Views/errors/cli/error_404.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | use CodeIgniter\CLI\CLI; 4 | 5 | CLI::error('ERROR: ' . $code); 6 | CLI::write($message); 7 | CLI::newLine(); 8 | -------------------------------------------------------------------------------- /app/Views/errors/cli/production.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | // On the CLI, we still want errors in productions 4 | // so just use the exception template. 5 | include __DIR__ . '/error_exception.php'; 6 | -------------------------------------------------------------------------------- /app/Views/errors/html/production.php: -------------------------------------------------------------------------------- 1 | <!doctype html> 2 | <html> 3 | <head> 4 | <meta charset="UTF-8"> 5 | <meta name="robots" content="noindex"> 6 | 7 | <title><?= lang('Errors.whoops') ?></title> 8 | 9 | <style> 10 | <?= preg_replace('#[\r\n\t ]+#', ' ', file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . 'debug.css')) ?> 11 | </style> 12 | </head> 13 | <body> 14 | 15 | <div class="container text-center"> 16 | 17 | <h1 class="headline"><?= lang('Errors.whoops') ?></h1> 18 | 19 | <p class="lead"><?= lang('Errors.weHitASnag') ?></p> 20 | 21 | </div> 22 | 23 | </body> 24 | 25 | </html> 26 | -------------------------------------------------------------------------------- /app/index.html: -------------------------------------------------------------------------------- 1 | <!DOCTYPE html> 2 | <html> 3 | <head> 4 | <title>403 Forbidden</title> 5 | </head> 6 | <body> 7 | 8 | <p>Directory access is forbidden.</p> 9 | 10 | </body> 11 | </html> 12 | -------------------------------------------------------------------------------- /psalm-autoload.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | require __DIR__ . '/system/util_bootstrap.php'; 6 | 7 | $directories = [ 8 | 'system/Helpers', 9 | 'tests/_support', 10 | 'tests/system/Config/fixtures', 11 | ]; 12 | $excludeDirs = [ 13 | 'tests/_support/View/Cells', 14 | 'tests/_support/View/Views', 15 | ]; 16 | $excludeFiles = [ 17 | 'tests/_support/Config/Filters.php', 18 | 'tests/_support/Config/Routes.php', 19 | ]; 20 | 21 | foreach ($directories as $directory) { 22 | $iterator = new RecursiveIteratorIterator( 23 | new RecursiveDirectoryIterator( 24 | $directory, 25 | RecursiveDirectoryIterator::UNIX_PATHS | RecursiveDirectoryIterator::CURRENT_AS_FILEINFO, 26 | ), 27 | RecursiveIteratorIterator::CHILD_FIRST, 28 | ); 29 | 30 | /** @var SplFileInfo $file */ 31 | foreach ($iterator as $file) { 32 | if (! $file->isFile()) { 33 | continue; 34 | } 35 | 36 | if (in_array($file->getPath(), $excludeDirs, true)) { 37 | continue; 38 | } 39 | 40 | if ($file->getExtension() !== 'php') { 41 | continue; 42 | } 43 | 44 | if (in_array($file->getPathname(), $excludeFiles, true)) { 45 | continue; 46 | } 47 | 48 | require_once $file->getPathname(); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeigniter4/CodeIgniter4/8c7ab80e230e9d613d5dd13583053cf86537a38e/public/favicon.ico -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /system/.htaccess: -------------------------------------------------------------------------------- 1 | <IfModule authz_core_module> 2 | Require all denied 3 | </IfModule> 4 | <IfModule !authz_core_module> 5 | Deny from all 6 | </IfModule> 7 | -------------------------------------------------------------------------------- /system/CLI/Exceptions/CLIException.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\CLI\Exceptions; 15 | 16 | use CodeIgniter\Exceptions\DebugTraceableTrait; 17 | use CodeIgniter\Exceptions\RuntimeException; 18 | 19 | /** 20 | * CLIException 21 | */ 22 | class CLIException extends RuntimeException 23 | { 24 | use DebugTraceableTrait; 25 | 26 | /** 27 | * Thrown when `$color` specified for `$type` is not within the 28 | * allowed list of colors. 29 | * 30 | * @return CLIException 31 | */ 32 | public static function forInvalidColor(string $type, string $color) 33 | { 34 | return new static(lang('CLI.invalidColor', [$type, $color])); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /system/Cache/Exceptions/CacheException.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Cache\Exceptions; 15 | 16 | use CodeIgniter\Exceptions\DebugTraceableTrait; 17 | use CodeIgniter\Exceptions\RuntimeException; 18 | 19 | class CacheException extends RuntimeException 20 | { 21 | use DebugTraceableTrait; 22 | 23 | /** 24 | * Thrown when handler has no permission to write cache. 25 | * 26 | * @return static 27 | */ 28 | public static function forUnableToWrite(string $path) 29 | { 30 | return new static(lang('Cache.unableToWrite', [$path])); 31 | } 32 | 33 | /** 34 | * Thrown when an unrecognized handler is used. 35 | * 36 | * @return static 37 | */ 38 | public static function forInvalidHandlers() 39 | { 40 | return new static(lang('Cache.invalidHandlers')); 41 | } 42 | 43 | /** 44 | * Thrown when no backup handler is setup in config. 45 | * 46 | * @return static 47 | */ 48 | public static function forNoBackup() 49 | { 50 | return new static(lang('Cache.noBackup')); 51 | } 52 | 53 | /** 54 | * Thrown when specified handler was not found. 55 | * 56 | * @return static 57 | */ 58 | public static function forHandlerNotFound() 59 | { 60 | return new static(lang('Cache.handlerNotFound')); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /system/Cache/FactoriesCache/FileVarExportHandler.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Cache\FactoriesCache; 15 | 16 | final class FileVarExportHandler 17 | { 18 | private string $path = WRITEPATH . 'cache'; 19 | 20 | public function save(string $key, mixed $val): void 21 | { 22 | $val = var_export($val, true); 23 | 24 | // Write to temp file first to ensure atomicity 25 | $tmp = $this->path . "/{$key}." . uniqid('', true) . '.tmp'; 26 | file_put_contents($tmp, '<?php return ' . $val . ';', LOCK_EX); 27 | 28 | rename($tmp, $this->path . "/{$key}"); 29 | } 30 | 31 | public function delete(string $key): void 32 | { 33 | @unlink($this->path . "/{$key}"); 34 | } 35 | 36 | public function get(string $key): mixed 37 | { 38 | return @include $this->path . "/{$key}"; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /system/Commands/Generators/Views/cell.tpl.php: -------------------------------------------------------------------------------- 1 | <@php 2 | 3 | namespace {namespace}; 4 | 5 | use CodeIgniter\View\Cells\Cell; 6 | 7 | class {class} extends Cell 8 | { 9 | // 10 | } 11 | -------------------------------------------------------------------------------- /system/Commands/Generators/Views/cell_view.tpl.php: -------------------------------------------------------------------------------- 1 | <div> 2 | <!-- Your HTML here --> 3 | </div> 4 | -------------------------------------------------------------------------------- /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 | <?php if ($type === 'generator'): ?> 8 | use CodeIgniter\CLI\GeneratorTrait; 9 | <?php endif ?> 10 | 11 | class {class} extends BaseCommand 12 | { 13 | <?php if ($type === 'generator'): ?> 14 | use GeneratorTrait; 15 | 16 | <?php endif ?> 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 | <?php if ($type === 'generator'): ?> 67 | $this->component = 'Command'; 68 | $this->directory = 'Commands'; 69 | $this->template = 'command.tpl.php'; 70 | 71 | $this->execute($params); 72 | <?php else: ?> 73 | // 74 | <?php endif ?> 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 = ['created_at', 'updated_at', 'deleted_at']; 11 | protected $casts = []; 12 | } 13 | -------------------------------------------------------------------------------- /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 RequestInterface|ResponseInterface|string|void 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 ResponseInterface|void 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 | <?php if ($session): ?> 10 | protected $DBGroup = '<?= $DBGroup ?>'; 11 | 12 | public function up() 13 | { 14 | $this->forge->addField([ 15 | 'id' => ['type' => 'VARCHAR', 'constraint' => 128, 'null' => false], 16 | <?php if ($DBDriver === 'MySQLi'): ?> 17 | 'ip_address' => ['type' => 'VARCHAR', 'constraint' => 45, 'null' => false], 18 | 'timestamp timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL', 19 | 'data' => ['type' => 'BLOB', 'null' => false], 20 | <?php elseif ($DBDriver === 'Postgre'): ?> 21 | 'ip_address inet NOT NULL', 22 | 'timestamp timestamptz DEFAULT CURRENT_TIMESTAMP NOT NULL', 23 | "data bytea DEFAULT '' NOT NULL", 24 | <?php endif; ?> 25 | ]); 26 | <?php if ($matchIP) : ?> 27 | $this->forge->addKey(['id', 'ip_address'], true); 28 | <?php else: ?> 29 | $this->forge->addKey('id', true); 30 | <?php endif ?> 31 | $this->forge->addKey('timestamp'); 32 | $this->forge->createTable('<?= $table ?>', true); 33 | } 34 | 35 | public function down() 36 | { 37 | $this->forge->dropTable('<?= $table ?>', true); 38 | } 39 | <?php else: ?> 40 | public function up() 41 | { 42 | // 43 | } 44 | 45 | public function down() 46 | { 47 | // 48 | } 49 | <?php endif ?> 50 | } 51 | -------------------------------------------------------------------------------- /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 | <?php if (is_string($dbGroup)): ?> 10 | protected $DBGroup = '{dbGroup}'; 11 | <?php endif; ?> 12 | protected $table = '{table}'; 13 | protected $primaryKey = 'id'; 14 | protected $useAutoIncrement = true; 15 | protected $returnType = {return}; 16 | protected $useSoftDeletes = false; 17 | protected $protectFields = true; 18 | protected $allowedFields = []; 19 | 20 | protected bool $allowEmptyInserts = false; 21 | protected bool $updateOnlyChanged = true; 22 | 23 | protected array $casts = []; 24 | protected array $castHandlers = []; 25 | 26 | // Dates 27 | protected $useTimestamps = false; 28 | protected $dateFormat = 'datetime'; 29 | protected $createdField = 'created_at'; 30 | protected $updatedField = 'updated_at'; 31 | protected $deletedField = 'deleted_at'; 32 | 33 | // Validation 34 | protected $validationRules = []; 35 | protected $validationMessages = []; 36 | protected $skipValidation = false; 37 | protected $cleanValidationRules = true; 38 | 39 | // Callbacks 40 | protected $allowCallbacks = true; 41 | protected $beforeInsert = []; 42 | protected $afterInsert = []; 43 | protected $beforeUpdate = []; 44 | protected $afterUpdate = []; 45 | protected $beforeFind = []; 46 | protected $afterFind = []; 47 | protected $beforeDelete = []; 48 | protected $afterDelete = []; 49 | } 50 | -------------------------------------------------------------------------------- /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/test.tpl.php: -------------------------------------------------------------------------------- 1 | <@php 2 | 3 | namespace {namespace}; 4 | 5 | use CodeIgniter\Test\CIUnitTestCase; 6 | 7 | class {class} extends CIUnitTestCase 8 | { 9 | protected function setUp(): void 10 | { 11 | parent::setUp(); 12 | } 13 | 14 | public function testExample(): void 15 | { 16 | // 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /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/Utilities/Routes/AutoRouteCollector.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Commands\Utilities\Routes; 15 | 16 | /** 17 | * Collects data for auto route listing. 18 | * 19 | * @see \CodeIgniter\Commands\Utilities\Routes\AutoRouteCollectorTest 20 | */ 21 | final class AutoRouteCollector 22 | { 23 | /** 24 | * @param string $namespace namespace to search 25 | */ 26 | public function __construct(private readonly string $namespace, private readonly string $defaultController, private readonly string $defaultMethod) 27 | { 28 | } 29 | 30 | /** 31 | * @return list<list<string>> 32 | */ 33 | public function get(): array 34 | { 35 | $finder = new ControllerFinder($this->namespace); 36 | $reader = new ControllerMethodReader($this->namespace); 37 | 38 | $tbody = []; 39 | 40 | foreach ($finder->find() as $class) { 41 | $output = $reader->read( 42 | $class, 43 | $this->defaultController, 44 | $this->defaultMethod, 45 | ); 46 | 47 | foreach ($output as $item) { 48 | $tbody[] = [ 49 | 'auto', 50 | $item['route'], 51 | '', 52 | $item['handler'], 53 | ]; 54 | } 55 | } 56 | 57 | return $tbody; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /system/Config/Factory.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Config; 15 | 16 | /** 17 | * Factories Configuration file. 18 | * 19 | * Provides overriding directives for how 20 | * Factories should handle discovery and 21 | * instantiation of specific components. 22 | * Each property should correspond to the 23 | * lowercase, plural component name. 24 | */ 25 | class Factory extends BaseConfig 26 | { 27 | /** 28 | * Supplies a default set of options to merge for 29 | * all unspecified factory components. 30 | * 31 | * @var array 32 | */ 33 | public static $default = [ 34 | 'component' => null, 35 | 'path' => null, 36 | 'instanceOf' => null, 37 | 'getShared' => true, 38 | 'preferApp' => true, 39 | ]; 40 | 41 | /** 42 | * Specifies that Models should always favor child 43 | * classes to allow easy extension of module Models. 44 | * 45 | * @var array 46 | */ 47 | public $models = [ 48 | 'preferApp' => true, 49 | ]; 50 | } 51 | -------------------------------------------------------------------------------- /system/Config/Publisher.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Config; 15 | 16 | /** 17 | * Publisher Configuration 18 | * 19 | * Defines basic security restrictions for the Publisher class 20 | * to prevent abuse by injecting malicious files into a project. 21 | */ 22 | class Publisher extends BaseConfig 23 | { 24 | /** 25 | * A list of allowed destinations with a (pseudo-)regex 26 | * of allowed files for each destination. 27 | * Attempts to publish to directories not in this list will 28 | * result in a PublisherException. Files that do no fit the 29 | * pattern will cause copy/merge to fail. 30 | * 31 | * @var array<string, string> 32 | */ 33 | public $restrictions = [ 34 | ROOTPATH => '*', 35 | FCPATH => '#\.(?css|js|map|htm?|xml|json|webmanifest|tff|eot|woff?|gif|jpe?g|tiff?|png|webp|bmp|ico|svg)$#i', 36 | ]; 37 | 38 | /** 39 | * Disables Registrars to prevent modules from altering the restrictions. 40 | */ 41 | final protected function registerProperties(): void 42 | { 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /system/DataCaster/Cast/ArrayCast.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\DataCaster\Cast; 15 | 16 | /** 17 | * Class ArrayCast 18 | * 19 | * (PHP) [array --> string] --> (DB driver) --> (DB column) string 20 | * [ <-- string] <-- (DB driver) <-- (DB column) string 21 | */ 22 | class ArrayCast extends BaseCast implements CastInterface 23 | { 24 | public static function get( 25 | mixed $value, 26 | array $params = [], 27 | ?object $helper = null, 28 | ): array { 29 | if (! is_string($value)) { 30 | self::invalidTypeValueError($value); 31 | } 32 | 33 | if ((str_starts_with($value, 'a:') || str_starts_with($value, 's:'))) { 34 | $value = unserialize($value, ['allowed_classes' => false]); 35 | } 36 | 37 | return (array) $value; 38 | } 39 | 40 | public static function set( 41 | mixed $value, 42 | array $params = [], 43 | ?object $helper = null, 44 | ): string { 45 | return serialize($value); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /system/DataCaster/Cast/BaseCast.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\DataCaster\Cast; 15 | 16 | use CodeIgniter\Exceptions\InvalidArgumentException; 17 | 18 | abstract class BaseCast implements CastInterface 19 | { 20 | public static function get( 21 | mixed $value, 22 | array $params = [], 23 | ?object $helper = null, 24 | ): mixed { 25 | return $value; 26 | } 27 | 28 | public static function set( 29 | mixed $value, 30 | array $params = [], 31 | ?object $helper = null, 32 | ): mixed { 33 | return $value; 34 | } 35 | 36 | protected static function invalidTypeValueError(mixed $value): never 37 | { 38 | $message = '[' . static::class . '] Invalid value type: ' . get_debug_type($value); 39 | if (is_scalar($value)) { 40 | $message .= ', and its value: ' . var_export($value, true); 41 | } 42 | 43 | throw new InvalidArgumentException($message); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /system/DataCaster/Cast/BooleanCast.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\DataCaster\Cast; 15 | 16 | /** 17 | * Class BooleanCast 18 | * 19 | * (PHP) [bool --> bool ] --> (DB driver) --> (DB column) bool|int(0/1) 20 | * [ <-- string|int] <-- (DB driver) <-- (DB column) bool|int(0/1) 21 | */ 22 | class BooleanCast extends BaseCast 23 | { 24 | public static function get( 25 | mixed $value, 26 | array $params = [], 27 | ?object $helper = null, 28 | ): bool { 29 | // For PostgreSQL 30 | if ($value === 't') { 31 | return true; 32 | } 33 | if ($value === 'f') { 34 | return false; 35 | } 36 | 37 | return filter_var($value, FILTER_VALIDATE_BOOLEAN); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /system/DataCaster/Cast/CSVCast.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\DataCaster\Cast; 15 | 16 | /** 17 | * Class CSVCast 18 | * 19 | * (PHP) [array --> string] --> (DB driver) --> (DB column) string 20 | * [ <-- string] <-- (DB driver) <-- (DB column) string 21 | */ 22 | class CSVCast extends BaseCast 23 | { 24 | public static function get( 25 | mixed $value, 26 | array $params = [], 27 | ?object $helper = null, 28 | ): array { 29 | if (! is_string($value)) { 30 | self::invalidTypeValueError($value); 31 | } 32 | 33 | return explode(',', $value); 34 | } 35 | 36 | public static function set( 37 | mixed $value, 38 | array $params = [], 39 | ?object $helper = null, 40 | ): string { 41 | if (! is_array($value)) { 42 | self::invalidTypeValueError($value); 43 | } 44 | 45 | return implode(',', $value); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /system/DataCaster/Cast/CastInterface.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\DataCaster\Cast; 15 | 16 | interface CastInterface 17 | { 18 | /** 19 | * Takes a value from DataSource, returns its value for PHP. 20 | * 21 | * @param mixed $value Data from database driver 22 | * @param list<string> $params Additional param 23 | * @param object|null $helper Helper object. E.g., database connection 24 | * 25 | * @return mixed PHP native value 26 | */ 27 | public static function get( 28 | mixed $value, 29 | array $params = [], 30 | ?object $helper = null, 31 | ): mixed; 32 | 33 | /** 34 | * Takes a PHP value, returns its value for DataSource. 35 | * 36 | * @param mixed $value PHP native value 37 | * @param list<string> $params Additional param 38 | * @param object|null $helper Helper object. E.g., database connection 39 | * 40 | * @return mixed Data to pass to database driver 41 | */ 42 | public static function set( 43 | mixed $value, 44 | array $params = [], 45 | ?object $helper = null, 46 | ): mixed; 47 | } 48 | -------------------------------------------------------------------------------- /system/DataCaster/Cast/FloatCast.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\DataCaster\Cast; 15 | 16 | /** 17 | * Class FloatCast 18 | * 19 | * (PHP) [float --> float ] --> (DB driver) --> (DB column) float 20 | * [ <-- float|string] <-- (DB driver) <-- (DB column) float 21 | */ 22 | class FloatCast extends BaseCast 23 | { 24 | public static function get( 25 | mixed $value, 26 | array $params = [], 27 | ?object $helper = null, 28 | ): float { 29 | if (! is_float($value) && ! is_string($value)) { 30 | self::invalidTypeValueError($value); 31 | } 32 | 33 | return (float) $value; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /system/DataCaster/Cast/IntBoolCast.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\DataCaster\Cast; 15 | 16 | /** 17 | * Int Bool Cast 18 | * 19 | * (PHP) [bool --> int ] --> (DB driver) --> (DB column) int(0/1) 20 | * [ <-- int|string] <-- (DB driver) <-- (DB column) int(0/1) 21 | */ 22 | final class IntBoolCast extends BaseCast 23 | { 24 | public static function get( 25 | mixed $value, 26 | array $params = [], 27 | ?object $helper = null, 28 | ): bool { 29 | if (! is_int($value) && ! is_string($value)) { 30 | self::invalidTypeValueError($value); 31 | } 32 | 33 | return (bool) $value; 34 | } 35 | 36 | public static function set( 37 | mixed $value, 38 | array $params = [], 39 | ?object $helper = null, 40 | ): int { 41 | if (! is_bool($value)) { 42 | self::invalidTypeValueError($value); 43 | } 44 | 45 | return (int) $value; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /system/DataCaster/Cast/IntegerCast.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\DataCaster\Cast; 15 | 16 | /** 17 | * Class IntegerCast 18 | * 19 | * (PHP) [int --> int ] --> (DB driver) --> (DB column) int 20 | * [ <-- int|string] <-- (DB driver) <-- (DB column) int 21 | */ 22 | class IntegerCast extends BaseCast 23 | { 24 | public static function get( 25 | mixed $value, 26 | array $params = [], 27 | ?object $helper = null, 28 | ): int { 29 | if (! is_string($value) && ! is_int($value)) { 30 | self::invalidTypeValueError($value); 31 | } 32 | 33 | return (int) $value; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /system/DataCaster/Cast/TimestampCast.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\DataCaster\Cast; 15 | 16 | use CodeIgniter\I18n\Time; 17 | 18 | /** 19 | * Class TimestampCast 20 | * 21 | * (PHP) [Time --> int ] --> (DB driver) --> (DB column) int 22 | * [ <-- int|string] <-- (DB driver) <-- (DB column) int 23 | */ 24 | class TimestampCast extends BaseCast 25 | { 26 | public static function get( 27 | mixed $value, 28 | array $params = [], 29 | ?object $helper = null, 30 | ): Time { 31 | if (! is_int($value) && ! is_string($value)) { 32 | self::invalidTypeValueError($value); 33 | } 34 | 35 | return Time::createFromTimestamp((int) $value, date_default_timezone_get()); 36 | } 37 | 38 | public static function set( 39 | mixed $value, 40 | array $params = [], 41 | ?object $helper = null, 42 | ): int { 43 | if (! $value instanceof Time) { 44 | self::invalidTypeValueError($value); 45 | } 46 | 47 | return $value->getTimestamp(); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /system/DataCaster/Cast/URICast.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\DataCaster\Cast; 15 | 16 | use CodeIgniter\HTTP\URI; 17 | 18 | /** 19 | * Class URICast 20 | * 21 | * (PHP) [URI --> string] --> (DB driver) --> (DB column) string 22 | * [ <-- string] <-- (DB driver) <-- (DB column) string 23 | */ 24 | class URICast extends BaseCast 25 | { 26 | public static function get( 27 | mixed $value, 28 | array $params = [], 29 | ?object $helper = null, 30 | ): URI { 31 | if (! is_string($value)) { 32 | self::invalidTypeValueError($value); 33 | } 34 | 35 | return new URI($value); 36 | } 37 | 38 | public static function set( 39 | mixed $value, 40 | array $params = [], 41 | ?object $helper = null, 42 | ): string { 43 | if (! $value instanceof URI) { 44 | self::invalidTypeValueError($value); 45 | } 46 | 47 | return (string) $value; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /system/DataCaster/Exceptions/CastException.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\DataCaster\Exceptions; 15 | 16 | use CodeIgniter\Entity\Exceptions\CastException as EntityCastException; 17 | 18 | /** 19 | * CastException is thrown for invalid cast initialization and management. 20 | */ 21 | class CastException extends EntityCastException 22 | { 23 | } 24 | -------------------------------------------------------------------------------- /system/Database/Exceptions/DatabaseException.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Database\Exceptions; 15 | 16 | use CodeIgniter\Exceptions\HasExitCodeInterface; 17 | use CodeIgniter\Exceptions\RuntimeException; 18 | 19 | class DatabaseException extends RuntimeException implements ExceptionInterface, HasExitCodeInterface 20 | { 21 | public function getExitCode(): int 22 | { 23 | return EXIT_DATABASE; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /system/Database/Exceptions/ExceptionInterface.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Database\Exceptions; 15 | 16 | /** 17 | * Provides a domain-level interface for broad capture 18 | * of all database-related exceptions. 19 | * 20 | * catch (\CodeIgniter\Database\Exceptions\ExceptionInterface) { ... } 21 | */ 22 | interface ExceptionInterface extends \CodeIgniter\Exceptions\ExceptionInterface 23 | { 24 | } 25 | -------------------------------------------------------------------------------- /system/Database/MySQLi/Utils.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Database\MySQLi; 15 | 16 | use CodeIgniter\Database\BaseUtils; 17 | use CodeIgniter\Database\Exceptions\DatabaseException; 18 | 19 | /** 20 | * Utils for MySQLi 21 | */ 22 | class Utils extends BaseUtils 23 | { 24 | /** 25 | * List databases statement 26 | * 27 | * @var string 28 | */ 29 | protected $listDatabases = 'SHOW DATABASES'; 30 | 31 | /** 32 | * OPTIMIZE TABLE statement 33 | * 34 | * @var string 35 | */ 36 | protected $optimizeTable = 'OPTIMIZE TABLE %s'; 37 | 38 | /** 39 | * Platform dependent version of the backup function. 40 | * 41 | * @return never 42 | */ 43 | public function _backup(?array $prefs = null) 44 | { 45 | throw new DatabaseException('Unsupported feature of the database platform you are using.'); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /system/Database/OCI8/Utils.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Database\OCI8; 15 | 16 | use CodeIgniter\Database\BaseUtils; 17 | use CodeIgniter\Database\Exceptions\DatabaseException; 18 | 19 | /** 20 | * Utils for OCI8 21 | */ 22 | class Utils extends BaseUtils 23 | { 24 | /** 25 | * List databases statement 26 | * 27 | * @var string 28 | */ 29 | protected $listDatabases = 'SELECT TABLESPACE_NAME FROM USER_TABLESPACES'; 30 | 31 | /** 32 | * Platform dependent version of the backup function. 33 | * 34 | * @return never 35 | */ 36 | public function _backup(?array $prefs = null) 37 | { 38 | throw new DatabaseException('Unsupported feature of the database platform you are using.'); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /system/Database/Postgre/Utils.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Database\Postgre; 15 | 16 | use CodeIgniter\Database\BaseUtils; 17 | use CodeIgniter\Database\Exceptions\DatabaseException; 18 | 19 | /** 20 | * Utils for Postgre 21 | */ 22 | class Utils extends BaseUtils 23 | { 24 | /** 25 | * List databases statement 26 | * 27 | * @var string 28 | */ 29 | protected $listDatabases = 'SELECT datname FROM pg_database'; 30 | 31 | /** 32 | * OPTIMIZE TABLE statement 33 | * 34 | * @var string 35 | */ 36 | protected $optimizeTable = 'REINDEX TABLE %s'; 37 | 38 | /** 39 | * Platform dependent version of the backup function. 40 | * 41 | * @return never 42 | */ 43 | public function _backup(?array $prefs = null) 44 | { 45 | throw new DatabaseException('Unsupported feature of the database platform you are using.'); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /system/Database/RawSql.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Database; 15 | 16 | use Stringable; 17 | 18 | /** 19 | * @see \CodeIgniter\Database\RawSqlTest 20 | */ 21 | class RawSql implements Stringable 22 | { 23 | /** 24 | * @var string Raw SQL string 25 | */ 26 | private string $string; 27 | 28 | public function __construct(string $sqlString) 29 | { 30 | $this->string = $sqlString; 31 | } 32 | 33 | public function __toString(): string 34 | { 35 | return $this->string; 36 | } 37 | 38 | /** 39 | * Create new instance with new SQL string 40 | */ 41 | public function with(string $newSqlString): self 42 | { 43 | $new = clone $this; 44 | $new->string = $newSqlString; 45 | 46 | return $new; 47 | } 48 | 49 | /** 50 | * Returns unique id for binding key 51 | */ 52 | public function getBindingKey(): string 53 | { 54 | return 'RawSql' . spl_object_id($this); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /system/Database/SQLSRV/Utils.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Database\SQLSRV; 15 | 16 | use CodeIgniter\Database\BaseUtils; 17 | use CodeIgniter\Database\ConnectionInterface; 18 | use CodeIgniter\Database\Exceptions\DatabaseException; 19 | 20 | /** 21 | * Utils for SQLSRV 22 | */ 23 | class Utils extends BaseUtils 24 | { 25 | /** 26 | * List databases statement 27 | * 28 | * @var string 29 | */ 30 | protected $listDatabases = 'EXEC sp_helpdb'; // Can also be: EXEC sp_databases 31 | 32 | /** 33 | * OPTIMIZE TABLE statement 34 | * 35 | * @var string 36 | */ 37 | protected $optimizeTable = 'ALTER INDEX all ON %s REORGANIZE'; 38 | 39 | public function __construct(ConnectionInterface $db) 40 | { 41 | parent::__construct($db); 42 | 43 | $this->optimizeTable = 'ALTER INDEX all ON ' . $this->db->schema . '.%s REORGANIZE'; 44 | } 45 | 46 | /** 47 | * Platform dependent version of the backup function. 48 | * 49 | * @return never 50 | */ 51 | public function _backup(?array $prefs = null) 52 | { 53 | throw new DatabaseException('Unsupported feature of the database platform you are using.'); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /system/Database/SQLite3/Utils.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Database\SQLite3; 15 | 16 | use CodeIgniter\Database\BaseUtils; 17 | use CodeIgniter\Database\Exceptions\DatabaseException; 18 | 19 | /** 20 | * Utils for SQLite3 21 | */ 22 | class Utils extends BaseUtils 23 | { 24 | /** 25 | * OPTIMIZE TABLE statement 26 | * 27 | * @var string 28 | */ 29 | protected $optimizeTable = 'REINDEX %s'; 30 | 31 | /** 32 | * Platform dependent version of the backup function. 33 | * 34 | * @return never 35 | */ 36 | public function _backup(?array $prefs = null) 37 | { 38 | throw new DatabaseException('Unsupported feature of the database platform you are using.'); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /system/Debug/ExceptionHandlerInterface.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Debug; 15 | 16 | use CodeIgniter\HTTP\RequestInterface; 17 | use CodeIgniter\HTTP\ResponseInterface; 18 | use Throwable; 19 | 20 | interface ExceptionHandlerInterface 21 | { 22 | /** 23 | * Determines the correct way to display the error. 24 | */ 25 | public function handle( 26 | Throwable $exception, 27 | RequestInterface $request, 28 | ResponseInterface $response, 29 | int $statusCode, 30 | int $exitCode, 31 | ): void; 32 | } 33 | -------------------------------------------------------------------------------- /system/Debug/Toolbar/Collectors/Config.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Debug\Toolbar\Collectors; 15 | 16 | use CodeIgniter\CodeIgniter; 17 | use Config\App; 18 | 19 | /** 20 | * Debug toolbar configuration 21 | */ 22 | class Config 23 | { 24 | /** 25 | * Return toolbar config values as an array. 26 | */ 27 | public static function display(): array 28 | { 29 | $config = config(App::class); 30 | 31 | return [ 32 | 'ciVersion' => CodeIgniter::CI_VERSION, 33 | 'phpVersion' => PHP_VERSION, 34 | 'phpSAPI' => PHP_SAPI, 35 | 'environment' => ENVIRONMENT, 36 | 'baseURL' => $config->baseURL, 37 | 'timezone' => app_timezone(), 38 | 'locale' => service('request')->getLocale(), 39 | 'cspEnabled' => $config->CSPEnabled, 40 | ]; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /system/Debug/Toolbar/Views/_config.tpl: -------------------------------------------------------------------------------- 1 | <p class="debug-bar-alignRight"> 2 | <a href="https://codeigniter.com/user_guide/" target="_blank" >Read the CodeIgniter docs...</a> 3 | </p> 4 | 5 | <table> 6 | <tbody> 7 | <tr> 8 | <td>CodeIgniter Version:</td> 9 | <td>{ ciVersion }</td> 10 | </tr> 11 | <tr> 12 | <td>PHP Version:</td> 13 | <td>{ phpVersion }</td> 14 | </tr> 15 | <tr> 16 | <td>PHP SAPI:</td> 17 | <td>{ phpSAPI }</td> 18 | </tr> 19 | <tr> 20 | <td>Environment:</td> 21 | <td>{ environment }</td> 22 | </tr> 23 | <tr> 24 | <td>Base URL:</td> 25 | <td> 26 | { if $baseURL == '' } 27 | <div class="warning"> 28 | The $baseURL should always be set manually to prevent possible URL personification from external parties. 29 | </div> 30 | { else } 31 | { baseURL } 32 | { endif } 33 | </td> 34 | </tr> 35 | <tr> 36 | <td>Timezone:</td> 37 | <td>{ timezone }</td> 38 | </tr> 39 | <tr> 40 | <td>Locale:</td> 41 | <td>{ locale }</td> 42 | </tr> 43 | <tr> 44 | <td>Content Security Policy Enabled:</td> 45 | <td>{ if $cspEnabled } Yes { else } No { endif }</td> 46 | </tr> 47 | </tbody> 48 | </table> 49 | -------------------------------------------------------------------------------- /system/Debug/Toolbar/Views/_database.tpl: -------------------------------------------------------------------------------- 1 | <table> 2 | <thead> 3 | <tr> 4 | <th class="debug-bar-width6r">Time</th> 5 | <th>Query String</th> 6 | </tr> 7 | </thead> 8 | <tbody> 9 | {queries} 10 | <tr class="{class}" title="{hover}" data-toggle="{qid}-trace"> 11 | <td class="narrow">{duration}</td> 12 | <td>{! sql !}</td> 13 | <td class="debug-bar-alignRight"><strong>{trace-file}</strong></td> 14 | </tr> 15 | <tr class="muted debug-bar-ndisplay" id="{qid}-trace"> 16 | <td></td> 17 | <td colspan="2"> 18 | {trace} 19 | {index}<strong>{file}</strong><br/> 20 | {function}<br/><br/> 21 | {/trace} 22 | </td> 23 | </tr> 24 | {/queries} 25 | </tbody> 26 | </table> 27 | -------------------------------------------------------------------------------- /system/Debug/Toolbar/Views/_events.tpl: -------------------------------------------------------------------------------- 1 | <table> 2 | <thead> 3 | <tr> 4 | <th class="debug-bar-width6r">Time</th> 5 | <th>Event Name</th> 6 | <th>Times Called</th> 7 | </tr> 8 | </thead> 9 | <tbody> 10 | {events} 11 | <tr> 12 | <td class="narrow">{ duration } ms</td> 13 | <td>{event}</td> 14 | <td>{count}</td> 15 | </tr> 16 | {/events} 17 | </tbody> 18 | </table> 19 | -------------------------------------------------------------------------------- /system/Debug/Toolbar/Views/_files.tpl: -------------------------------------------------------------------------------- 1 | <table> 2 | <tbody> 3 | {userFiles} 4 | <tr> 5 | <td>{name}</td> 6 | <td>{path}</td> 7 | </tr> 8 | {/userFiles} 9 | {coreFiles} 10 | <tr class="muted"> 11 | <td class="debug-bar-width20e">{name}</td> 12 | <td>{path}</td> 13 | </tr> 14 | {/coreFiles} 15 | </tbody> 16 | </table> 17 | -------------------------------------------------------------------------------- /system/Debug/Toolbar/Views/_history.tpl: -------------------------------------------------------------------------------- 1 | <table> 2 | <thead> 3 | <tr> 4 | <th>Action</th> 5 | <th>Datetime</th> 6 | <th>Status</th> 7 | <th>Method</th> 8 | <th>URL</th> 9 | <th>Content-Type</th> 10 | <th>Is AJAX?</th> 11 | </tr> 12 | </thead> 13 | <tbody> 14 | {files} 15 | <tr data-active="{active}"> 16 | <td class="debug-bar-width70p"> 17 | <button class="ci-history-load" data-time="{time}">Load</button> 18 | </td> 19 | <td class="debug-bar-width190p">{datetime}</td> 20 | <td>{status}</td> 21 | <td>{method}</td> 22 | <td>{url}</td> 23 | <td>{contentType}</td> 24 | <td>{isAJAX}</td> 25 | </tr> 26 | {/files} 27 | </tbody> 28 | </table> 29 | -------------------------------------------------------------------------------- /system/Debug/Toolbar/Views/_logs.tpl: -------------------------------------------------------------------------------- 1 | { if $logs == [] } 2 | <p>Nothing was logged. If you were expecting logged items, ensure that LoggerConfig file has the correct threshold set.</p> 3 | { else } 4 | <table> 5 | <thead> 6 | <tr> 7 | <th>Severity</th> 8 | <th>Message</th> 9 | </tr> 10 | </thead> 11 | <tbody> 12 | {logs} 13 | <tr> 14 | <td>{level}</td> 15 | <td>{msg}</td> 16 | </tr> 17 | {/logs} 18 | </tbody> 19 | </table> 20 | { endif } 21 | -------------------------------------------------------------------------------- /system/Debug/Toolbar/Views/_routes.tpl: -------------------------------------------------------------------------------- 1 | <h3>Matched Route</h3> 2 | 3 | <table> 4 | <tbody> 5 | {matchedRoute} 6 | <tr> 7 | <td>Directory:</td> 8 | <td>{directory}</td> 9 | </tr> 10 | <tr> 11 | <td>Controller:</td> 12 | <td>{controller}</td> 13 | </tr> 14 | <tr> 15 | <td>Method:</td> 16 | <td>{method}</td> 17 | </tr> 18 | <tr> 19 | <td>Params:</td> 20 | <td>{paramCount} / {truePCount}</td> 21 | </tr> 22 | {params} 23 | <tr class="route-params-item"> 24 | <td>{name}</td> 25 | <td>{value}</td> 26 | </tr> 27 | {/params} 28 | {/matchedRoute} 29 | </tbody> 30 | </table> 31 | 32 | 33 | <h3>Defined Routes</h3> 34 | 35 | <table> 36 | <thead> 37 | <tr> 38 | <th>Method</th> 39 | <th>Route</th> 40 | <th>Handler</th> 41 | </tr> 42 | </thead> 43 | <tbody> 44 | {routes} 45 | <tr> 46 | <td>{method}</td> 47 | <td data-debugbar-route="{method}">{route}</td> 48 | <td>{handler}</td> 49 | </tr> 50 | {/routes} 51 | </tbody> 52 | </table> 53 | -------------------------------------------------------------------------------- /system/Encryption/EncrypterInterface.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Encryption; 15 | 16 | use CodeIgniter\Encryption\Exceptions\EncryptionException; 17 | 18 | /** 19 | * CodeIgniter Encryption Handler 20 | * 21 | * Provides two-way keyed encryption 22 | */ 23 | interface EncrypterInterface 24 | { 25 | /** 26 | * Encrypt - convert plaintext into ciphertext 27 | * 28 | * @param string $data Input data 29 | * @param array|string|null $params Overridden parameters, specifically the key 30 | * 31 | * @return string 32 | * 33 | * @throws EncryptionException 34 | */ 35 | public function encrypt($data, $params = null); 36 | 37 | /** 38 | * Decrypt - convert ciphertext into plaintext 39 | * 40 | * @param string $data Encrypted data 41 | * @param array|string|null $params Overridden parameters, specifically the key 42 | * 43 | * @return string 44 | * 45 | * @throws EncryptionException 46 | */ 47 | public function decrypt($data, $params = null); 48 | } 49 | -------------------------------------------------------------------------------- /system/Entity/Cast/ArrayCast.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Entity\Cast; 15 | 16 | /** 17 | * Class ArrayCast 18 | */ 19 | class ArrayCast extends BaseCast 20 | { 21 | /** 22 | * {@inheritDoc} 23 | */ 24 | public static function get($value, array $params = []): array 25 | { 26 | if (is_string($value) && (str_starts_with($value, 'a:') || str_starts_with($value, 's:'))) { 27 | $value = unserialize($value); 28 | } 29 | 30 | return (array) $value; 31 | } 32 | 33 | /** 34 | * {@inheritDoc} 35 | */ 36 | public static function set($value, array $params = []): string 37 | { 38 | return serialize($value); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /system/Entity/Cast/BaseCast.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Entity\Cast; 15 | 16 | /** 17 | * Class BaseCast 18 | */ 19 | abstract class BaseCast implements CastInterface 20 | { 21 | /** 22 | * Get 23 | * 24 | * @param array|bool|float|int|object|string|null $value Data 25 | * @param array $params Additional param 26 | * 27 | * @return array|bool|float|int|object|string|null 28 | */ 29 | public static function get($value, array $params = []) 30 | { 31 | return $value; 32 | } 33 | 34 | /** 35 | * Set 36 | * 37 | * @param array|bool|float|int|object|string|null $value Data 38 | * @param array $params Additional param 39 | * 40 | * @return array|bool|float|int|object|string|null 41 | */ 42 | public static function set($value, array $params = []) 43 | { 44 | return $value; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /system/Entity/Cast/BooleanCast.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Entity\Cast; 15 | 16 | /** 17 | * Class BooleanCast 18 | */ 19 | class BooleanCast extends BaseCast 20 | { 21 | /** 22 | * {@inheritDoc} 23 | */ 24 | public static function get($value, array $params = []): bool 25 | { 26 | return (bool) $value; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /system/Entity/Cast/CSVCast.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Entity\Cast; 15 | 16 | /** 17 | * Class CSVCast 18 | */ 19 | class CSVCast extends BaseCast 20 | { 21 | /** 22 | * {@inheritDoc} 23 | */ 24 | public static function get($value, array $params = []): array 25 | { 26 | return explode(',', $value); 27 | } 28 | 29 | /** 30 | * {@inheritDoc} 31 | */ 32 | public static function set($value, array $params = []): string 33 | { 34 | return implode(',', $value); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /system/Entity/Cast/CastInterface.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Entity\Cast; 15 | 16 | /** 17 | * Interface CastInterface 18 | * 19 | * The methods work at (1)(4) only. 20 | * [App Code] --- (1) --> [Entity] --- (2) --> [Database] 21 | * [App Code] <-- (4) --- [Entity] <-- (3) --- [Database] 22 | */ 23 | interface CastInterface 24 | { 25 | /** 26 | * Takes a raw value from Entity, returns its value for PHP. 27 | * 28 | * @param array|bool|float|int|object|string|null $value Data 29 | * @param array $params Additional param 30 | * 31 | * @return array|bool|float|int|object|string|null 32 | */ 33 | public static function get($value, array $params = []); 34 | 35 | /** 36 | * Takes a PHP value, returns its raw value for Entity. 37 | * 38 | * @param array|bool|float|int|object|string|null $value Data 39 | * @param array $params Additional param 40 | * 41 | * @return array|bool|float|int|object|string|null 42 | */ 43 | public static function set($value, array $params = []); 44 | } 45 | -------------------------------------------------------------------------------- /system/Entity/Cast/DatetimeCast.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Entity\Cast; 15 | 16 | use CodeIgniter\I18n\Time; 17 | use DateTime; 18 | use Exception; 19 | 20 | /** 21 | * Class DatetimeCast 22 | */ 23 | class DatetimeCast extends BaseCast 24 | { 25 | /** 26 | * {@inheritDoc} 27 | * 28 | * @return Time 29 | * 30 | * @throws Exception 31 | */ 32 | public static function get($value, array $params = []) 33 | { 34 | if ($value instanceof Time) { 35 | return $value; 36 | } 37 | 38 | if ($value instanceof DateTime) { 39 | return Time::createFromInstance($value); 40 | } 41 | 42 | if (is_numeric($value)) { 43 | return Time::createFromTimestamp((int) $value, date_default_timezone_get()); 44 | } 45 | 46 | if (is_string($value)) { 47 | return Time::parse($value); 48 | } 49 | 50 | return $value; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /system/Entity/Cast/FloatCast.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Entity\Cast; 15 | 16 | /** 17 | * Class FloatCast 18 | */ 19 | class FloatCast extends BaseCast 20 | { 21 | /** 22 | * {@inheritDoc} 23 | */ 24 | public static function get($value, array $params = []): float 25 | { 26 | return (float) $value; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /system/Entity/Cast/IntBoolCast.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Entity\Cast; 15 | 16 | /** 17 | * Int Bool Cast 18 | * 19 | * DB column: int (0/1) <--> Class property: bool 20 | */ 21 | final class IntBoolCast extends BaseCast 22 | { 23 | /** 24 | * @param int $value 25 | */ 26 | public static function get($value, array $params = []): bool 27 | { 28 | return (bool) $value; 29 | } 30 | 31 | /** 32 | * @param bool|int|string $value 33 | */ 34 | public static function set($value, array $params = []): int 35 | { 36 | return (int) $value; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /system/Entity/Cast/IntegerCast.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Entity\Cast; 15 | 16 | /** 17 | * Class IntegerCast 18 | */ 19 | class IntegerCast extends BaseCast 20 | { 21 | /** 22 | * {@inheritDoc} 23 | */ 24 | public static function get($value, array $params = []): int 25 | { 26 | return (int) $value; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /system/Entity/Cast/ObjectCast.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Entity\Cast; 15 | 16 | /** 17 | * Class ObjectCast 18 | */ 19 | class ObjectCast extends BaseCast 20 | { 21 | /** 22 | * {@inheritDoc} 23 | */ 24 | public static function get($value, array $params = []): object 25 | { 26 | return (object) $value; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /system/Entity/Cast/StringCast.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Entity\Cast; 15 | 16 | /** 17 | * Class StringCast 18 | */ 19 | class StringCast extends BaseCast 20 | { 21 | /** 22 | * {@inheritDoc} 23 | */ 24 | public static function get($value, array $params = []): string 25 | { 26 | return (string) $value; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /system/Entity/Cast/TimestampCast.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Entity\Cast; 15 | 16 | use CodeIgniter\Entity\Exceptions\CastException; 17 | 18 | /** 19 | * Class TimestampCast 20 | */ 21 | class TimestampCast extends BaseCast 22 | { 23 | /** 24 | * {@inheritDoc} 25 | */ 26 | public static function get($value, array $params = []) 27 | { 28 | $value = strtotime($value); 29 | 30 | if ($value === false) { 31 | throw CastException::forInvalidTimestamp(); 32 | } 33 | 34 | return $value; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /system/Entity/Cast/URICast.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Entity\Cast; 15 | 16 | use CodeIgniter\HTTP\URI; 17 | 18 | /** 19 | * Class URICast 20 | */ 21 | class URICast extends BaseCast 22 | { 23 | /** 24 | * {@inheritDoc} 25 | */ 26 | public static function get($value, array $params = []): URI 27 | { 28 | return $value instanceof URI ? $value : new URI($value); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /system/Exceptions/BadFunctionCallException.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Exceptions; 15 | 16 | /** 17 | * Exception thrown if a function is called in the wrong way, or the function 18 | * does not exist. 19 | */ 20 | class BadFunctionCallException extends \BadFunctionCallException implements ExceptionInterface 21 | { 22 | } 23 | -------------------------------------------------------------------------------- /system/Exceptions/BadMethodCallException.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Exceptions; 15 | 16 | /** 17 | * Exception thrown if a method is called in the wrong way, or the method 18 | * does not exist. 19 | */ 20 | class BadMethodCallException extends \BadMethodCallException implements ExceptionInterface 21 | { 22 | } 23 | -------------------------------------------------------------------------------- /system/Exceptions/ConfigException.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Exceptions; 15 | 16 | /** 17 | * Exception thrown if the value of the Config class is invalid or the type is 18 | * incorrect. 19 | */ 20 | class ConfigException extends RuntimeException implements HasExitCodeInterface 21 | { 22 | use DebugTraceableTrait; 23 | 24 | public function getExitCode(): int 25 | { 26 | return EXIT_CONFIG; 27 | } 28 | 29 | /** 30 | * @return static 31 | */ 32 | public static function forDisabledMigrations() 33 | { 34 | return new static(lang('Migrations.disabled')); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /system/Exceptions/CriticalError.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Exceptions; 15 | 16 | /** 17 | * Error: Critical conditions, like component unavailable, etc. 18 | */ 19 | class CriticalError extends RuntimeException 20 | { 21 | } 22 | -------------------------------------------------------------------------------- /system/Exceptions/DebugTraceableTrait.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Exceptions; 15 | 16 | use Throwable; 17 | 18 | /** 19 | * This trait provides framework exceptions the ability to pinpoint 20 | * accurately where the exception was raised rather than instantiated. 21 | * 22 | * This is used primarily for factory-instantiated exceptions. 23 | */ 24 | trait DebugTraceableTrait 25 | { 26 | /** 27 | * Tweaks the exception's constructor to assign the file/line to where 28 | * it is actually raised rather than were it is instantiated. 29 | */ 30 | final public function __construct(string $message = '', int $code = 0, ?Throwable $previous = null) 31 | { 32 | parent::__construct($message, $code, $previous); 33 | 34 | $trace = $this->getTrace()[0]; 35 | 36 | if (isset($trace['class']) && $trace['class'] === static::class) { 37 | [ 38 | 'line' => $this->line, 39 | 'file' => $this->file, 40 | ] = $trace; 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /system/Exceptions/DownloadException.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Exceptions; 15 | 16 | /** 17 | * Class DownloadException 18 | */ 19 | class DownloadException extends RuntimeException 20 | { 21 | use DebugTraceableTrait; 22 | 23 | /** 24 | * @return static 25 | */ 26 | public static function forCannotSetFilePath(string $path) 27 | { 28 | return new static(lang('HTTP.cannotSetFilepath', [$path])); 29 | } 30 | 31 | /** 32 | * @return static 33 | */ 34 | public static function forCannotSetBinary() 35 | { 36 | return new static(lang('HTTP.cannotSetBinary')); 37 | } 38 | 39 | /** 40 | * @return static 41 | */ 42 | public static function forNotFoundDownloadSource() 43 | { 44 | return new static(lang('HTTP.notFoundDownloadSource')); 45 | } 46 | 47 | /** 48 | * @deprecated Since v4.5.6 49 | * 50 | * @return static 51 | */ 52 | public static function forCannotSetCache() 53 | { 54 | return new static(lang('HTTP.cannotSetCache')); 55 | } 56 | 57 | /** 58 | * @return static 59 | */ 60 | public static function forCannotSetStatusCode(int $code, string $reason) 61 | { 62 | return new static(lang('HTTP.cannotSetStatusCode', [$code, $reason])); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /system/Exceptions/ExceptionInterface.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Exceptions; 15 | 16 | /** 17 | * Provides a domain-level interface for broad capture 18 | * of all framework-related exceptions. 19 | * 20 | * catch (\CodeIgniter\Exceptions\ExceptionInterface) { ... } 21 | */ 22 | interface ExceptionInterface 23 | { 24 | } 25 | -------------------------------------------------------------------------------- /system/Exceptions/HTTPExceptionInterface.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Exceptions; 15 | 16 | /** 17 | * Interface for Exceptions that has exception code as HTTP status code. 18 | */ 19 | interface HTTPExceptionInterface extends ExceptionInterface 20 | { 21 | } 22 | -------------------------------------------------------------------------------- /system/Exceptions/HasExitCodeInterface.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Exceptions; 15 | 16 | /** 17 | * Interface for Exceptions that has exception code as exit code. 18 | */ 19 | interface HasExitCodeInterface extends ExceptionInterface 20 | { 21 | /** 22 | * Returns exit status code. 23 | */ 24 | public function getExitCode(): int; 25 | } 26 | -------------------------------------------------------------------------------- /system/Exceptions/InvalidArgumentException.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Exceptions; 15 | 16 | /** 17 | * Exception thrown if an argument is not of the expected type. 18 | */ 19 | class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface 20 | { 21 | } 22 | -------------------------------------------------------------------------------- /system/Exceptions/LogicException.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Exceptions; 15 | 16 | /** 17 | * Exception that represents error in the program logic. 18 | */ 19 | class LogicException extends \LogicException implements ExceptionInterface 20 | { 21 | } 22 | -------------------------------------------------------------------------------- /system/Exceptions/ModelException.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Exceptions; 15 | 16 | /** 17 | * Model Exceptions. 18 | */ 19 | class ModelException extends FrameworkException 20 | { 21 | /** 22 | * @return static 23 | */ 24 | public static function forNoPrimaryKey(string $modelName) 25 | { 26 | return new static(lang('Database.noPrimaryKey', [$modelName])); 27 | } 28 | 29 | /** 30 | * @return static 31 | */ 32 | public static function forNoDateFormat(string $modelName) 33 | { 34 | return new static(lang('Database.noDateFormat', [$modelName])); 35 | } 36 | 37 | /** 38 | * @return static 39 | */ 40 | public static function forMethodNotAvailable(string $modelName, string $methodName) 41 | { 42 | return new static(lang('Database.methodNotAvailable', [$modelName, $methodName])); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /system/Exceptions/RuntimeException.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Exceptions; 15 | 16 | /** 17 | * Exception thrown if an error which can only be found on runtime occurs. 18 | */ 19 | class RuntimeException extends \RuntimeException implements ExceptionInterface 20 | { 21 | } 22 | -------------------------------------------------------------------------------- /system/Exceptions/TestException.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Exceptions; 15 | 16 | /** 17 | * Exception thrown when there is an error with the test code. 18 | */ 19 | class TestException extends LogicException 20 | { 21 | use DebugTraceableTrait; 22 | 23 | /** 24 | * @return static 25 | */ 26 | public static function forInvalidMockClass(string $name) 27 | { 28 | return new static(lang('Test.invalidMockClass', [$name])); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /system/Files/Exceptions/ExceptionInterface.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Files\Exceptions; 15 | 16 | /** 17 | * Provides a domain-level interface for broad capture 18 | * of all Files-related exceptions. 19 | * 20 | * catch (\CodeIgniter\Files\Exceptions\ExceptionInterface) { ... } 21 | */ 22 | interface ExceptionInterface extends \CodeIgniter\Exceptions\ExceptionInterface 23 | { 24 | } 25 | -------------------------------------------------------------------------------- /system/Files/Exceptions/FileException.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Files\Exceptions; 15 | 16 | use CodeIgniter\Exceptions\DebugTraceableTrait; 17 | use CodeIgniter\Exceptions\RuntimeException; 18 | 19 | class FileException extends RuntimeException implements ExceptionInterface 20 | { 21 | use DebugTraceableTrait; 22 | 23 | /** 24 | * @return static 25 | */ 26 | public static function forUnableToMove(?string $from = null, ?string $to = null, ?string $error = null) 27 | { 28 | return new static(lang('Files.cannotMove', [$from, $to, $error])); 29 | } 30 | 31 | /** 32 | * Throws when an item is expected to be a directory but is not or is missing. 33 | * 34 | * @param string $caller The method causing the exception 35 | * 36 | * @return static 37 | */ 38 | public static function forExpectedDirectory(string $caller) 39 | { 40 | return new static(lang('Files.expectedDirectory', [$caller])); 41 | } 42 | 43 | /** 44 | * Throws when an item is expected to be a file but is not or is missing. 45 | * 46 | * @param string $caller The method causing the exception 47 | * 48 | * @return static 49 | */ 50 | public static function forExpectedFile(string $caller) 51 | { 52 | return new static(lang('Files.expectedFile', [$caller])); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /system/Files/Exceptions/FileNotFoundException.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Files\Exceptions; 15 | 16 | use CodeIgniter\Exceptions\DebugTraceableTrait; 17 | use CodeIgniter\Exceptions\RuntimeException; 18 | 19 | class FileNotFoundException extends RuntimeException implements ExceptionInterface 20 | { 21 | use DebugTraceableTrait; 22 | 23 | /** 24 | * @return static 25 | */ 26 | public static function forFileNotFound(string $path) 27 | { 28 | return new static(lang('Files.fileNotFound', [$path])); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /system/Files/FileSizeUnit.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Files; 15 | 16 | use CodeIgniter\Exceptions\InvalidArgumentException; 17 | 18 | enum FileSizeUnit: int 19 | { 20 | case B = 0; 21 | case KB = 1; 22 | case MB = 2; 23 | case GB = 3; 24 | case TB = 4; 25 | 26 | /** 27 | * Allows the creation of a FileSizeUnit from Strings like "kb" or "mb" 28 | * 29 | * @throws InvalidArgumentException 30 | */ 31 | public static function fromString(string $unit): self 32 | { 33 | return match (strtolower($unit)) { 34 | 'b' => self::B, 35 | 'kb' => self::KB, 36 | 'mb' => self::MB, 37 | 'gb' => self::GB, 38 | 'tb' => self::TB, 39 | default => throw new InvalidArgumentException("Invalid unit: {$unit}"), 40 | }; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /system/Filters/DebugToolbar.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Filters; 15 | 16 | use CodeIgniter\HTTP\RequestInterface; 17 | use CodeIgniter\HTTP\ResponseInterface; 18 | 19 | /** 20 | * Debug toolbar filter 21 | * 22 | * @see \CodeIgniter\Filters\DebugToolbarTest 23 | */ 24 | class DebugToolbar implements FilterInterface 25 | { 26 | /** 27 | * We don't need to do anything here. 28 | * 29 | * @param list<string>|null $arguments 30 | */ 31 | public function before(RequestInterface $request, $arguments = null) 32 | { 33 | return null; 34 | } 35 | 36 | /** 37 | * If the debug flag is set (CI_DEBUG) then collect performance 38 | * and debug information and display it in a toolbar. 39 | * 40 | * @param list<string>|null $arguments 41 | */ 42 | public function after(RequestInterface $request, ResponseInterface $response, $arguments = null) 43 | { 44 | service('toolbar')->prepare($request, $response); 45 | 46 | return null; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /system/Filters/Exceptions/FilterException.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Filters\Exceptions; 15 | 16 | use CodeIgniter\Exceptions\ConfigException; 17 | 18 | /** 19 | * FilterException 20 | */ 21 | class FilterException extends ConfigException 22 | { 23 | /** 24 | * Thrown when the provided alias is not within 25 | * the list of configured filter aliases. 26 | * 27 | * @return static 28 | */ 29 | public static function forNoAlias(string $alias) 30 | { 31 | return new static(lang('Filters.noFilter', [$alias])); 32 | } 33 | 34 | /** 35 | * Thrown when the filter class does not implement FilterInterface. 36 | * 37 | * @return static 38 | */ 39 | public static function forIncorrectInterface(string $class) 40 | { 41 | return new static(lang('Filters.incorrectInterface', [$class])); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /system/Filters/Honeypot.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Filters; 15 | 16 | use CodeIgniter\Honeypot\Exceptions\HoneypotException; 17 | use CodeIgniter\HTTP\IncomingRequest; 18 | use CodeIgniter\HTTP\RequestInterface; 19 | use CodeIgniter\HTTP\ResponseInterface; 20 | 21 | /** 22 | * Honeypot filter 23 | * 24 | * @see \CodeIgniter\Filters\HoneypotTest 25 | */ 26 | class Honeypot implements FilterInterface 27 | { 28 | /** 29 | * Checks if Honeypot field is empty, if not then the 30 | * requester is a bot 31 | * 32 | * @param list<string>|null $arguments 33 | * 34 | * @throws HoneypotException 35 | */ 36 | public function before(RequestInterface $request, $arguments = null) 37 | { 38 | if (! $request instanceof IncomingRequest) { 39 | return null; 40 | } 41 | 42 | if (service('honeypot')->hasContent($request)) { 43 | throw HoneypotException::isBot(); 44 | } 45 | 46 | return null; 47 | } 48 | 49 | /** 50 | * Attach a honeypot to the current response. 51 | * 52 | * @param list<string>|null $arguments 53 | */ 54 | public function after(RequestInterface $request, ResponseInterface $response, $arguments = null) 55 | { 56 | service('honeypot')->attachHoneypot($response); 57 | 58 | return null; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /system/Format/FormatterInterface.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Format; 15 | 16 | /** 17 | * Formatter interface 18 | */ 19 | interface FormatterInterface 20 | { 21 | /** 22 | * Takes the given data and formats it. 23 | * 24 | * @param array<array-key, mixed>|object|string $data 25 | * 26 | * @return false|non-empty-string 27 | */ 28 | public function format($data); 29 | } 30 | -------------------------------------------------------------------------------- /system/Format/JSONFormatter.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Format; 15 | 16 | use CodeIgniter\Format\Exceptions\FormatException; 17 | use Config\Format; 18 | 19 | /** 20 | * JSON data formatter 21 | * 22 | * @see \CodeIgniter\Format\JSONFormatterTest 23 | */ 24 | class JSONFormatter implements FormatterInterface 25 | { 26 | /** 27 | * Takes the given data and formats it. 28 | * 29 | * @param array<array-key, mixed>|object|string $data 30 | * 31 | * @return false|non-empty-string 32 | */ 33 | public function format($data) 34 | { 35 | $config = new Format(); 36 | 37 | $options = $config->formatterOptions['application/json'] ?? JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES; 38 | $options |= JSON_PARTIAL_OUTPUT_ON_ERROR; 39 | 40 | if (ENVIRONMENT !== 'production') { 41 | $options |= JSON_PRETTY_PRINT; 42 | } 43 | 44 | $result = json_encode($data, $options, 512); 45 | 46 | if (! in_array(json_last_error(), [JSON_ERROR_NONE, JSON_ERROR_RECURSION], true)) { 47 | throw FormatException::forInvalidJSON(json_last_error_msg()); 48 | } 49 | 50 | return $result; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /system/HTTP/Exceptions/BadRequestException.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\HTTP\Exceptions; 15 | 16 | use CodeIgniter\Exceptions\HTTPExceptionInterface; 17 | use CodeIgniter\Exceptions\RuntimeException; 18 | 19 | /** 20 | * 400 Bad Request 21 | */ 22 | class BadRequestException extends RuntimeException implements HTTPExceptionInterface 23 | { 24 | /** 25 | * HTTP status code for Bad Request 26 | * 27 | * @var int 28 | */ 29 | protected $code = 400; // @phpstan-ignore-line 30 | } 31 | -------------------------------------------------------------------------------- /system/HTTP/Exceptions/ExceptionInterface.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\HTTP\Exceptions; 15 | 16 | /** 17 | * Provides a domain-level interface for broad capture 18 | * of all HTTP-related exceptions. 19 | * 20 | * catch (\CodeIgniter\HTTP\Exceptions\ExceptionInterface) { ... } 21 | */ 22 | interface ExceptionInterface extends \CodeIgniter\Exceptions\ExceptionInterface 23 | { 24 | } 25 | -------------------------------------------------------------------------------- /system/HTTP/RequestInterface.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\HTTP; 15 | 16 | /** 17 | * Representation of an incoming, server-side HTTP request. 18 | * 19 | * Corresponds to Psr7\ServerRequestInterface. 20 | */ 21 | interface RequestInterface extends OutgoingRequestInterface 22 | { 23 | /** 24 | * Gets the user's IP address. 25 | * Supplied by RequestTrait. 26 | * 27 | * @return string IP address 28 | */ 29 | public function getIPAddress(): string; 30 | 31 | /** 32 | * Fetch an item from the $_SERVER array. 33 | * Supplied by RequestTrait. 34 | * 35 | * @param array|string|null $index Index for item to be fetched from $_SERVER 36 | * @param int|null $filter A filter name to be applied 37 | * 38 | * @return mixed 39 | */ 40 | public function getServer($index = null, $filter = null); 41 | } 42 | -------------------------------------------------------------------------------- /system/HTTP/ResponsableInterface.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\HTTP; 15 | 16 | interface ResponsableInterface 17 | { 18 | public function getResponse(): ResponseInterface; 19 | } 20 | -------------------------------------------------------------------------------- /system/Helpers/xml_helper.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | // CodeIgniter XML Helpers 15 | 16 | if (! function_exists('xml_convert')) { 17 | /** 18 | * Convert Reserved XML characters to Entities 19 | */ 20 | function xml_convert(string $str, bool $protectAll = false): string 21 | { 22 | $temp = '__TEMP_AMPERSANDS__'; 23 | 24 | // Replace entities to temporary markers so that 25 | // ampersands won't get messed up 26 | $str = preg_replace('/&#(\d+);/', $temp . '\\1;', $str); 27 | 28 | if ($protectAll) { 29 | $str = preg_replace('/&(\w+);/', $temp . '\\1;', $str); 30 | } 31 | 32 | $original = [ 33 | '&', 34 | '<', 35 | '>', 36 | '"', 37 | "'", 38 | '-', 39 | ]; 40 | 41 | $replacement = [ 42 | '&', 43 | '<', 44 | '>', 45 | '"', 46 | ''', 47 | '-', 48 | ]; 49 | 50 | $str = str_replace($original, $replacement, $str); 51 | 52 | // Decode the temp markers back to entities 53 | $str = preg_replace('/' . $temp . '(\d+);/', '&#\\1;', $str); 54 | 55 | if ($protectAll) { 56 | return preg_replace('/' . $temp . '(\w+);/', '&\\1;', $str); 57 | } 58 | 59 | return $str; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /system/Honeypot/Exceptions/HoneypotException.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Honeypot\Exceptions; 15 | 16 | use CodeIgniter\Exceptions\ConfigException; 17 | 18 | class HoneypotException extends ConfigException 19 | { 20 | /** 21 | * Thrown when the template value of config is empty. 22 | * 23 | * @return static 24 | */ 25 | public static function forNoTemplate() 26 | { 27 | return new static(lang('Honeypot.noTemplate')); 28 | } 29 | 30 | /** 31 | * Thrown when the name value of config is empty. 32 | * 33 | * @return static 34 | */ 35 | public static function forNoNameField() 36 | { 37 | return new static(lang('Honeypot.noNameField')); 38 | } 39 | 40 | /** 41 | * Thrown when the hidden value of config is false. 42 | * 43 | * @return static 44 | */ 45 | public static function forNoHiddenValue() 46 | { 47 | return new static(lang('Honeypot.noHiddenValue')); 48 | } 49 | 50 | /** 51 | * Thrown when there are no data in the request of honeypot field. 52 | * 53 | * @return static 54 | */ 55 | public static function isBot() 56 | { 57 | return new static(lang('Honeypot.theClientIsABot')); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /system/HotReloader/IteratorFilter.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\HotReloader; 15 | 16 | use Config\Toolbar; 17 | use RecursiveFilterIterator; 18 | use RecursiveIterator; 19 | 20 | /** 21 | * @internal 22 | * 23 | * @psalm-suppress MissingTemplateParam 24 | */ 25 | final class IteratorFilter extends RecursiveFilterIterator implements RecursiveIterator 26 | { 27 | private array $watchedExtensions = []; 28 | 29 | public function __construct(RecursiveIterator $iterator) 30 | { 31 | parent::__construct($iterator); 32 | 33 | $this->watchedExtensions = config(Toolbar::class)->watchedExtensions; 34 | } 35 | 36 | /** 37 | * Apply filters to the files in the iterator. 38 | */ 39 | public function accept(): bool 40 | { 41 | if (! $this->current()->isFile()) { 42 | return true; 43 | } 44 | 45 | $filename = $this->current()->getFilename(); 46 | 47 | // Skip hidden files and directories. 48 | if ($filename[0] === '.') { 49 | return false; 50 | } 51 | 52 | // Only consume files of interest. 53 | $ext = trim(strtolower($this->current()->getExtension()), '. '); 54 | 55 | return in_array($ext, $this->watchedExtensions, true); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /system/I18n/Time.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\I18n; 15 | 16 | use DateTimeImmutable; 17 | use Stringable; 18 | 19 | /** 20 | * A localized date/time package inspired 21 | * by Nesbot/Carbon and CakePHP/Chronos. 22 | * 23 | * Requires the intl PHP extension. 24 | * 25 | * @property-read int $age 26 | * @property-read string $day 27 | * @property-read string $dayOfWeek 28 | * @property-read string $dayOfYear 29 | * @property-read bool $dst 30 | * @property-read string $hour 31 | * @property-read bool $local 32 | * @property-read string $minute 33 | * @property-read string $month 34 | * @property-read string $quarter 35 | * @property-read string $second 36 | * @property-read int $timestamp 37 | * @property-read bool $utc 38 | * @property-read string $weekOfMonth 39 | * @property-read string $weekOfYear 40 | * @property-read string $year 41 | * 42 | * @phpstan-consistent-constructor 43 | * 44 | * @see \CodeIgniter\I18n\TimeTest 45 | */ 46 | class Time extends DateTimeImmutable implements Stringable 47 | { 48 | use TimeTrait; 49 | } 50 | -------------------------------------------------------------------------------- /system/Language/en/Cache.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | // Cache language settings 15 | return [ 16 | 'unableToWrite' => 'Cache unable to write to "{0}".', 17 | 'invalidHandlers' => 'Cache config must have an array of $validHandlers.', 18 | 'noBackup' => 'Cache config must have a handler and backupHandler set.', 19 | 'handlerNotFound' => 'Cache config has an invalid handler or backup handler specified.', 20 | ]; 21 | -------------------------------------------------------------------------------- /system/Language/en/Cast.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | // Cast language settings 15 | return [ 16 | 'baseCastMissing' => 'The "{0}" class must inherit the "CodeIgniter\Entity\Cast\BaseCast" class.', 17 | 'invalidCastMethod' => 'The "{0}" is invalid cast method, valid methods are: ["get", "set"].', 18 | 'invalidTimestamp' => 'Type casting "timestamp" expects a correct timestamp.', 19 | 'jsonErrorCtrlChar' => 'Unexpected control character found.', 20 | 'jsonErrorDepth' => 'Maximum stack depth exceeded.', 21 | 'jsonErrorStateMismatch' => 'Underflow or the modes mismatch.', 22 | 'jsonErrorSyntax' => 'Syntax error, malformed JSON.', 23 | 'jsonErrorUnknown' => 'Unknown error.', 24 | 'jsonErrorUtf8' => 'Malformed UTF-8 characters, possibly incorrectly encoded.', 25 | ]; 26 | -------------------------------------------------------------------------------- /system/Language/en/Cookie.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | // Cookie language settings 15 | return [ 16 | 'invalidExpiresTime' => 'Invalid "{0}" type for "Expires" attribute. Expected: string, integer, DateTimeInterface object.', 17 | 'invalidExpiresValue' => 'The cookie expiration time is not valid.', 18 | 'invalidCookieName' => 'The cookie name "{0}" contains invalid characters.', 19 | 'emptyCookieName' => 'The cookie name cannot be empty.', 20 | 'invalidSecurePrefix' => 'Using the "__Secure-" prefix requires setting the "Secure" attribute.', 21 | 'invalidHostPrefix' => 'Using the "__Host-" prefix must be set with the "Secure" flag, must not have a "Domain" attribute, and the "Path" is set to "/".', 22 | 'invalidSameSite' => 'The SameSite value must be None, Lax, Strict or a blank string, {0} given.', 23 | 'invalidSameSiteNone' => 'Using the "SameSite=None" attribute requires setting the "Secure" attribute.', 24 | 'invalidCookieInstance' => '"{0}" class expected cookies array to be instances of "{1}" but got "{2}" at index {3}.', 25 | 'unknownCookieInstance' => 'Cookie object with name "{0}" and prefix "{1}" was not found in the collection.', 26 | ]; 27 | -------------------------------------------------------------------------------- /system/Language/en/Core.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | // Core language settings 15 | return [ 16 | 'copyError' => 'An error was encountered while attempting to replace the file "{0}". Please make sure your file directory is writable.', 17 | 'enabledZlibOutputCompression' => 'Your zlib.output_compression ini directive is turned on. This will not work well with output buffers.', 18 | 'invalidFile' => 'Invalid file: "{0}"', 19 | 'invalidDirectory' => 'Directory does not exist: "{0}"', 20 | 'invalidPhpVersion' => 'Your PHP version must be {0} or higher to run CodeIgniter. Current version: {1}', 21 | 'missingExtension' => 'The framework needs the following extension(s) installed and loaded: "{0}".', 22 | 'noHandlers' => '"{0}" must provide at least one Handler.', 23 | ]; 24 | -------------------------------------------------------------------------------- /system/Language/en/Encryption.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | // Encryption language settings 15 | return [ 16 | 'noDriverRequested' => 'No driver requested; Miss Daisy will be so upset!', 17 | 'noHandlerAvailable' => 'Unable to find an available "{0}" encryption handler.', 18 | 'unKnownHandler' => '"{0}" cannot be configured.', 19 | 'starterKeyNeeded' => 'Encrypter needs a starter key.', 20 | 'authenticationFailed' => 'Decrypting: authentication failed.', 21 | 'encryptionFailed' => 'Encryption failed.', 22 | ]; 23 | -------------------------------------------------------------------------------- /system/Language/en/Errors.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | // Errors language settings 15 | return [ 16 | 'pageNotFound' => '404 - Page Not Found', 17 | 'sorryCannotFind' => 'Sorry! Cannot seem to find the page you were looking for.', 18 | 'badRequest' => '400 - Bad Request', 19 | 'sorryBadRequest' => 'Sorry! Something is wrong with your request.', 20 | 'whoops' => 'Whoops!', 21 | 'weHitASnag' => 'We seem to have hit a snag. Please try again later...', 22 | ]; 23 | -------------------------------------------------------------------------------- /system/Language/en/Fabricator.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | // Fabricator language settings 15 | return [ 16 | 'invalidModel' => 'Invalid model supplied for fabrication.', 17 | 'missingFormatters' => 'No valid formatters defined.', 18 | 'createFailed' => 'Fabricator failed to insert on table "{0}": {1}', 19 | ]; 20 | -------------------------------------------------------------------------------- /system/Language/en/Files.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | // Files language settings 15 | return [ 16 | 'fileNotFound' => 'File not found: "{0}"', 17 | 'cannotMove' => 'Could not move file "{0}" to "{1}". Reason: {2}', 18 | 'expectedDirectory' => '{0} expects a valid directory.', 19 | 'expectedFile' => '{0} expects a valid file.', 20 | ]; 21 | -------------------------------------------------------------------------------- /system/Language/en/Filters.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | // Filters language settings 15 | return [ 16 | 'noFilter' => '"{0}" filter must have a matching alias defined.', 17 | 'incorrectInterface' => '"{0}" must implement CodeIgniter\Filters\FilterInterface.', 18 | ]; 19 | -------------------------------------------------------------------------------- /system/Language/en/Format.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | // Format language settings 15 | return [ 16 | 'invalidFormatter' => '"{0}" is not a valid Formatter class.', 17 | 'invalidJSON' => 'Failed to parse JSON string. Error: {0}', 18 | 'invalidMime' => 'No Formatter defined for mime type: "{0}".', 19 | 'missingExtension' => 'The SimpleXML extension is required to format XML.', 20 | ]; 21 | -------------------------------------------------------------------------------- /system/Language/en/Language.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | // "Language" language settings 15 | return [ 16 | 'invalidMessageFormat' => 'Invalid message format: "{0}", args: "{1}"', 17 | ]; 18 | -------------------------------------------------------------------------------- /system/Language/en/Log.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | // Log language settings 15 | return [ 16 | 'invalidLogLevel' => '"{0}" is an invalid log level.', 17 | 'invalidMessageType' => 'The given message type "{0}" is not supported.', 18 | ]; 19 | -------------------------------------------------------------------------------- /system/Language/en/Number.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | // Number language settings 15 | return [ 16 | 'terabyteAbbr' => 'TB', 17 | 'gigabyteAbbr' => 'GB', 18 | 'megabyteAbbr' => 'MB', 19 | 'kilobyteAbbr' => 'KB', 20 | 'bytes' => 'Bytes', 21 | 22 | // don't forget the space in front of these! 23 | 'thousand' => ' thousand', 24 | 'million' => ' million', 25 | 'billion' => ' billion', 26 | 'trillion' => ' trillion', 27 | 'quadrillion' => ' quadrillion', 28 | ]; 29 | -------------------------------------------------------------------------------- /system/Language/en/Pager.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | // Pager language settings 15 | return [ 16 | 'pageNavigation' => 'Page navigation', 17 | 'first' => 'First', 18 | 'previous' => 'Previous', 19 | 'next' => 'Next', 20 | 'last' => 'Last', 21 | 'older' => 'Older', 22 | 'newer' => 'Newer', 23 | 'invalidTemplate' => '"{0}" is not a valid Pager template.', 24 | 'invalidPaginationGroup' => '"{0}" is not a valid Pagination group.', 25 | ]; 26 | -------------------------------------------------------------------------------- /system/Language/en/Publisher.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | // Publisher language settings 15 | return [ 16 | 'collision' => 'Publisher encountered an unexpected "{0}" while copying "{1}" to "{2}".', 17 | 'destinationNotAllowed' => 'Destination is not on the allowed list of Publisher directories: "{0}"', 18 | 'fileNotAllowed' => '"{0}" fails the following restriction for "{1}": {2}', 19 | 20 | // Publish Command 21 | 'publishMissing' => 'No Publisher classes detected in {0} across all namespaces.', 22 | 'publishMissingNamespace' => 'No Publisher classes detected in {0} in the {1} namespace.', 23 | 'publishSuccess' => '"{0}" published {1} file(s) to "{2}".', 24 | 'publishFailure' => '"{0}" failed to publish to "{1}".', 25 | ]; 26 | -------------------------------------------------------------------------------- /system/Language/en/RESTful.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | // RESTful language settings 15 | return [ 16 | 'notImplemented' => '"{0}" action not implemented.', 17 | ]; 18 | -------------------------------------------------------------------------------- /system/Language/en/Router.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | // Router language settings 15 | return [ 16 | 'invalidParameter' => 'A parameter does not match the expected type.', 17 | 'missingDefaultRoute' => 'Unable to determine what should be displayed. A default route has not been specified in the routing file.', 18 | 'invalidDynamicController' => 'A dynamic controller is not allowed for security reasons. Route handler: "{0}"', 19 | 'invalidControllerName' => 'The namespace delimiter is a backslash (\), not a slash (/). Route handler: "{0}"', 20 | ]; 21 | -------------------------------------------------------------------------------- /system/Language/en/Security.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | // Security language settings 15 | return [ 16 | 'disallowedAction' => 'The action you requested is not allowed.', 17 | 'insecureCookie' => 'Attempted to send a secure cookie over a non-secure connection.', 18 | 19 | // @deprecated 20 | 'invalidSameSite' => 'The SameSite value must be None, Lax, Strict, or a blank string. Given: "{0}"', 21 | ]; 22 | -------------------------------------------------------------------------------- /system/Language/en/Session.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | // Session language settings 15 | return [ 16 | 'missingDatabaseTable' => '"sessionSavePath" must have the table name for the Database Session Handler to work.', 17 | 'invalidSavePath' => 'Session: Configured save path "{0}" is not a directory, does not exist or cannot be created.', 18 | 'writeProtectedSavePath' => 'Session: Configured save path "{0}" is not writable by the PHP process.', 19 | 'emptySavePath' => 'Session: No save path configured.', 20 | 'invalidSavePathFormat' => 'Session: Invalid Redis save path format: "{0}"', 21 | 22 | // @deprecated 23 | 'invalidSameSiteSetting' => 'Session: The SameSite setting must be None, Lax, Strict, or a blank string. Given: "{0}"', 24 | ]; 25 | -------------------------------------------------------------------------------- /system/Language/en/Test.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | // Testing language settings 15 | return [ 16 | 'invalidMockClass' => '"{0}" is not a valid Mock class', 17 | ]; 18 | -------------------------------------------------------------------------------- /system/Language/en/Time.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | // Time language settings 15 | return [ 16 | 'invalidFormat' => '"{0}" is not a valid datetime format', 17 | 'invalidMonth' => 'Months must be between 1 and 12. Given: {0}', 18 | 'invalidDay' => 'Days must be between 1 and 31. Given: {0}', 19 | 'invalidOverDay' => 'Days must be between 1 and {0}. Given: {1}', 20 | 'invalidHours' => 'Hours must be between 0 and 23. Given: {0}', 21 | 'invalidMinutes' => 'Minutes must be between 0 and 59. Given: {0}', 22 | 'invalidSeconds' => 'Seconds must be between 0 and 59. Given: {0}', 23 | 'years' => '{0, plural, =1{# year} other{# years}}', 24 | 'months' => '{0, plural, =1{# month} other{# months}}', 25 | 'weeks' => '{0, plural, =1{# week} other{# weeks}}', 26 | 'days' => '{0, plural, =1{# day} other{# days}}', 27 | 'hours' => '{0, plural, =1{# hour} other{# hours}}', 28 | 'minutes' => '{0, plural, =1{# minute} other{# minutes}}', 29 | 'seconds' => '{0, plural, =1{# second} other{# seconds}}', 30 | 'ago' => '{0} ago', 31 | 'inFuture' => 'in {0}', 32 | 'yesterday' => 'Yesterday', 33 | 'tomorrow' => 'Tomorrow', 34 | 'now' => 'Just now', 35 | ]; 36 | -------------------------------------------------------------------------------- /system/Language/en/View.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | // View language settings 15 | return [ 16 | 'invalidCellMethod' => '{class}::{method} is not a valid method.', 17 | 'missingCellParameters' => '{class}::{method} has no params.', 18 | 'invalidCellParameter' => '"{0}" is not a valid param name.', 19 | 'noCellClass' => 'No view cell class provided.', 20 | 'invalidCellClass' => 'Unable to locate view cell class: "{0}".', 21 | 'tagSyntaxError' => 'You have a syntax error in your Parser tags: "{0}"', 22 | 'invalidDecoratorClass' => '"{0}" is not a valid View Decorator.', 23 | ]; 24 | -------------------------------------------------------------------------------- /system/Log/Exceptions/LogException.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Log\Exceptions; 15 | 16 | use CodeIgniter\Exceptions\FrameworkException; 17 | 18 | class LogException extends FrameworkException 19 | { 20 | /** 21 | * @return static 22 | */ 23 | public static function forInvalidLogLevel(string $level) 24 | { 25 | return new static(lang('Log.invalidLogLevel', [$level])); 26 | } 27 | 28 | /** 29 | * @return static 30 | */ 31 | public static function forInvalidMessageType(string $messageType) 32 | { 33 | return new static(lang('Log.invalidMessageType', [$messageType])); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /system/Log/Handlers/BaseHandler.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Log\Handlers; 15 | 16 | /** 17 | * Base class for logging 18 | */ 19 | abstract class BaseHandler implements HandlerInterface 20 | { 21 | /** 22 | * Handles 23 | * 24 | * @var list<string> 25 | */ 26 | protected $handles; 27 | 28 | /** 29 | * Date format for logging 30 | * 31 | * @var string 32 | */ 33 | protected $dateFormat = 'Y-m-d H:i:s'; 34 | 35 | /** 36 | * @param array{handles?: list<string>} $config 37 | */ 38 | public function __construct(array $config) 39 | { 40 | $this->handles = $config['handles'] ?? []; 41 | } 42 | 43 | /** 44 | * Checks whether the Handler will handle logging items of this 45 | * log Level. 46 | */ 47 | public function canHandle(string $level): bool 48 | { 49 | return in_array($level, $this->handles, true); 50 | } 51 | 52 | /** 53 | * Stores the date format to use while logging messages. 54 | */ 55 | public function setDateFormat(string $format): HandlerInterface 56 | { 57 | $this->dateFormat = $format; 58 | 59 | return $this; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /system/Log/Handlers/HandlerInterface.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Log\Handlers; 15 | 16 | /** 17 | * Expected behavior for a Log handler 18 | */ 19 | interface HandlerInterface 20 | { 21 | /** 22 | * Handles logging the message. 23 | * If the handler returns false, then execution of handlers 24 | * will stop. Any handlers that have not run, yet, will not 25 | * be run. 26 | * 27 | * @param string $level 28 | * @param string $message 29 | */ 30 | public function handle($level, $message): bool; 31 | 32 | /** 33 | * Checks whether the Handler will handle logging items of this 34 | * log Level. 35 | */ 36 | public function canHandle(string $level): bool; 37 | 38 | /** 39 | * Sets the preferred date format to use when logging. 40 | * 41 | * @return HandlerInterface 42 | */ 43 | public function setDateFormat(string $format); 44 | } 45 | -------------------------------------------------------------------------------- /system/Pager/Exceptions/PagerException.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Pager\Exceptions; 15 | 16 | use CodeIgniter\Exceptions\FrameworkException; 17 | 18 | class PagerException extends FrameworkException 19 | { 20 | /** 21 | * Throws when the template is invalid. 22 | * 23 | * @return static 24 | */ 25 | public static function forInvalidTemplate(?string $template = null) 26 | { 27 | return new static(lang('Pager.invalidTemplate', [$template])); 28 | } 29 | 30 | /** 31 | * Throws when the group is invalid. 32 | * 33 | * @return static 34 | */ 35 | public static function forInvalidPaginationGroup(?string $group = null) 36 | { 37 | return new static(lang('Pager.invalidPaginationGroup', [$group])); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /system/Pager/Views/default_full.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | use CodeIgniter\Pager\PagerRenderer; 4 | 5 | /** 6 | * @var PagerRenderer $pager 7 | */ 8 | $pager->setSurroundCount(2); 9 | ?> 10 | 11 | <nav aria-label="<?= lang('Pager.pageNavigation') ?>"> 12 | <ul class="pagination"> 13 | <?php if ($pager->hasPrevious()) : ?> 14 | <li> 15 | <a href="<?= $pager->getFirst() ?>" aria-label="<?= lang('Pager.first') ?>"> 16 | <span aria-hidden="true"><?= lang('Pager.first') ?></span> 17 | </a> 18 | </li> 19 | <li> 20 | <a href="<?= $pager->getPrevious() ?>" aria-label="<?= lang('Pager.previous') ?>"> 21 | <span aria-hidden="true"><?= lang('Pager.previous') ?></span> 22 | </a> 23 | </li> 24 | <?php endif ?> 25 | 26 | <?php foreach ($pager->links() as $link) : ?> 27 | <li <?= $link['active'] ? 'class="active"' : '' ?>> 28 | <a href="<?= $link['uri'] ?>"> 29 | <?= $link['title'] ?> 30 | </a> 31 | </li> 32 | <?php endforeach ?> 33 | 34 | <?php if ($pager->hasNext()) : ?> 35 | <li> 36 | <a href="<?= $pager->getNext() ?>" aria-label="<?= lang('Pager.next') ?>"> 37 | <span aria-hidden="true"><?= lang('Pager.next') ?></span> 38 | </a> 39 | </li> 40 | <li> 41 | <a href="<?= $pager->getLast() ?>" aria-label="<?= lang('Pager.last') ?>"> 42 | <span aria-hidden="true"><?= lang('Pager.last') ?></span> 43 | </a> 44 | </li> 45 | <?php endif ?> 46 | </ul> 47 | </nav> 48 | -------------------------------------------------------------------------------- /system/Pager/Views/default_head.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | /** 4 | * This file is part of CodeIgniter 4 framework. 5 | * 6 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 7 | * 8 | * For the full copyright and license information, please view 9 | * the LICENSE 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 | echo '<link rel="prev" href="' . $pager->getPrevious() . '">' . PHP_EOL; 21 | } 22 | 23 | echo '<link rel="canonical" href="' . $pager->getCurrent() . '">' . PHP_EOL; 24 | 25 | if ($pager->hasNext()) { 26 | echo '<link rel="next" href="' . $pager->getNext() . '">' . PHP_EOL; 27 | } 28 | -------------------------------------------------------------------------------- /system/Pager/Views/default_simple.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | use CodeIgniter\Pager\PagerRenderer; 4 | 5 | /** 6 | * @var PagerRenderer $pager 7 | */ 8 | $pager->setSurroundCount(0); 9 | ?> 10 | <nav> 11 | <ul class="pager"> 12 | <li <?= $pager->hasPrevious() ? '' : 'class="disabled"' ?>> 13 | <a href="<?= $pager->getPrevious() ?? '#' ?>" aria-label="<?= lang('Pager.previous') ?>"> 14 | <span aria-hidden="true"><?= lang('Pager.newer') ?></span> 15 | </a> 16 | </li> 17 | <li <?= $pager->hasNext() ? '' : 'class="disabled"' ?>> 18 | <a href="<?= $pager->getNext() ?? '#' ?>" aria-label="<?= lang('Pager.next') ?>"> 19 | <span aria-hidden="true"><?= lang('Pager.older') ?></span> 20 | </a> 21 | </li> 22 | </ul> 23 | </nav> 24 | -------------------------------------------------------------------------------- /system/Router/AutoRouterInterface.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Router; 15 | 16 | /** 17 | * Expected behavior of a AutoRouter. 18 | */ 19 | interface AutoRouterInterface 20 | { 21 | /** 22 | * Returns controller, method and params from the URI. 23 | * 24 | * @return array [directory_name, controller_name, controller_method, params] 25 | */ 26 | public function getRoute(string $uri, string $httpVerb): array; 27 | } 28 | -------------------------------------------------------------------------------- /system/Router/Exceptions/ExceptionInterface.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Router\Exceptions; 15 | 16 | /** 17 | * Provides a domain-level interface for broad capture 18 | * of all Router-related exceptions. 19 | * 20 | * catch (\CodeIgniter\Router\Exceptions\ExceptionInterface) { ... } 21 | */ 22 | interface ExceptionInterface extends \CodeIgniter\Exceptions\ExceptionInterface 23 | { 24 | } 25 | -------------------------------------------------------------------------------- /system/Router/Exceptions/MethodNotFoundException.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Router\Exceptions; 15 | 16 | use CodeIgniter\Exceptions\RuntimeException; 17 | 18 | /** 19 | * @internal 20 | */ 21 | final class MethodNotFoundException extends RuntimeException implements ExceptionInterface 22 | { 23 | } 24 | -------------------------------------------------------------------------------- /system/Session/Handlers/Database/MySQLiHandler.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Session\Handlers\Database; 15 | 16 | use CodeIgniter\Session\Handlers\DatabaseHandler; 17 | 18 | /** 19 | * Session handler for MySQLi 20 | * 21 | * @see \CodeIgniter\Session\Handlers\Database\MySQLiHandlerTest 22 | */ 23 | class MySQLiHandler extends DatabaseHandler 24 | { 25 | /** 26 | * Lock the session. 27 | */ 28 | protected function lockSession(string $sessionID): bool 29 | { 30 | $arg = md5($sessionID . ($this->matchIP ? '_' . $this->ipAddress : '')); 31 | if ($this->db->query("SELECT GET_LOCK('{$arg}', 300) AS ci_session_lock")->getRow()->ci_session_lock) { 32 | $this->lock = $arg; 33 | 34 | return true; 35 | } 36 | 37 | return $this->fail(); 38 | } 39 | 40 | /** 41 | * Releases the lock, if any. 42 | */ 43 | protected function releaseLock(): bool 44 | { 45 | if (! $this->lock) { 46 | return true; 47 | } 48 | 49 | if ($this->db->query("SELECT RELEASE_LOCK('{$this->lock}') AS ci_session_lock")->getRow()->ci_session_lock) { 50 | $this->lock = false; 51 | 52 | return true; 53 | } 54 | 55 | return $this->fail(); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /system/Superglobals.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter; 15 | 16 | /** 17 | * Superglobals manipulation. 18 | * 19 | * @internal 20 | * @see \CodeIgniter\SuperglobalsTest 21 | */ 22 | final class Superglobals 23 | { 24 | private array $server; 25 | private array $get; 26 | 27 | public function __construct(?array $server = null, ?array $get = null) 28 | { 29 | $this->server = $server ?? $_SERVER; 30 | $this->get = $get ?? $_GET; 31 | } 32 | 33 | public function server(string $key): ?string 34 | { 35 | return $this->server[$key] ?? null; 36 | } 37 | 38 | public function setServer(string $key, string $value): void 39 | { 40 | $this->server[$key] = $value; 41 | $_SERVER[$key] = $value; 42 | } 43 | 44 | /** 45 | * @return array|string|null 46 | */ 47 | public function get(string $key) 48 | { 49 | return $this->get[$key] ?? null; 50 | } 51 | 52 | public function setGet(string $key, string $value): void 53 | { 54 | $this->get[$key] = $value; 55 | $_GET[$key] = $value; 56 | } 57 | 58 | public function setGetArray(array $array): void 59 | { 60 | $this->get = $array; 61 | $_GET = $array; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /system/Test/ConfigFromArrayTrait.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Test; 15 | 16 | use CodeIgniter\Exceptions\LogicException; 17 | 18 | trait ConfigFromArrayTrait 19 | { 20 | /** 21 | * Creates a Config instance from an array. 22 | * 23 | * @template T of \CodeIgniter\Config\BaseConfig 24 | * 25 | * @param class-string<T> $classname Config classname 26 | * @param array<string, mixed> $config 27 | * 28 | * @return T 29 | */ 30 | private function createConfigFromArray(string $classname, array $config) 31 | { 32 | $configObj = new $classname(); 33 | 34 | foreach ($config as $key => $value) { 35 | if (property_exists($configObj, $key)) { 36 | $configObj->{$key} = $value; 37 | 38 | continue; 39 | } 40 | 41 | throw new LogicException( 42 | 'No such property: ' . $classname . '::#39; . $key, 43 | ); 44 | } 45 | 46 | return $configObj; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /system/Test/IniTestTrait.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Test; 15 | 16 | trait IniTestTrait 17 | { 18 | private array $iniSettings = []; 19 | 20 | private function backupIniValues(array $keys): void 21 | { 22 | foreach ($keys as $key) { 23 | $this->iniSettings[$key] = ini_get($key); 24 | } 25 | } 26 | 27 | private function restoreIniValues(): void 28 | { 29 | foreach ($this->iniSettings as $key => $value) { 30 | ini_set($key, $value); 31 | } 32 | 33 | $this->iniSettings = []; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /system/Test/Mock/MockAppConfig.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Test\Mock; 15 | 16 | use Config\App; 17 | 18 | class MockAppConfig extends App 19 | { 20 | public string $baseURL = 'http://example.com/'; 21 | public string $uriProtocol = 'REQUEST_URI'; 22 | public array $proxyIPs = []; 23 | public bool $CSPEnabled = false; 24 | public string $defaultLocale = 'en'; 25 | public bool $negotiateLocale = false; 26 | public array $supportedLocales = [ 27 | 'en', 28 | 'es', 29 | ]; 30 | } 31 | -------------------------------------------------------------------------------- /system/Test/Mock/MockAutoload.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Test\Mock; 15 | 16 | use Config\Autoload; 17 | 18 | class MockAutoload extends Autoload 19 | { 20 | public $psr4 = []; 21 | public $classmap = []; 22 | 23 | public function __construct() 24 | { 25 | // Don't call the parent since we don't want the default mappings. 26 | // parent::__construct(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /system/Test/Mock/MockBuilder.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Test\Mock; 15 | 16 | use CodeIgniter\Database\BaseBuilder; 17 | 18 | class MockBuilder extends BaseBuilder 19 | { 20 | /** 21 | * @var array<string, string> 22 | */ 23 | protected $supportedIgnoreStatements = [ 24 | 'update' => 'IGNORE', 25 | 'insert' => 'IGNORE', 26 | 'delete' => 'IGNORE', 27 | ]; 28 | } 29 | -------------------------------------------------------------------------------- /system/Test/Mock/MockCLIConfig.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Test\Mock; 15 | 16 | use Config\App; 17 | 18 | class MockCLIConfig extends App 19 | { 20 | public string $baseURL = 'http://example.com/'; 21 | public string $uriProtocol = 'REQUEST_URI'; 22 | public array $proxyIPs = []; 23 | public string $CSRFTokenName = 'csrf_test_name'; 24 | public string $CSRFCookieName = 'csrf_cookie_name'; 25 | public int $CSRFExpire = 7200; 26 | public bool $CSRFRegenerate = true; 27 | 28 | /** 29 | * @var list<string> 30 | */ 31 | public array $CSRFExcludeURIs = ['http://example.com']; 32 | 33 | public string $CSRFSameSite = 'Lax'; 34 | public bool $CSPEnabled = false; 35 | public string $defaultLocale = 'en'; 36 | public bool $negotiateLocale = false; 37 | public array $supportedLocales = [ 38 | 'en', 39 | 'es', 40 | ]; 41 | } 42 | -------------------------------------------------------------------------------- /system/Test/Mock/MockCodeIgniter.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Test\Mock; 15 | 16 | use CodeIgniter\CodeIgniter; 17 | 18 | class MockCodeIgniter extends CodeIgniter 19 | { 20 | protected ?string $context = 'web'; 21 | 22 | /** 23 | * @param int $code 24 | * 25 | * @deprecated 4.4.0 No longer Used. Moved to index.php. 26 | */ 27 | protected function callExit($code) 28 | { 29 | // Do not call exit() in testing. 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /system/Test/Mock/MockCommon.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | if (! function_exists('is_cli')) { 15 | /** 16 | * Is CLI? 17 | * 18 | * Test to see if a request was made from the command line. 19 | * You can set the return value for testing. 20 | * 21 | * @param bool $newReturn return value to set 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 | $returnValue = $newReturn; 30 | } 31 | 32 | return $returnValue; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /system/Test/Mock/MockEmail.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Test\Mock; 15 | 16 | use CodeIgniter\Email\Email; 17 | use CodeIgniter\Events\Events; 18 | 19 | class MockEmail extends Email 20 | { 21 | /** 22 | * Value to return from mocked send(). 23 | * 24 | * @var bool 25 | */ 26 | public $returnValue = true; 27 | 28 | public function send($autoClear = true) 29 | { 30 | if ($this->returnValue) { 31 | $this->setArchiveValues(); 32 | 33 | if ($autoClear) { 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 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Test\Mock; 15 | 16 | use CodeIgniter\Events\Events; 17 | 18 | class MockEvents extends Events 19 | { 20 | /** 21 | * @return array<string, array{0: bool, 1: list<int>, 2: list<callable(mixed): mixed>}> 22 | */ 23 | public function getListeners() 24 | { 25 | return self::$listeners; 26 | } 27 | 28 | /** 29 | * @return list<string> 30 | */ 31 | public function getEventsFile() 32 | { 33 | return self::$files; 34 | } 35 | 36 | /** 37 | * @return bool 38 | */ 39 | public function getSimulate() 40 | { 41 | return self::$simulate; 42 | } 43 | 44 | /** 45 | * @return void 46 | */ 47 | public function unInitialize() 48 | { 49 | static::$initialized = false; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /system/Test/Mock/MockFileLogger.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Test\Mock; 15 | 16 | use CodeIgniter\Log\Handlers\FileHandler; 17 | 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 | * @var string 27 | */ 28 | public $destination; 29 | 30 | /** 31 | * @param array{handles?: list<string>, path?: string, fileExtension?: string, filePermissions?: int} $config 32 | */ 33 | public function __construct(array $config) 34 | { 35 | parent::__construct($config); 36 | 37 | $this->destination = $this->path . 'log-' . date('Y-m-d') . '.' . $this->fileExtension; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /system/Test/Mock/MockIncomingRequest.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Test\Mock; 15 | 16 | use CodeIgniter\HTTP\IncomingRequest; 17 | 18 | class MockIncomingRequest extends IncomingRequest 19 | { 20 | } 21 | -------------------------------------------------------------------------------- /system/Test/Mock/MockLanguage.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Test\Mock; 15 | 16 | use CodeIgniter\Language\Language; 17 | 18 | class MockLanguage extends Language 19 | { 20 | /** 21 | * Stores the data that should be 22 | * returned by the 'requireFile()' method. 23 | * 24 | * @var mixed 25 | */ 26 | protected $data; 27 | 28 | /** 29 | * Sets the data that should be returned by the 30 | * 'requireFile()' method to allow easy overrides 31 | * during testing. 32 | * 33 | * @return $this 34 | */ 35 | public function setData(string $file, array $data, ?string $locale = null) 36 | { 37 | $this->language[$locale ?? $this->locale][$file] = $data; 38 | 39 | return $this; 40 | } 41 | 42 | /** 43 | * Provides an override that allows us to set custom 44 | * data to be returned easily during testing. 45 | */ 46 | protected function requireFile(string $path): array 47 | { 48 | return $this->data ?? []; 49 | } 50 | 51 | /** 52 | * Arbitrarily turnoff internationalization support for testing 53 | * 54 | * @return void 55 | */ 56 | public function disableIntlSupport() 57 | { 58 | $this->intlSupport = false; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /system/Test/Mock/MockQuery.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Test\Mock; 15 | 16 | use CodeIgniter\Database\Query; 17 | 18 | class MockQuery extends Query 19 | { 20 | } 21 | -------------------------------------------------------------------------------- /system/Test/Mock/MockResourceController.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Test\Mock; 15 | 16 | use CodeIgniter\RESTful\ResourceController; 17 | 18 | class MockResourceController extends ResourceController 19 | { 20 | /** 21 | * @return object|null 22 | */ 23 | public function getModel() 24 | { 25 | return $this->model; 26 | } 27 | 28 | /** 29 | * @return class-string|null 30 | */ 31 | public function getModelName() 32 | { 33 | return $this->modelName; 34 | } 35 | 36 | /** 37 | * @return 'json'|'xml'|null 38 | */ 39 | public function getFormat() 40 | { 41 | return $this->format; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /system/Test/Mock/MockResourcePresenter.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Test\Mock; 15 | 16 | use CodeIgniter\API\ResponseTrait; 17 | use CodeIgniter\RESTful\ResourcePresenter; 18 | 19 | class MockResourcePresenter extends ResourcePresenter 20 | { 21 | use ResponseTrait; 22 | 23 | /** 24 | * @return object|null 25 | */ 26 | public function getModel() 27 | { 28 | return $this->model; 29 | } 30 | 31 | /** 32 | * @return class-string|null 33 | */ 34 | public function getModelName() 35 | { 36 | return $this->modelName; 37 | } 38 | 39 | /** 40 | * @return 'json'|'xml'|null 41 | */ 42 | public function getFormat() 43 | { 44 | return $this->format; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /system/Test/Mock/MockResponse.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Test\Mock; 15 | 16 | use CodeIgniter\HTTP\Response; 17 | 18 | class MockResponse extends Response 19 | { 20 | /** 21 | * If true, will not write output. Useful during testing. 22 | * 23 | * @var bool 24 | */ 25 | protected $pretend = true; 26 | 27 | /** 28 | * For testing. 29 | * 30 | * @return bool 31 | */ 32 | public function getPretend() 33 | { 34 | return $this->pretend; 35 | } 36 | 37 | /** 38 | * Artificial error for testing 39 | * 40 | * @return void 41 | */ 42 | public function misbehave() 43 | { 44 | $this->statusCode = 0; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /system/Test/Mock/MockSecurity.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Test\Mock; 15 | 16 | use CodeIgniter\Security\Security; 17 | 18 | class MockSecurity extends Security 19 | { 20 | protected function doSendCookie(): void 21 | { 22 | $_COOKIE['csrf_cookie_name'] = $this->hash; 23 | } 24 | 25 | protected function randomize(string $hash): string 26 | { 27 | $keyBinary = hex2bin('005513c290126d34d41bf41c5265e0f1'); 28 | $hashBinary = hex2bin($hash); 29 | 30 | return bin2hex(($hashBinary ^ $keyBinary) . $keyBinary); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /system/Test/Mock/MockServices.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Test\Mock; 15 | 16 | use CodeIgniter\Autoloader\FileLocator; 17 | use CodeIgniter\Config\BaseService; 18 | 19 | class MockServices extends BaseService 20 | { 21 | /** 22 | * @var array<non-empty-string, non-empty-string> 23 | */ 24 | public $psr4 = [ 25 | 'Tests/Support' => TESTPATH . '_support/', 26 | ]; 27 | 28 | /** 29 | * @var array<class-string, string> 30 | */ 31 | public $classmap = []; 32 | 33 | public function __construct() 34 | { 35 | // Don't call the parent since we don't want the default mappings. 36 | // parent::__construct(); 37 | } 38 | 39 | public static function locator(bool $getShared = true) 40 | { 41 | return new FileLocator(static::autoloader()); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /system/Test/Mock/MockTable.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Test\Mock; 15 | 16 | use CodeIgniter\Exceptions\BadMethodCallException; 17 | use CodeIgniter\View\Table; 18 | 19 | class MockTable extends Table 20 | { 21 | /** 22 | * Override inaccessible protected method 23 | * 24 | * @param string $method 25 | * @param list<mixed> $params 26 | * 27 | * @return mixed 28 | */ 29 | public function __call($method, $params) 30 | { 31 | if (is_callable([$this, '_' . $method])) { 32 | return call_user_func_array([$this, '_' . $method], $params); 33 | } 34 | 35 | throw new BadMethodCallException('Method ' . $method . ' was not found'); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /system/Test/StreamFilterTrait.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Test; 15 | 16 | use CodeIgniter\Test\Filters\CITestStreamFilter; 17 | 18 | trait StreamFilterTrait 19 | { 20 | protected function setUpStreamFilterTrait(): void 21 | { 22 | CITestStreamFilter::registration(); 23 | CITestStreamFilter::addOutputFilter(); 24 | CITestStreamFilter::addErrorFilter(); 25 | } 26 | 27 | protected function tearDownStreamFilterTrait(): void 28 | { 29 | CITestStreamFilter::removeOutputFilter(); 30 | CITestStreamFilter::removeErrorFilter(); 31 | } 32 | 33 | protected function getStreamFilterBuffer(): string 34 | { 35 | return CITestStreamFilter::$buffer; 36 | } 37 | 38 | protected function resetStreamFilterBuffer(): void 39 | { 40 | CITestStreamFilter::$buffer = ''; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /system/ThirdParty/Escaper/Exception/ExceptionInterface.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | namespace Laminas\Escaper\Exception; 6 | 7 | use Throwable; 8 | 9 | interface ExceptionInterface extends Throwable 10 | { 11 | } 12 | -------------------------------------------------------------------------------- /system/ThirdParty/Escaper/Exception/InvalidArgumentException.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | namespace Laminas\Escaper\Exception; 6 | 7 | /** 8 | * Invalid argument exception 9 | */ 10 | class InvalidArgumentException extends \InvalidArgumentException implements 11 | ExceptionInterface 12 | { 13 | } 14 | -------------------------------------------------------------------------------- /system/ThirdParty/Escaper/Exception/RuntimeException.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | namespace Laminas\Escaper\Exception; 6 | 7 | /** 8 | * Invalid argument exception 9 | */ 10 | class RuntimeException extends \RuntimeException implements 11 | ExceptionInterface 12 | { 13 | } 14 | -------------------------------------------------------------------------------- /system/ThirdParty/Escaper/LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2020 Laminas Project a Series of LF Projects, LLC. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are met: 5 | 6 | - Redistributions of source code must retain the above copyright notice, this 7 | list of conditions and the following disclaimer. 8 | 9 | - Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | 13 | - Neither the name of Laminas Foundation nor the names of its contributors may 14 | be used to endorse or promote products derived from this software without 15 | specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 21 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 24 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /system/ThirdParty/Kint/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Jonathan Vollebregt (jnvsor@gmail.com), Rokas Šleinius (raveren@gmail.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | 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, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /system/ThirdParty/Kint/Parser/ConstructablePluginInterface.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /* 6 | * The MIT License (MIT) 7 | * 8 | * Copyright (c) 2013 Jonathan Vollebregt (jnvsor@gmail.com), Rokas Šleinius (raveren@gmail.com) 9 | * 10 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 11 | * this software and associated documentation files (the "Software"), to deal in 12 | * the Software without restriction, including without limitation the rights to 13 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 14 | * the Software, and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be included in all 18 | * copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 22 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 23 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 24 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | */ 27 | 28 | namespace Kint\Parser; 29 | 30 | interface ConstructablePluginInterface extends PluginInterface 31 | { 32 | public function __construct(Parser $p); 33 | } 34 | -------------------------------------------------------------------------------- /system/ThirdParty/Kint/Parser/PluginBeginInterface.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /* 6 | * The MIT License (MIT) 7 | * 8 | * Copyright (c) 2013 Jonathan Vollebregt (jnvsor@gmail.com), Rokas Šleinius (raveren@gmail.com) 9 | * 10 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 11 | * this software and associated documentation files (the "Software"), to deal in 12 | * the Software without restriction, including without limitation the rights to 13 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 14 | * the Software, and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be included in all 18 | * copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 22 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 23 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 24 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | */ 27 | 28 | namespace Kint\Parser; 29 | 30 | use Kint\Value\AbstractValue; 31 | use Kint\Value\Context\ContextInterface; 32 | 33 | interface PluginBeginInterface extends PluginInterface 34 | { 35 | /** 36 | * @psalm-param mixed &$var 37 | */ 38 | public function parseBegin(&$var, ContextInterface $c): ?AbstractValue; 39 | } 40 | -------------------------------------------------------------------------------- /system/ThirdParty/Kint/Renderer/ConstructableRendererInterface.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /* 6 | * The MIT License (MIT) 7 | * 8 | * Copyright (c) 2013 Jonathan Vollebregt (jnvsor@gmail.com), Rokas Šleinius (raveren@gmail.com) 9 | * 10 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 11 | * this software and associated documentation files (the "Software"), to deal in 12 | * the Software without restriction, including without limitation the rights to 13 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 14 | * the Software, and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be included in all 18 | * copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 22 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 23 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 24 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | */ 27 | 28 | namespace Kint\Renderer; 29 | 30 | interface ConstructableRendererInterface extends RendererInterface 31 | { 32 | public function __construct(); 33 | } 34 | -------------------------------------------------------------------------------- /system/ThirdParty/Kint/Renderer/Rich/PluginInterface.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /* 6 | * The MIT License (MIT) 7 | * 8 | * Copyright (c) 2013 Jonathan Vollebregt (jnvsor@gmail.com), Rokas Šleinius (raveren@gmail.com) 9 | * 10 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 11 | * this software and associated documentation files (the "Software"), to deal in 12 | * the Software without restriction, including without limitation the rights to 13 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 14 | * the Software, and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be included in all 18 | * copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 22 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 23 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 24 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | */ 27 | 28 | namespace Kint\Renderer\Rich; 29 | 30 | use Kint\Renderer\RichRenderer; 31 | 32 | interface PluginInterface 33 | { 34 | public function __construct(RichRenderer $r); 35 | } 36 | -------------------------------------------------------------------------------- /system/ThirdParty/Kint/Renderer/Rich/TabPluginInterface.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /* 6 | * The MIT License (MIT) 7 | * 8 | * Copyright (c) 2013 Jonathan Vollebregt (jnvsor@gmail.com), Rokas Šleinius (raveren@gmail.com) 9 | * 10 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 11 | * this software and associated documentation files (the "Software"), to deal in 12 | * the Software without restriction, including without limitation the rights to 13 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 14 | * the Software, and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be included in all 18 | * copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 22 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 23 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 24 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | */ 27 | 28 | namespace Kint\Renderer\Rich; 29 | 30 | use Kint\Value\AbstractValue; 31 | use Kint\Value\Representation\RepresentationInterface; 32 | 33 | interface TabPluginInterface extends PluginInterface 34 | { 35 | public function renderTab(RepresentationInterface $r, AbstractValue $v): ?string; 36 | } 37 | -------------------------------------------------------------------------------- /system/ThirdParty/Kint/Renderer/Rich/ValuePluginInterface.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /* 6 | * The MIT License (MIT) 7 | * 8 | * Copyright (c) 2013 Jonathan Vollebregt (jnvsor@gmail.com), Rokas Šleinius (raveren@gmail.com) 9 | * 10 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 11 | * this software and associated documentation files (the "Software"), to deal in 12 | * the Software without restriction, including without limitation the rights to 13 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 14 | * the Software, and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be included in all 18 | * copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 22 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 23 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 24 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | */ 27 | 28 | namespace Kint\Renderer\Rich; 29 | 30 | use Kint\Value\AbstractValue; 31 | 32 | interface ValuePluginInterface extends PluginInterface 33 | { 34 | public function renderValue(AbstractValue $v): ?string; 35 | } 36 | -------------------------------------------------------------------------------- /system/ThirdParty/Kint/Renderer/Text/PluginInterface.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /* 6 | * The MIT License (MIT) 7 | * 8 | * Copyright (c) 2013 Jonathan Vollebregt (jnvsor@gmail.com), Rokas Šleinius (raveren@gmail.com) 9 | * 10 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 11 | * this software and associated documentation files (the "Software"), to deal in 12 | * the Software without restriction, including without limitation the rights to 13 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 14 | * the Software, and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be included in all 18 | * copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 22 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 23 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 24 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | */ 27 | 28 | namespace Kint\Renderer\Text; 29 | 30 | use Kint\Renderer\TextRenderer; 31 | use Kint\Value\AbstractValue; 32 | 33 | interface PluginInterface 34 | { 35 | public function __construct(TextRenderer $r); 36 | 37 | public function render(AbstractValue $v): ?string; 38 | } 39 | -------------------------------------------------------------------------------- /system/ThirdParty/Kint/Value/ColorValue.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /* 6 | * The MIT License (MIT) 7 | * 8 | * Copyright (c) 2013 Jonathan Vollebregt (jnvsor@gmail.com), Rokas Šleinius (raveren@gmail.com) 9 | * 10 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 11 | * this software and associated documentation files (the "Software"), to deal in 12 | * the Software without restriction, including without limitation the rights to 13 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 14 | * the Software, and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be included in all 18 | * copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 22 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 23 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 24 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | */ 27 | 28 | namespace Kint\Value; 29 | 30 | class ColorValue extends StringValue 31 | { 32 | public function getHint(): string 33 | { 34 | return parent::getHint() ?? 'color'; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /system/ThirdParty/Kint/Value/Context/ArrayContext.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /* 6 | * The MIT License (MIT) 7 | * 8 | * Copyright (c) 2013 Jonathan Vollebregt (jnvsor@gmail.com), Rokas Šleinius (raveren@gmail.com) 9 | * 10 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 11 | * this software and associated documentation files (the "Software"), to deal in 12 | * the Software without restriction, including without limitation the rights to 13 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 14 | * the Software, and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be included in all 18 | * copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 22 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 23 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 24 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | */ 27 | 28 | namespace Kint\Value\Context; 29 | 30 | class ArrayContext extends BaseContext 31 | { 32 | public function getOperator(): ?string 33 | { 34 | return '=>'; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /system/ThirdParty/Kint/Value/Representation/RepresentationInterface.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /* 6 | * The MIT License (MIT) 7 | * 8 | * Copyright (c) 2013 Jonathan Vollebregt (jnvsor@gmail.com), Rokas Šleinius (raveren@gmail.com) 9 | * 10 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 11 | * this software and associated documentation files (the "Software"), to deal in 12 | * the Software without restriction, including without limitation the rights to 13 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 14 | * the Software, and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be included in all 18 | * copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 22 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 23 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 24 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | */ 27 | 28 | namespace Kint\Value\Representation; 29 | 30 | interface RepresentationInterface 31 | { 32 | public function getLabel(): string; 33 | 34 | public function getName(): string; 35 | 36 | public function getHint(): ?string; 37 | 38 | public function labelIsImplicit(): bool; 39 | } 40 | -------------------------------------------------------------------------------- /system/ThirdParty/Kint/Value/UninitializedValue.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /* 6 | * The MIT License (MIT) 7 | * 8 | * Copyright (c) 2013 Jonathan Vollebregt (jnvsor@gmail.com), Rokas Šleinius (raveren@gmail.com) 9 | * 10 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 11 | * this software and associated documentation files (the "Software"), to deal in 12 | * the Software without restriction, including without limitation the rights to 13 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 14 | * the Software, and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be included in all 18 | * copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 22 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 23 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 24 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | */ 27 | 28 | namespace Kint\Value; 29 | 30 | use Kint\Value\Context\ContextInterface; 31 | 32 | class UninitializedValue extends AbstractValue 33 | { 34 | public function __construct(ContextInterface $context) 35 | { 36 | parent::__construct($context, 'uninitialized'); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /system/ThirdParty/Kint/Value/UnknownValue.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /* 6 | * The MIT License (MIT) 7 | * 8 | * Copyright (c) 2013 Jonathan Vollebregt (jnvsor@gmail.com), Rokas Šleinius (raveren@gmail.com) 9 | * 10 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 11 | * this software and associated documentation files (the "Software"), to deal in 12 | * the Software without restriction, including without limitation the rights to 13 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 14 | * the Software, and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be included in all 18 | * copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 22 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 23 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 24 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | */ 27 | 28 | namespace Kint\Value; 29 | 30 | use Kint\Value\Context\ContextInterface; 31 | 32 | class UnknownValue extends AbstractValue 33 | { 34 | public function __construct(ContextInterface $context) 35 | { 36 | parent::__construct($context, 'unknown'); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /system/ThirdParty/Kint/Value/VirtualValue.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /* 6 | * The MIT License (MIT) 7 | * 8 | * Copyright (c) 2013 Jonathan Vollebregt (jnvsor@gmail.com), Rokas Šleinius (raveren@gmail.com) 9 | * 10 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 11 | * this software and associated documentation files (the "Software"), to deal in 12 | * the Software without restriction, including without limitation the rights to 13 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 14 | * the Software, and to permit persons to whom the Software is furnished to do so, 15 | * subject to the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be included in all 18 | * copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 22 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 23 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 24 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | */ 27 | 28 | namespace Kint\Value; 29 | 30 | use Kint\Value\Context\ContextInterface; 31 | 32 | class VirtualValue extends AbstractValue 33 | { 34 | public function __construct(ContextInterface $context) 35 | { 36 | parent::__construct($context, 'virtual'); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /system/ThirdParty/Kint/resources/compiled/plain.css: -------------------------------------------------------------------------------- 1 | .kint-plain{background:rgba(255,255,255,.9);white-space:pre;display:block;font-family:monospace;color:#222;line-height:normal}.kint-plain i{color:#d00;font-style:normal}.kint-plain u{color:#030;text-decoration:none;font-weight:bold}.kint-plain .kint-microtime-js .kint-microtime-lap{text-shadow:1px 0 #d00,0 1px #d00,-1px 0 #d00,0 -1px #d00;color:#fff;font-weight:bold} 2 | -------------------------------------------------------------------------------- /system/ThirdParty/PSR/Log/AbstractLogger.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | namespace Psr\Log; 4 | 5 | /** 6 | * This is a simple Logger implementation that other Loggers can inherit from. 7 | * 8 | * It simply delegates all log-level-specific methods to the `log` method to 9 | * reduce boilerplate code that a simple Logger that does the same thing with 10 | * messages regardless of the error level has to implement. 11 | */ 12 | abstract class AbstractLogger implements LoggerInterface 13 | { 14 | use LoggerTrait; 15 | } 16 | -------------------------------------------------------------------------------- /system/ThirdParty/PSR/Log/InvalidArgumentException.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | namespace Psr\Log; 4 | 5 | class InvalidArgumentException extends \InvalidArgumentException 6 | { 7 | } 8 | -------------------------------------------------------------------------------- /system/ThirdParty/PSR/Log/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 PHP Framework Interoperability Group 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /system/ThirdParty/PSR/Log/LogLevel.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | namespace Psr\Log; 4 | 5 | /** 6 | * Describes log levels. 7 | */ 8 | class LogLevel 9 | { 10 | const EMERGENCY = 'emergency'; 11 | const ALERT = 'alert'; 12 | const CRITICAL = 'critical'; 13 | const ERROR = 'error'; 14 | const WARNING = 'warning'; 15 | const NOTICE = 'notice'; 16 | const INFO = 'info'; 17 | const DEBUG = 'debug'; 18 | } 19 | -------------------------------------------------------------------------------- /system/ThirdParty/PSR/Log/LoggerAwareInterface.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | namespace Psr\Log; 4 | 5 | /** 6 | * Describes a logger-aware instance. 7 | */ 8 | interface LoggerAwareInterface 9 | { 10 | /** 11 | * Sets a logger instance on the object. 12 | */ 13 | public function setLogger(LoggerInterface $logger): void; 14 | } 15 | -------------------------------------------------------------------------------- /system/ThirdParty/PSR/Log/LoggerAwareTrait.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | namespace Psr\Log; 4 | 5 | /** 6 | * Basic Implementation of LoggerAwareInterface. 7 | */ 8 | trait LoggerAwareTrait 9 | { 10 | /** 11 | * The logger instance. 12 | */ 13 | protected ?LoggerInterface $logger = null; 14 | 15 | /** 16 | * Sets a logger. 17 | */ 18 | public function setLogger(LoggerInterface $logger): void 19 | { 20 | $this->logger = $logger; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /system/ThirdParty/PSR/Log/NullLogger.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | namespace Psr\Log; 4 | 5 | /** 6 | * This Logger can be used to avoid conditional log calls. 7 | * 8 | * Logging should always be optional, and if no logger is provided to your 9 | * library creating a NullLogger instance to have something to throw logs at 10 | * is a good way to avoid littering your code with `if ($this->logger) { }` 11 | * blocks. 12 | */ 13 | class NullLogger extends AbstractLogger 14 | { 15 | /** 16 | * Logs with an arbitrary level. 17 | * 18 | * @param mixed[] $context 19 | * 20 | * @throws \Psr\Log\InvalidArgumentException 21 | */ 22 | public function log($level, string|\Stringable $message, array $context = []): void 23 | { 24 | // noop 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /system/Throttle/ThrottlerInterface.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Throttle; 15 | 16 | /** 17 | * Expected behavior of a Throttler 18 | */ 19 | interface ThrottlerInterface 20 | { 21 | /** 22 | * Restricts the number of requests made by a single key within 23 | * a set number of seconds. 24 | * 25 | * Example: 26 | * 27 | * if (! $throttler->checkIPAddress($request->ipAddress(), 60, MINUTE)) 28 | * { 29 | * die('You submitted over 60 requests within a minute.'); 30 | * } 31 | * 32 | * @param string $key The name to use as the "bucket" name. 33 | * @param int $capacity The number of requests the "bucket" can hold 34 | * @param int $seconds The time it takes the "bucket" to completely refill 35 | * @param int $cost The number of tokens this action uses. 36 | * 37 | * @return bool 38 | */ 39 | public function check(string $key, int $capacity, int $seconds, int $cost); 40 | 41 | /** 42 | * Returns the number of seconds until the next available token will 43 | * be released for usage. 44 | */ 45 | public function getTokenTime(): int; 46 | } 47 | -------------------------------------------------------------------------------- /system/Validation/FileRules.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\Validation; 15 | 16 | use CodeIgniter\Validation\StrictRules\FileRules as StrictFileRules; 17 | 18 | /** 19 | * File validation rules 20 | * 21 | * @see \CodeIgniter\Validation\FileRulesTest 22 | */ 23 | class FileRules extends StrictFileRules 24 | { 25 | } 26 | -------------------------------------------------------------------------------- /system/Validation/Views/list.php: -------------------------------------------------------------------------------- 1 | <?php if (isset($errors) && $errors !== []) : ?> 2 | <div class="errors" role="alert"> 3 | <ul> 4 | <?php foreach ($errors as $error) : ?> 5 | <li><?= esc($error) ?></li> 6 | <?php endforeach ?> 7 | </ul> 8 | </div> 9 | <?php endif ?> 10 | -------------------------------------------------------------------------------- /system/Validation/Views/single.php: -------------------------------------------------------------------------------- 1 | <span class="help-block"><?= esc($error) ?></span> 2 | -------------------------------------------------------------------------------- /system/View/ViewDecoratorInterface.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\View; 15 | 16 | /** 17 | * View Decorators are simple classes that are given the 18 | * chance to modify the output from the view() calls 19 | * prior to it being cached. 20 | */ 21 | interface ViewDecoratorInterface 22 | { 23 | /** 24 | * Takes $html and has a chance to alter it. 25 | * MUST return the modified HTML. 26 | */ 27 | public static function decorate(string $html): string; 28 | } 29 | -------------------------------------------------------------------------------- /system/View/ViewDecoratorTrait.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | namespace CodeIgniter\View; 15 | 16 | use CodeIgniter\View\Exceptions\ViewException; 17 | use Config\View as ViewConfig; 18 | 19 | trait ViewDecoratorTrait 20 | { 21 | /** 22 | * Runs the generated output through any declared 23 | * view decorators. 24 | */ 25 | protected function decorateOutput(string $html): string 26 | { 27 | $decorators = $this->config->decorators ?? config(ViewConfig::class)->decorators; 28 | 29 | foreach ($decorators as $decorator) { 30 | if (! is_subclass_of($decorator, ViewDecoratorInterface::class)) { 31 | throw ViewException::forInvalidDecorator($decorator); 32 | } 33 | 34 | $html = $decorator::decorate($html); 35 | } 36 | 37 | return $html; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /system/index.html: -------------------------------------------------------------------------------- 1 | <!DOCTYPE html> 2 | <html> 3 | <head> 4 | <title>403 Forbidden</title> 5 | </head> 6 | <body> 7 | 8 | <p>Directory access is forbidden.</p> 9 | 10 | </body> 11 | </html> 12 | -------------------------------------------------------------------------------- /system/rewrite.php: -------------------------------------------------------------------------------- 1 | <?php 2 | 3 | declare(strict_types=1); 4 | 5 | /** 6 | * This file is part of CodeIgniter 4 framework. 7 | * 8 | * (c) CodeIgniter Foundation <admin@codeigniter.com> 9 | * 10 | * For the full copyright and license information, please view 11 | * the LICENSE file that was distributed with this source code. 12 | */ 13 | 14 | /* 15 | * CodeIgniter PHP-Development Server Rewrite Rules 16 | * 17 | * This script works with the CLI serve command to help run a seamless 18 | * development server based around PHP's built-in development 19 | * server. This file simply tries to mimic Apache's mod_rewrite 20 | * functionality so the site will operate as normal. 21 | */ 22 | 23 | // @codeCoverageIgnoreStart 24 | $uri = urldecode( 25 | parse_url('https://codeigniter.com' . $_SERVER['REQUEST_URI'], PHP_URL_PATH) ?? '', 26 | ); 27 | 28 | // All request handle by index.php file. 29 | $_SERVER['SCRIPT_NAME'] = '/index.php'; 30 | 31 | // Full path 32 | $path = $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . ltrim($uri, '/'); 33 | 34 | // If $path is an existing file or folder within the public folder 35 | // then let the request handle it like normal. 36 | if ($uri !== '/' && (is_file($path) || is_dir($path))) { 37 | return false; 38 | } 39 | 40 | unset($uri, $path); 41 | 42 | // Otherwise, we'll load the index file and let 43 | // the framework handle the request from here. 44 | require_once $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'index.php'; 45 | // @codeCoverageIgnoreEnd 46 | -------------------------------------------------------------------------------- /writable/.htaccess: -------------------------------------------------------------------------------- 1 | <IfModule authz_core_module> 2 | Require all denied 3 | </IfModule> 4 | <IfModule !authz_core_module> 5 | Deny from all 6 | </IfModule> 7 | -------------------------------------------------------------------------------- /writable/cache/index.html: -------------------------------------------------------------------------------- 1 | <!DOCTYPE html> 2 | <html> 3 | <head> 4 | <title>403 Forbidden</title> 5 | </head> 6 | <body> 7 | 8 | <p>Directory access is forbidden.</p> 9 | 10 | </body> 11 | </html> 12 | -------------------------------------------------------------------------------- /writable/debugbar/index.html: -------------------------------------------------------------------------------- 1 | <!DOCTYPE html> 2 | <html> 3 | <head> 4 | <title>403 Forbidden</title> 5 | </head> 6 | <body> 7 | 8 | <p>Directory access is forbidden.</p> 9 | 10 | </body> 11 | </html> 12 | -------------------------------------------------------------------------------- /writable/index.html: -------------------------------------------------------------------------------- 1 | <!DOCTYPE html> 2 | <html> 3 | <head> 4 | <title>403 Forbidden</title> 5 | </head> 6 | <body> 7 | 8 | <p>Directory access is forbidden.</p> 9 | 10 | </body> 11 | </html> 12 | -------------------------------------------------------------------------------- /writable/logs/index.html: -------------------------------------------------------------------------------- 1 | <!DOCTYPE html> 2 | <html> 3 | <head> 4 | <title>403 Forbidden</title> 5 | </head> 6 | <body> 7 | 8 | <p>Directory access is forbidden.</p> 9 | 10 | </body> 11 | </html> 12 | -------------------------------------------------------------------------------- /writable/session/index.html: -------------------------------------------------------------------------------- 1 | <!DOCTYPE html> 2 | <html> 3 | <head> 4 | <title>403 Forbidden</title> 5 | </head> 6 | <body> 7 | 8 | <p>Directory access is forbidden.</p> 9 | 10 | </body> 11 | </html> 12 | -------------------------------------------------------------------------------- /writable/uploads/index.html: -------------------------------------------------------------------------------- 1 | <!DOCTYPE html> 2 | <html> 3 | <head> 4 | <title>403 Forbidden</title> 5 | </head> 6 | <body> 7 | 8 | <p>Directory access is forbidden.</p> 9 | 10 | </body> 11 | </html> 12 | --------------------------------------------------------------------------------