├── .github
└── workflows
│ └── dependabot.yml
├── .gitignore
├── LICENSE
├── README.md
├── app
├── .htaccess
├── Common.php
├── Config
│ ├── App.php
│ ├── Autoload.php
│ ├── Boot
│ │ ├── development.php
│ │ ├── production.php
│ │ └── testing.php
│ ├── Cache.php
│ ├── Constants.php
│ ├── ContentSecurityPolicy.php
│ ├── Database.php
│ ├── DocTypes.php
│ ├── Email.php
│ ├── Encryption.php
│ ├── Events.php
│ ├── Exceptions.php
│ ├── Filters.php
│ ├── ForeignCharacters.php
│ ├── Format.php
│ ├── Generators.php
│ ├── Honeypot.php
│ ├── Images.php
│ ├── Kint.php
│ ├── Logger.php
│ ├── Migrations.php
│ ├── Mimes.php
│ ├── Modules.php
│ ├── Pager.php
│ ├── Paths.php
│ ├── Routes.php
│ ├── Security.php
│ ├── Services.php
│ ├── Toolbar.php
│ ├── UserAgents.php
│ ├── Validation.php
│ └── View.php
├── Controllers
│ ├── Api.php
│ ├── Auth.php
│ ├── BaseController.php
│ └── Home.php
├── Database
│ ├── Migrations
│ │ ├── .gitkeep
│ │ ├── 2021-02-10-064002_User.php
│ │ └── 2021-02-10-064556_Member.php
│ └── Seeds
│ │ ├── .gitkeep
│ │ ├── Member.php
│ │ └── User.php
├── Filters
│ └── .gitkeep
├── Helpers
│ └── .gitkeep
├── Language
│ ├── .gitkeep
│ └── en
│ │ └── Validation.php
├── Libraries
│ └── .gitkeep
├── Models
│ ├── .gitkeep
│ ├── Member.php
│ └── User.php
├── ThirdParty
│ └── .gitkeep
├── Views
│ ├── errors
│ │ ├── cli
│ │ │ ├── error_404.php
│ │ │ ├── error_exception.php
│ │ │ └── production.php
│ │ └── html
│ │ │ ├── debug.css
│ │ │ ├── debug.js
│ │ │ ├── error_404.php
│ │ │ ├── error_exception.php
│ │ │ └── production.php
│ └── welcome_message.php
└── index.html
├── composer.json
├── composer.lock
├── phpunit.xml.dist
├── public
├── .htaccess
├── favicon.ico
├── index.php
├── info.php
└── robots.txt
├── spark
├── system
├── .htaccess
├── API
│ └── ResponseTrait.php
├── Autoloader
│ ├── Autoloader.php
│ └── FileLocator.php
├── BaseModel.php
├── CLI
│ ├── BaseCommand.php
│ ├── CLI.php
│ ├── CommandRunner.php
│ ├── Commands.php
│ ├── Console.php
│ ├── Exceptions
│ │ └── CLIException.php
│ └── GeneratorTrait.php
├── Cache
│ ├── CacheFactory.php
│ ├── CacheInterface.php
│ ├── Exceptions
│ │ ├── CacheException.php
│ │ └── ExceptionInterface.php
│ └── Handlers
│ │ ├── BaseHandler.php
│ │ ├── DummyHandler.php
│ │ ├── FileHandler.php
│ │ ├── MemcachedHandler.php
│ │ ├── PredisHandler.php
│ │ ├── RedisHandler.php
│ │ └── WincacheHandler.php
├── CodeIgniter.php
├── Commands
│ ├── Cache
│ │ ├── ClearCache.php
│ │ └── InfoCache.php
│ ├── Database
│ │ ├── CreateDatabase.php
│ │ ├── Migrate.php
│ │ ├── MigrateRefresh.php
│ │ ├── MigrateRollback.php
│ │ ├── MigrateStatus.php
│ │ └── Seed.php
│ ├── Encryption
│ │ └── GenerateKey.php
│ ├── Generators
│ │ ├── CommandGenerator.php
│ │ ├── ConfigGenerator.php
│ │ ├── ControllerGenerator.php
│ │ ├── EntityGenerator.php
│ │ ├── FilterGenerator.php
│ │ ├── MigrateCreate.php
│ │ ├── MigrationGenerator.php
│ │ ├── ModelGenerator.php
│ │ ├── ScaffoldGenerator.php
│ │ ├── SeederGenerator.php
│ │ ├── SessionMigrationGenerator.php
│ │ ├── ValidationGenerator.php
│ │ └── Views
│ │ │ ├── command.tpl.php
│ │ │ ├── config.tpl.php
│ │ │ ├── controller.tpl.php
│ │ │ ├── entity.tpl.php
│ │ │ ├── filter.tpl.php
│ │ │ ├── migration.tpl.php
│ │ │ ├── model.tpl.php
│ │ │ ├── seeder.tpl.php
│ │ │ └── validation.tpl.php
│ ├── Help.php
│ ├── Housekeeping
│ │ ├── ClearDebugbar.php
│ │ └── ClearLogs.php
│ ├── ListCommands.php
│ ├── Server
│ │ ├── Serve.php
│ │ └── rewrite.php
│ └── Utilities
│ │ ├── Namespaces.php
│ │ └── Routes.php
├── Common.php
├── ComposerScripts.php
├── Config
│ ├── AutoloadConfig.php
│ ├── BaseConfig.php
│ ├── BaseService.php
│ ├── Config.php
│ ├── DotEnv.php
│ ├── Factories.php
│ ├── Factory.php
│ ├── ForeignCharacters.php
│ ├── Routes.php
│ ├── Services.php
│ └── View.php
├── Controller.php
├── Database
│ ├── BaseBuilder.php
│ ├── BaseConnection.php
│ ├── BasePreparedQuery.php
│ ├── BaseResult.php
│ ├── BaseUtils.php
│ ├── Config.php
│ ├── ConnectionInterface.php
│ ├── Database.php
│ ├── Exceptions
│ │ ├── DataException.php
│ │ ├── DatabaseException.php
│ │ └── ExceptionInterface.php
│ ├── Forge.php
│ ├── Migration.php
│ ├── MigrationRunner.php
│ ├── ModelFactory.php
│ ├── MySQLi
│ │ ├── Builder.php
│ │ ├── Connection.php
│ │ ├── Forge.php
│ │ ├── PreparedQuery.php
│ │ ├── Result.php
│ │ └── Utils.php
│ ├── Postgre
│ │ ├── Builder.php
│ │ ├── Connection.php
│ │ ├── Forge.php
│ │ ├── PreparedQuery.php
│ │ ├── Result.php
│ │ └── Utils.php
│ ├── PreparedQueryInterface.php
│ ├── Query.php
│ ├── QueryInterface.php
│ ├── ResultInterface.php
│ ├── SQLSRV
│ │ ├── Builder.php
│ │ ├── Connection.php
│ │ ├── Forge.php
│ │ ├── PreparedQuery.php
│ │ ├── Result.php
│ │ └── Utils.php
│ ├── SQLite3
│ │ ├── Builder.php
│ │ ├── Connection.php
│ │ ├── Forge.php
│ │ ├── PreparedQuery.php
│ │ ├── Result.php
│ │ ├── Table.php
│ │ └── Utils.php
│ └── Seeder.php
├── Debug
│ ├── Exceptions.php
│ ├── Iterator.php
│ ├── Timer.php
│ ├── Toolbar.php
│ └── Toolbar
│ │ ├── Collectors
│ │ ├── BaseCollector.php
│ │ ├── Config.php
│ │ ├── Database.php
│ │ ├── Events.php
│ │ ├── Files.php
│ │ ├── History.php
│ │ ├── Logs.php
│ │ ├── Routes.php
│ │ ├── Timers.php
│ │ └── Views.php
│ │ └── Views
│ │ ├── _config.tpl
│ │ ├── _database.tpl
│ │ ├── _events.tpl
│ │ ├── _files.tpl
│ │ ├── _history.tpl
│ │ ├── _logs.tpl
│ │ ├── _routes.tpl
│ │ ├── toolbar.css
│ │ ├── toolbar.js
│ │ ├── toolbar.tpl.php
│ │ └── toolbarloader.js.php
├── Email
│ └── Email.php
├── Encryption
│ ├── EncrypterInterface.php
│ ├── Encryption.php
│ ├── Exceptions
│ │ └── EncryptionException.php
│ └── Handlers
│ │ ├── BaseHandler.php
│ │ ├── OpenSSLHandler.php
│ │ └── SodiumHandler.php
├── Entity.php
├── Events
│ └── Events.php
├── Exceptions
│ ├── AlertError.php
│ ├── CastException.php
│ ├── ConfigException.php
│ ├── CriticalError.php
│ ├── DebugTraceableTrait.php
│ ├── DownloadException.php
│ ├── EmergencyError.php
│ ├── ExceptionInterface.php
│ ├── FrameworkException.php
│ ├── ModelException.php
│ └── PageNotFoundException.php
├── Files
│ ├── Exceptions
│ │ ├── FileException.php
│ │ └── FileNotFoundException.php
│ └── File.php
├── Filters
│ ├── CSRF.php
│ ├── DebugToolbar.php
│ ├── Exceptions
│ │ └── FilterException.php
│ ├── FilterInterface.php
│ ├── Filters.php
│ └── Honeypot.php
├── Format
│ ├── Exceptions
│ │ └── FormatException.php
│ ├── Format.php
│ ├── FormatterInterface.php
│ ├── JSONFormatter.php
│ └── XMLFormatter.php
├── HTTP
│ ├── CLIRequest.php
│ ├── CURLRequest.php
│ ├── ContentSecurityPolicy.php
│ ├── DownloadResponse.php
│ ├── Exceptions
│ │ └── HTTPException.php
│ ├── Files
│ │ ├── FileCollection.php
│ │ ├── UploadedFile.php
│ │ └── UploadedFileInterface.php
│ ├── Header.php
│ ├── IncomingRequest.php
│ ├── Message.php
│ ├── MessageInterface.php
│ ├── MessageTrait.php
│ ├── Negotiate.php
│ ├── RedirectResponse.php
│ ├── Request.php
│ ├── RequestInterface.php
│ ├── RequestTrait.php
│ ├── Response.php
│ ├── ResponseInterface.php
│ ├── ResponseTrait.php
│ ├── URI.php
│ └── UserAgent.php
├── Helpers
│ ├── array_helper.php
│ ├── cookie_helper.php
│ ├── date_helper.php
│ ├── filesystem_helper.php
│ ├── form_helper.php
│ ├── html_helper.php
│ ├── inflector_helper.php
│ ├── number_helper.php
│ ├── security_helper.php
│ ├── test_helper.php
│ ├── text_helper.php
│ ├── url_helper.php
│ └── xml_helper.php
├── Honeypot
│ ├── Exceptions
│ │ └── HoneypotException.php
│ └── Honeypot.php
├── I18n
│ ├── Exceptions
│ │ └── I18nException.php
│ ├── Time.php
│ └── TimeDifference.php
├── Images
│ ├── Exceptions
│ │ └── ImageException.php
│ ├── Handlers
│ │ ├── BaseHandler.php
│ │ ├── GDHandler.php
│ │ └── ImageMagickHandler.php
│ ├── Image.php
│ └── ImageHandlerInterface.php
├── Language
│ ├── Language.php
│ └── en
│ │ ├── CLI.php
│ │ ├── Cache.php
│ │ ├── Cast.php
│ │ ├── Core.php
│ │ ├── Database.php
│ │ ├── Email.php
│ │ ├── Encryption.php
│ │ ├── Fabricator.php
│ │ ├── Files.php
│ │ ├── Filters.php
│ │ ├── Format.php
│ │ ├── HTTP.php
│ │ ├── Images.php
│ │ ├── Log.php
│ │ ├── Migrations.php
│ │ ├── Number.php
│ │ ├── Pager.php
│ │ ├── RESTful.php
│ │ ├── Router.php
│ │ ├── Security.php
│ │ ├── Session.php
│ │ ├── Time.php
│ │ ├── Validation.php
│ │ └── View.php
├── Log
│ ├── Exceptions
│ │ └── LogException.php
│ ├── Handlers
│ │ ├── BaseHandler.php
│ │ ├── ChromeLoggerHandler.php
│ │ ├── FileHandler.php
│ │ └── HandlerInterface.php
│ └── Logger.php
├── Model.php
├── Modules
│ └── Modules.php
├── Pager
│ ├── Exceptions
│ │ └── PagerException.php
│ ├── Pager.php
│ ├── PagerInterface.php
│ ├── PagerRenderer.php
│ └── Views
│ │ ├── default_full.php
│ │ ├── default_head.php
│ │ └── default_simple.php
├── RESTful
│ ├── BaseResource.php
│ ├── ResourceController.php
│ └── ResourcePresenter.php
├── Router
│ ├── Exceptions
│ │ ├── RedirectException.php
│ │ └── RouterException.php
│ ├── RouteCollection.php
│ ├── RouteCollectionInterface.php
│ ├── Router.php
│ └── RouterInterface.php
├── Security
│ ├── Exceptions
│ │ └── SecurityException.php
│ ├── Security.php
│ └── SecurityInterface.php
├── Session
│ ├── Exceptions
│ │ └── SessionException.php
│ ├── Handlers
│ │ ├── ArrayHandler.php
│ │ ├── BaseHandler.php
│ │ ├── DatabaseHandler.php
│ │ ├── FileHandler.php
│ │ ├── MemcachedHandler.php
│ │ └── RedisHandler.php
│ ├── Session.php
│ └── SessionInterface.php
├── Test
│ ├── CIDatabaseTestCase.php
│ ├── CIUnitTestCase.php
│ ├── ControllerResponse.php
│ ├── ControllerTester.php
│ ├── DOMParser.php
│ ├── Fabricator.php
│ ├── FeatureResponse.php
│ ├── FeatureTestCase.php
│ ├── FeatureTestTrait.php
│ ├── Filters
│ │ └── CITestStreamFilter.php
│ ├── Interfaces
│ │ └── FabricatorModel.php
│ ├── Mock
│ │ ├── MockAppConfig.php
│ │ ├── MockAutoload.php
│ │ ├── MockBuilder.php
│ │ ├── MockCLIConfig.php
│ │ ├── MockCURLRequest.php
│ │ ├── MockCache.php
│ │ ├── MockCodeIgniter.php
│ │ ├── MockCommon.php
│ │ ├── MockConnection.php
│ │ ├── MockEmail.php
│ │ ├── MockEvents.php
│ │ ├── MockFileLogger.php
│ │ ├── MockIncomingRequest.php
│ │ ├── MockLanguage.php
│ │ ├── MockLogger.php
│ │ ├── MockQuery.php
│ │ ├── MockResourceController.php
│ │ ├── MockResourcePresenter.php
│ │ ├── MockResponse.php
│ │ ├── MockResult.php
│ │ ├── MockSecurity.php
│ │ ├── MockSecurityConfig.php
│ │ ├── MockServices.php
│ │ ├── MockSession.php
│ │ └── MockTable.php
│ ├── ReflectionHelper.php
│ ├── TestLogger.php
│ └── bootstrap.php
├── ThirdParty
│ ├── Escaper
│ │ ├── Escaper.php
│ │ └── Exception
│ │ │ ├── ExceptionInterface.php
│ │ │ ├── InvalidArgumentException.php
│ │ │ └── RuntimeException.php
│ ├── Kint
│ │ ├── CallFinder.php
│ │ ├── Kint.php
│ │ ├── Object
│ │ │ ├── BasicObject.php
│ │ │ ├── BlobObject.php
│ │ │ ├── ClosureObject.php
│ │ │ ├── DateTimeObject.php
│ │ │ ├── InstanceObject.php
│ │ │ ├── MethodObject.php
│ │ │ ├── ParameterObject.php
│ │ │ ├── Representation
│ │ │ │ ├── ColorRepresentation.php
│ │ │ │ ├── DocstringRepresentation.php
│ │ │ │ ├── MicrotimeRepresentation.php
│ │ │ │ ├── Representation.php
│ │ │ │ ├── SourceRepresentation.php
│ │ │ │ └── SplFileInfoRepresentation.php
│ │ │ ├── ResourceObject.php
│ │ │ ├── StreamObject.php
│ │ │ ├── ThrowableObject.php
│ │ │ ├── TraceFrameObject.php
│ │ │ └── TraceObject.php
│ │ ├── Parser
│ │ │ ├── ArrayObjectPlugin.php
│ │ │ ├── Base64Plugin.php
│ │ │ ├── BinaryPlugin.php
│ │ │ ├── BlacklistPlugin.php
│ │ │ ├── ClassMethodsPlugin.php
│ │ │ ├── ClassStaticsPlugin.php
│ │ │ ├── ClosurePlugin.php
│ │ │ ├── ColorPlugin.php
│ │ │ ├── DOMDocumentPlugin.php
│ │ │ ├── DateTimePlugin.php
│ │ │ ├── FsPathPlugin.php
│ │ │ ├── IteratorPlugin.php
│ │ │ ├── JsonPlugin.php
│ │ │ ├── MicrotimePlugin.php
│ │ │ ├── MysqliPlugin.php
│ │ │ ├── Parser.php
│ │ │ ├── Plugin.php
│ │ │ ├── ProxyPlugin.php
│ │ │ ├── SerializePlugin.php
│ │ │ ├── SimpleXMLElementPlugin.php
│ │ │ ├── SplFileInfoPlugin.php
│ │ │ ├── SplObjectStoragePlugin.php
│ │ │ ├── StreamPlugin.php
│ │ │ ├── TablePlugin.php
│ │ │ ├── ThrowablePlugin.php
│ │ │ ├── TimestampPlugin.php
│ │ │ ├── ToStringPlugin.php
│ │ │ ├── TracePlugin.php
│ │ │ └── XmlPlugin.php
│ │ ├── Renderer
│ │ │ ├── CliRenderer.php
│ │ │ ├── PlainRenderer.php
│ │ │ ├── Renderer.php
│ │ │ ├── Rich
│ │ │ │ ├── BinaryPlugin.php
│ │ │ │ ├── BlacklistPlugin.php
│ │ │ │ ├── CallablePlugin.php
│ │ │ │ ├── ClosurePlugin.php
│ │ │ │ ├── ColorPlugin.php
│ │ │ │ ├── DepthLimitPlugin.php
│ │ │ │ ├── DocstringPlugin.php
│ │ │ │ ├── MicrotimePlugin.php
│ │ │ │ ├── ObjectPluginInterface.php
│ │ │ │ ├── Plugin.php
│ │ │ │ ├── PluginInterface.php
│ │ │ │ ├── RecursionPlugin.php
│ │ │ │ ├── SimpleXMLElementPlugin.php
│ │ │ │ ├── SourcePlugin.php
│ │ │ │ ├── TabPluginInterface.php
│ │ │ │ ├── TablePlugin.php
│ │ │ │ ├── TimestampPlugin.php
│ │ │ │ └── TraceFramePlugin.php
│ │ │ ├── RichRenderer.php
│ │ │ ├── Text
│ │ │ │ ├── BlacklistPlugin.php
│ │ │ │ ├── DepthLimitPlugin.php
│ │ │ │ ├── MicrotimePlugin.php
│ │ │ │ ├── Plugin.php
│ │ │ │ ├── RecursionPlugin.php
│ │ │ │ └── TracePlugin.php
│ │ │ └── TextRenderer.php
│ │ ├── Utils.php
│ │ ├── init.php
│ │ ├── init_helpers.php
│ │ └── resources
│ │ │ └── compiled
│ │ │ ├── aante-light.css
│ │ │ ├── microtime.js
│ │ │ ├── original.css
│ │ │ ├── plain.css
│ │ │ ├── plain.js
│ │ │ ├── rich.js
│ │ │ ├── shared.js
│ │ │ ├── solarized-dark.css
│ │ │ └── solarized.css
│ └── PSR
│ │ └── Log
│ │ ├── AbstractLogger.php
│ │ ├── InvalidArgumentException.php
│ │ ├── LogLevel.php
│ │ ├── LoggerAwareInterface.php
│ │ ├── LoggerAwareTrait.php
│ │ ├── LoggerInterface.php
│ │ ├── LoggerTrait.php
│ │ └── NullLogger.php
├── Throttle
│ ├── Throttler.php
│ └── ThrottlerInterface.php
├── Typography
│ └── Typography.php
├── Validation
│ ├── CreditCardRules.php
│ ├── Exceptions
│ │ └── ValidationException.php
│ ├── FileRules.php
│ ├── FormatRules.php
│ ├── Rules.php
│ ├── Validation.php
│ ├── ValidationInterface.php
│ └── Views
│ │ ├── list.php
│ │ └── single.php
├── View
│ ├── Cell.php
│ ├── Exceptions
│ │ └── ViewException.php
│ ├── Filters.php
│ ├── Parser.php
│ ├── Plugins.php
│ ├── RendererInterface.php
│ ├── Table.php
│ └── View.php
├── bootstrap.php
└── index.html
└── writable
├── .htaccess
├── cache
└── index.html
├── logs
└── index.html
├── session
└── index.html
└── uploads
└── index.html
/.github/workflows/dependabot.yml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asnur/RestFul-API/58f0ad6ab6dca0a53a538299ca195b42b5a3e5cf/.github/workflows/dependabot.yml
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # IDE Files
2 | #-------------------------
3 | /nbproject/
4 | .idea/*
5 |
6 | ## Sublime Text cache files
7 | *.tmlanguage.cache
8 | *.tmPreferences.cache
9 | *.stTheme.cache
10 | *.sublime-workspace
11 | *.sublime-project
12 |
13 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014-2019 British Columbia Institute of Technology
4 | Copyright (c) 2019-2021 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 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # RESTful API CodeIgniter 4
2 |
3 | # Instalasi
4 | 1. Rename File env menjadi .env lalu ubah Environment Dari Production ke Development
5 | 2. Buat Table Database Melalui Migration dengan mengetikan perintah
6 | ```bash
7 | php spark migrate
8 | ```
9 | 3. Selanjut Seed data member & user ke database dengan mengetikan perintah
10 | ```bash
11 | php spark db:seed user member
12 | ```
13 | 4. Maka data siap untuk di testing
14 |
15 | # Plugin Yang Tersedia
16 | 1. [faker](https://github.com/fzaninotto/Faker)
17 | 2. [JWT-Json_web_token](https://github.com/firebase/php-jwt)
18 |
19 | ## Persyaratan Server
20 |
21 | PHP versi 7.3 atau lebih tinggi diperlukan, dengan ekstensi berikut diinstal:
22 |
23 | - [intl](http://php.net/manual/en/intl.requirements.php)
24 | - [libcurl](http://php.net/manual/en/curl.requirements.php) jika Anda berencana untuk menggunakan perpustakaan HTTP \ CURLRequest
25 |
26 | Selain itu, pastikan ekstensi berikut diaktifkan di PHP Anda:
27 |
28 | - json (diaktifkan secara default - jangan matikan)
29 | - [mbstring](http://php.net/manual/en/mbstring.installation.php)
30 | - [mysqlnd](http://php.net/manual/en/mysqlnd.install.php)
31 | - xml (diaktifkan secara default - jangan matikan)
32 |
--------------------------------------------------------------------------------
/app/.htaccess:
--------------------------------------------------------------------------------
1 |
2 | Require all denied
3 |
4 |
5 | Deny from all
6 |
7 |
--------------------------------------------------------------------------------
/app/Common.php:
--------------------------------------------------------------------------------
1 | 0)
34 | {
35 | ob_end_flush();
36 | }
37 |
38 | ob_start(function ($buffer) {
39 | return $buffer;
40 | });
41 | }
42 |
43 | /*
44 | * --------------------------------------------------------------------
45 | * Debug Toolbar Listeners.
46 | * --------------------------------------------------------------------
47 | * If you delete, they will no longer be collected.
48 | */
49 | if (CI_DEBUG)
50 | {
51 | Events::on('DBQuery', 'CodeIgniter\Debug\Toolbar\Collectors\Database::collect');
52 | Services::toolbar()->respond();
53 | }
54 | });
55 |
--------------------------------------------------------------------------------
/app/Config/Exceptions.php:
--------------------------------------------------------------------------------
1 | CSRF::class,
20 | 'toolbar' => DebugToolbar::class,
21 | 'honeypot' => Honeypot::class,
22 | ];
23 |
24 | /**
25 | * List of filter aliases that are always
26 | * applied before and after every request.
27 | *
28 | * @var array
29 | */
30 | public $globals = [
31 | 'before' => [
32 | // 'honeypot',
33 | // 'csrf',
34 | ],
35 | 'after' => [
36 | 'toolbar',
37 | // 'honeypot',
38 | ],
39 | ];
40 |
41 | /**
42 | * List of filter aliases that works on a
43 | * particular HTTP method (GET, POST, etc.).
44 | *
45 | * Example:
46 | * 'post' => ['csrf', 'throttle']
47 | *
48 | * @var array
49 | */
50 | public $methods = [];
51 |
52 | /**
53 | * List of filter aliases that should run on any
54 | * before or after URI patterns.
55 | *
56 | * Example:
57 | * 'isLoggedIn' => ['before' => ['account/*', 'profiles/*']]
58 | *
59 | * @var array
60 | */
61 | public $filters = [];
62 | }
63 |
--------------------------------------------------------------------------------
/app/Config/ForeignCharacters.php:
--------------------------------------------------------------------------------
1 |
27 | */
28 | public $views = [
29 | 'make:command' => 'CodeIgniter\Commands\Generators\Views\command.tpl.php',
30 | 'make:controller' => 'CodeIgniter\Commands\Generators\Views\controller.tpl.php',
31 | 'make:entity' => 'CodeIgniter\Commands\Generators\Views\entity.tpl.php',
32 | 'make:filter' => 'CodeIgniter\Commands\Generators\Views\filter.tpl.php',
33 | 'make:migration' => 'CodeIgniter\Commands\Generators\Views\migration.tpl.php',
34 | 'make:model' => 'CodeIgniter\Commands\Generators\Views\model.tpl.php',
35 | 'make:seeder' => 'CodeIgniter\Commands\Generators\Views\seeder.tpl.php',
36 | 'make:validation' => 'CodeIgniter\Commands\Generators\Views\validation.tpl.php',
37 | 'session:migration' => 'CodeIgniter\Commands\Generators\Views\migration.tpl.php',
38 | ];
39 | }
40 |
--------------------------------------------------------------------------------
/app/Config/Honeypot.php:
--------------------------------------------------------------------------------
1 | {label}';
36 |
37 | /**
38 | * Honeypot container
39 | *
40 | * @var string
41 | */
42 | public $container = '
{template}
';
43 | }
44 |
--------------------------------------------------------------------------------
/app/Config/Images.php:
--------------------------------------------------------------------------------
1 |
30 | */
31 | public $handlers = [
32 | 'gd' => GDHandler::class,
33 | 'imagick' => ImageMagickHandler::class,
34 | ];
35 | }
36 |
--------------------------------------------------------------------------------
/app/Config/Kint.php:
--------------------------------------------------------------------------------
1 | php spark migrate:create
46 | *
47 | * Typical formats:
48 | * - YmdHis_
49 | * - Y-m-d-His_
50 | * - Y_m_d_His_
51 | *
52 | * @var string
53 | */
54 | public $timestampFormat = 'Y-m-d-His_';
55 | }
56 |
--------------------------------------------------------------------------------
/app/Config/Modules.php:
--------------------------------------------------------------------------------
1 |
22 | */
23 | public $templates = [
24 | 'default_full' => 'CodeIgniter\Pager\Views\default_full',
25 | 'default_simple' => 'CodeIgniter\Pager\Views\default_simple',
26 | 'default_head' => 'CodeIgniter\Pager\Views\default_head',
27 | ];
28 |
29 | /**
30 | * --------------------------------------------------------------------------
31 | * Items Per Page
32 | * --------------------------------------------------------------------------
33 | *
34 | * The default number of results shown in a single page.
35 | *
36 | * @var integer
37 | */
38 | public $perPage = 20;
39 | }
40 |
--------------------------------------------------------------------------------
/app/Config/Routes.php:
--------------------------------------------------------------------------------
1 | setDefaultNamespace('App\Controllers');
20 | $routes->setDefaultController('Home');
21 | $routes->setDefaultMethod('index');
22 | $routes->setTranslateURIDashes(false);
23 | $routes->set404Override();
24 | $routes->setAutoRoute(true);
25 |
26 | /*
27 | * --------------------------------------------------------------------
28 | * Route Definitions
29 | * --------------------------------------------------------------------
30 | */
31 |
32 | // We get a performance increase by specifying the default
33 | // route since we don't have to scan directories.
34 | $routes->get('/', 'Home::index');
35 | $routes->resource('api');
36 |
37 | /*
38 | * --------------------------------------------------------------------
39 | * Additional Routing
40 | * --------------------------------------------------------------------
41 | *
42 | * There will often be times that you need additional routing and you
43 | * need it to be able to override any defaults in this file. Environment
44 | * based routes is one such time. require() additional route files here
45 | * to make that happen.
46 | *
47 | * You will have access to the $routes object within that file without
48 | * needing to reload it.
49 | */
50 | if (file_exists(APPPATH . 'Config/' . ENVIRONMENT . '/Routes.php')) {
51 | require APPPATH . 'Config/' . ENVIRONMENT . '/Routes.php';
52 | }
53 |
--------------------------------------------------------------------------------
/app/Config/Services.php:
--------------------------------------------------------------------------------
1 |
34 | */
35 | public $templates = [
36 | 'list' => 'CodeIgniter\Validation\Views\list',
37 | 'single' => 'CodeIgniter\Validation\Views\single',
38 | ];
39 |
40 | //--------------------------------------------------------------------
41 | // Rules
42 | //--------------------------------------------------------------------
43 | }
44 |
--------------------------------------------------------------------------------
/app/Config/View.php:
--------------------------------------------------------------------------------
1 | session = \Config\Services::session();
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/app/Controllers/Home.php:
--------------------------------------------------------------------------------
1 | forge->addField([
12 | 'id' => [
13 | 'type' => 'INT',
14 | 'unsigned' => true,
15 | 'auto_increment' => true,
16 | ],
17 | 'nama' => [
18 | 'type' => 'VARCHAR',
19 | 'constraint' => '100',
20 | ],
21 | 'umur' => [
22 | 'type' => 'VARCHAR',
23 | 'constraint' => '100',
24 | ],
25 | 'alamat' => [
26 | 'type' => 'TEXT'
27 | ],
28 | ]);
29 | $this->forge->addKey('id', true);
30 | $this->forge->createTable('user');
31 | }
32 |
33 | public function down()
34 | {
35 | $this->forge->dropTable('user');
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/app/Database/Migrations/2021-02-10-064556_Member.php:
--------------------------------------------------------------------------------
1 | forge->addField([
12 | 'id' => [
13 | 'type' => 'INT',
14 | 'unsigned' => true,
15 | 'auto_increment' => true,
16 | ],
17 | 'username' => [
18 | 'type' => 'VARCHAR',
19 | 'constraint' => '100',
20 | ],
21 | 'password' => [
22 | 'type' => 'VARCHAR',
23 | 'constraint' => '100',
24 | ]
25 | ]);
26 | $this->forge->addKey('id', true);
27 | $this->forge->createTable('member');
28 | }
29 |
30 | public function down()
31 | {
32 | $this->forge->dropTable('member');
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/app/Database/Seeds/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asnur/RestFul-API/58f0ad6ab6dca0a53a538299ca195b42b5a3e5cf/app/Database/Seeds/.gitkeep
--------------------------------------------------------------------------------
/app/Database/Seeds/Member.php:
--------------------------------------------------------------------------------
1 | $faker->name,
15 | 'umur' => $faker->randomNumber(2),
16 | 'alamat' => $faker->address
17 | ];
18 | $this->db->table('member')->insert($data);
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/app/Database/Seeds/User.php:
--------------------------------------------------------------------------------
1 | 'admin',
13 | 'password' => md5('admin')
14 | ];
15 | $this->db->table('user')->insert($data);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/app/Filters/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asnur/RestFul-API/58f0ad6ab6dca0a53a538299ca195b42b5a3e5cf/app/Filters/.gitkeep
--------------------------------------------------------------------------------
/app/Helpers/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asnur/RestFul-API/58f0ad6ab6dca0a53a538299ca195b42b5a3e5cf/app/Helpers/.gitkeep
--------------------------------------------------------------------------------
/app/Language/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asnur/RestFul-API/58f0ad6ab6dca0a53a538299ca195b42b5a3e5cf/app/Language/.gitkeep
--------------------------------------------------------------------------------
/app/Language/en/Validation.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 404 Page Not Found
6 |
7 |
70 |
71 |
72 |
73 |
404 - File Not Found
74 |
75 |
76 |
77 | = esc($message) ?>
78 |
79 | Sorry! Cannot seem to find the page you were looking for.
80 |
81 |
82 |
83 |
84 |
85 |
--------------------------------------------------------------------------------
/app/Views/errors/html/production.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Whoops!
8 |
9 |
12 |
13 |
14 |
15 |
16 |
17 |
Whoops!
18 |
19 |
We seem to have hit a snag. Please try again later...
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/app/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 403 Forbidden
5 |
6 |
7 |
8 | Directory access is forbidden.
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "codeigniter4/framework",
3 | "type": "project",
4 | "description": "The CodeIgniter framework v4",
5 | "homepage": "https://codeigniter.com",
6 | "license": "MIT",
7 | "require": {
8 | "php": "^7.3||^8.0",
9 | "ext-curl": "*",
10 | "ext-intl": "*",
11 | "ext-json": "*",
12 | "ext-mbstring": "*",
13 | "kint-php/kint": "^3.3",
14 | "laminas/laminas-escaper": "^2.6",
15 | "psr/log": "^1.1",
16 | "fzaninotto/faker": "^1.9",
17 | "firebase/php-jwt": "^5.2"
18 | },
19 | "require-dev": {
20 | "codeigniter4/codeigniter4-standard": "^1.0",
21 | "fakerphp/faker": "^1.9",
22 | "mikey179/vfsstream": "^1.6",
23 | "phpunit/phpunit": "^9.1",
24 | "predis/predis": "^1.1",
25 | "squizlabs/php_codesniffer": "^3.3"
26 | },
27 | "suggest": {
28 | "ext-fileinfo": "Improves mime type detection for files"
29 | },
30 | "autoload": {
31 | "psr-4": {
32 | "CodeIgniter\\": "system/"
33 | },
34 | "exclude-from-classmap": [
35 | "**/Database/Migrations/**"
36 | ]
37 | },
38 | "scripts": {
39 | "post-update-cmd": [
40 | "CodeIgniter\\ComposerScripts::postUpdate"
41 | ],
42 | "test": "phpunit"
43 | },
44 | "support": {
45 | "forum": "http://forum.codeigniter.com/",
46 | "source": "https://github.com/codeigniter4/CodeIgniter4",
47 | "slack": "https://codeigniterchat.slack.com"
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/public/.htaccess:
--------------------------------------------------------------------------------
1 | # Disable directory browsing
2 | Options All -Indexes
3 |
4 | # ----------------------------------------------------------------------
5 | # Rewrite engine
6 | # ----------------------------------------------------------------------
7 |
8 | # Turning on the rewrite engine is necessary for the following rules and features.
9 | # FollowSymLinks must be enabled for this to work.
10 |
11 | Options +FollowSymlinks
12 | RewriteEngine On
13 |
14 | # If you installed CodeIgniter in a subfolder, you will need to
15 | # change the following line to match the subfolder you need.
16 | # http://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewritebase
17 | # RewriteBase /
18 |
19 | # Redirect Trailing Slashes...
20 | RewriteCond %{REQUEST_FILENAME} !-d
21 | RewriteCond %{REQUEST_URI} (.+)/$
22 | RewriteRule ^ %1 [L,R=301]
23 |
24 | # Rewrite "www.example.com -> example.com"
25 | RewriteCond %{HTTPS} !=on
26 | RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
27 | RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]
28 |
29 | # Checks to see if the user is attempting to access a valid file,
30 | # such as an image or css document, if this isn't true it sends the
31 | # request to the front controller, index.php
32 | RewriteCond %{REQUEST_FILENAME} !-f
33 | RewriteCond %{REQUEST_FILENAME} !-d
34 | RewriteRule ^([\s\S]*)$ index.php/$1 [L,NC,QSA]
35 |
36 | # Ensure Authorization header is passed along
37 | RewriteCond %{HTTP:Authorization} .
38 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
39 |
40 |
41 |
42 | # If we don't have mod_rewrite installed, all 404's
43 | # can be sent to index.php, and everything works as normal.
44 | ErrorDocument 404 index.php
45 |
46 |
47 | # Disable server signature start
48 | ServerSignature Off
49 | # Disable server signature end
50 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/asnur/RestFul-API/58f0ad6ab6dca0a53a538299ca195b42b5a3e5cf/public/favicon.ico
--------------------------------------------------------------------------------
/public/index.php:
--------------------------------------------------------------------------------
1 | systemDirectory, '\\/ ') . DIRECTORY_SEPARATOR . 'bootstrap.php';
35 | $app = require realpath($bootstrap) ?: $bootstrap;
36 |
37 | /*
38 | *---------------------------------------------------------------
39 | * LAUNCH THE APPLICATION
40 | *---------------------------------------------------------------
41 | * Now that everything is setup, it's time to actually fire
42 | * up the engines and make this app do its thang.
43 | */
44 | $app->run();
45 |
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | User-agent: *
2 | Disallow:
3 |
--------------------------------------------------------------------------------
/system/.htaccess:
--------------------------------------------------------------------------------
1 |
2 | Require all denied
3 |
4 |
5 | Deny from all
6 |
7 |
--------------------------------------------------------------------------------
/system/CLI/Console.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\CLI;
13 |
14 | use CodeIgniter\CodeIgniter;
15 | use CodeIgniter\HTTP\RequestInterface;
16 | use CodeIgniter\HTTP\Response;
17 | use CodeIgniter\HTTP\ResponseInterface;
18 | use Exception;
19 |
20 | /**
21 | * Console
22 | */
23 | class Console
24 | {
25 | /**
26 | * Main CodeIgniter instance.
27 | *
28 | * @var CodeIgniter
29 | */
30 | protected $app;
31 |
32 | //--------------------------------------------------------------------
33 |
34 | /**
35 | * Console constructor.
36 | *
37 | * @param CodeIgniter $app
38 | */
39 | public function __construct(CodeIgniter $app)
40 | {
41 | $this->app = $app;
42 | }
43 |
44 | //--------------------------------------------------------------------
45 |
46 | /**
47 | * Runs the current command discovered on the CLI.
48 | *
49 | * @param boolean $useSafeOutput
50 | *
51 | * @return RequestInterface|Response|ResponseInterface|mixed
52 | * @throws Exception
53 | */
54 | public function run(bool $useSafeOutput = false)
55 | {
56 | $path = CLI::getURI() ?: 'list';
57 |
58 | // Set the path for the application to route to.
59 | $this->app->setPath("ci{$path}");
60 |
61 | return $this->app->useSafeOutput($useSafeOutput)->run();
62 | }
63 |
64 | //--------------------------------------------------------------------
65 |
66 | /**
67 | * Displays basic information about the Console.
68 | */
69 | public function showHeader()
70 | {
71 | CLI::write(sprintf('CodeIgniter v%s Command Line Tool - Server Time: %s UTC%s', CodeIgniter::CI_VERSION, date('Y-m-d H:i:s'), date('P')), 'green');
72 | CLI::newLine();
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/system/CLI/Exceptions/CLIException.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\CLI\Exceptions;
13 |
14 | use CodeIgniter\Exceptions\DebugTraceableTrait;
15 | use RuntimeException;
16 |
17 | /**
18 | * CLIException
19 | */
20 | class CLIException extends RuntimeException
21 | {
22 | use DebugTraceableTrait;
23 |
24 | /**
25 | * Thrown when `$color` specified for `$type` is not within the
26 | * allowed list of colors.
27 | *
28 | * @param string $type
29 | * @param string $color
30 | *
31 | * @return CLIException
32 | */
33 | public static function forInvalidColor(string $type, string $color)
34 | {
35 | return new static(lang('CLI.invalidColor', [$type, $color]));
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/system/Cache/Exceptions/CacheException.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Cache\Exceptions;
13 |
14 | use CodeIgniter\Exceptions\DebugTraceableTrait;
15 | use RuntimeException;
16 |
17 | /**
18 | * CacheException
19 | */
20 | class CacheException extends RuntimeException implements ExceptionInterface
21 | {
22 | use DebugTraceableTrait;
23 |
24 | /**
25 | * Thrown when handler has no permission to write cache.
26 | *
27 | * @param string $path
28 | *
29 | * @return CacheException
30 | */
31 | public static function forUnableToWrite(string $path)
32 | {
33 | return new static(lang('Cache.unableToWrite', [$path]));
34 | }
35 |
36 | /**
37 | * Thrown when an unrecognized handler is used.
38 | *
39 | * @return CacheException
40 | */
41 | public static function forInvalidHandlers()
42 | {
43 | return new static(lang('Cache.invalidHandlers'));
44 | }
45 |
46 | /**
47 | * Thrown when no backup handler is setup in config.
48 | *
49 | * @return CacheException
50 | */
51 | public static function forNoBackup()
52 | {
53 | return new static(lang('Cache.noBackup'));
54 | }
55 |
56 | /**
57 | * Thrown when specified handler was not found.
58 | *
59 | * @return CacheException
60 | */
61 | public static function forHandlerNotFound()
62 | {
63 | return new static(lang('Cache.handlerNotFound'));
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/system/Cache/Exceptions/ExceptionInterface.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Cache\Exceptions;
13 |
14 | /**
15 | * Provides a domain-level interface for broad capture
16 | * of all framework-related exceptions.
17 | *
18 | * catch (\CodeIgniter\Cache\Exceptions\ExceptionInterface) { ... }
19 | */
20 | interface ExceptionInterface
21 | {
22 | }
23 |
--------------------------------------------------------------------------------
/system/Cache/Handlers/BaseHandler.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Cache\Handlers;
13 |
14 | use Closure;
15 | use CodeIgniter\Cache\CacheInterface;
16 |
17 | /**
18 | * Base class for cache handling
19 | */
20 | abstract class BaseHandler implements CacheInterface
21 | {
22 | /**
23 | * Get an item from the cache, or execute the given Closure and store the result.
24 | *
25 | * @param string $key Cache item name
26 | * @param integer $ttl Time to live
27 | * @param Closure $callback Callback return value
28 | *
29 | * @return mixed
30 | */
31 | public function remember(string $key, int $ttl, Closure $callback)
32 | {
33 | $value = $this->get($key);
34 |
35 | if (! is_null($value))
36 | {
37 | return $value;
38 | }
39 |
40 | $this->save($key, $value = $callback(), $ttl);
41 |
42 | return $value;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/system/Commands/Generators/EntityGenerator.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Commands\Generators;
13 |
14 | use CodeIgniter\CLI\BaseCommand;
15 | use CodeIgniter\CLI\CLI;
16 | use CodeIgniter\CLI\GeneratorTrait;
17 |
18 | /**
19 | * Generates a skeleton Entity file.
20 | */
21 | class EntityGenerator extends BaseCommand
22 | {
23 | use GeneratorTrait;
24 |
25 | /**
26 | * The Command's Group
27 | *
28 | * @var string
29 | */
30 | protected $group = 'Generators';
31 |
32 | /**
33 | * The Command's Name
34 | *
35 | * @var string
36 | */
37 | protected $name = 'make:entity';
38 |
39 | /**
40 | * The Command's Description
41 | *
42 | * @var string
43 | */
44 | protected $description = 'Generates a new entity file.';
45 |
46 | /**
47 | * The Command's Usage
48 | *
49 | * @var string
50 | */
51 | protected $usage = 'make:entity [options]';
52 |
53 | /**
54 | * The Command's Arguments
55 | *
56 | * @var array
57 | */
58 | protected $arguments = [
59 | 'name' => 'The entity class name.',
60 | ];
61 |
62 | /**
63 | * The Command's Options
64 | *
65 | * @var array
66 | */
67 | protected $options = [
68 | '--namespace' => 'Set root namespace. Default: "APP_NAMESPACE".',
69 | '--suffix' => 'Append the component title to the class name (e.g. User => UserEntity).',
70 | '--force' => 'Force overwrite existing file.',
71 | ];
72 |
73 | /**
74 | * Actually execute a command.
75 | *
76 | * @param array $params
77 | */
78 | public function run(array $params)
79 | {
80 | $this->component = 'Entity';
81 | $this->directory = 'Entities';
82 | $this->template = 'entity.tpl.php';
83 |
84 | $this->execute($params);
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/system/Commands/Generators/FilterGenerator.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Commands\Generators;
13 |
14 | use CodeIgniter\CLI\BaseCommand;
15 | use CodeIgniter\CLI\CLI;
16 | use CodeIgniter\CLI\GeneratorTrait;
17 |
18 | /**
19 | * Generates a skeleton Filter file.
20 | */
21 | class FilterGenerator extends BaseCommand
22 | {
23 | use GeneratorTrait;
24 |
25 | /**
26 | * The Command's Group
27 | *
28 | * @var string
29 | */
30 | protected $group = 'Generators';
31 |
32 | /**
33 | * The Command's Name
34 | *
35 | * @var string
36 | */
37 | protected $name = 'make:filter';
38 |
39 | /**
40 | * The Command's Description
41 | *
42 | * @var string
43 | */
44 | protected $description = 'Generates a new filter file.';
45 |
46 | /**
47 | * The Command's Usage
48 | *
49 | * @var string
50 | */
51 | protected $usage = 'make:filter [options]';
52 |
53 | /**
54 | * The Command's Arguments
55 | *
56 | * @var array
57 | */
58 | protected $arguments = [
59 | 'name' => 'The filter class name.',
60 | ];
61 |
62 | /**
63 | * The Command's Options
64 | *
65 | * @var array
66 | */
67 | protected $options = [
68 | '--namespace' => 'Set root namespace. Default: "APP_NAMESPACE".',
69 | '--suffix' => 'Append the component title to the class name (e.g. User => UserFilter).',
70 | '--force' => 'Force overwrite existing file.',
71 | ];
72 |
73 | /**
74 | * Actually execute a command.
75 | *
76 | * @param array $params
77 | */
78 | public function run(array $params)
79 | {
80 | $this->component = 'Filter';
81 | $this->directory = 'Filters';
82 | $this->template = 'filter.tpl.php';
83 |
84 | $this->execute($params);
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/system/Commands/Generators/SeederGenerator.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Commands\Generators;
13 |
14 | use CodeIgniter\CLI\BaseCommand;
15 | use CodeIgniter\CLI\GeneratorTrait;
16 |
17 | /**
18 | * Generates a skeleton seeder file.
19 | */
20 | class SeederGenerator extends BaseCommand
21 | {
22 | use GeneratorTrait;
23 |
24 | /**
25 | * The Command's Group
26 | *
27 | * @var string
28 | */
29 | protected $group = 'Generators';
30 |
31 | /**
32 | * The Command's Name
33 | *
34 | * @var string
35 | */
36 | protected $name = 'make:seeder';
37 |
38 | /**
39 | * The Command's Description
40 | *
41 | * @var string
42 | */
43 | protected $description = 'Generates a new seeder file.';
44 |
45 | /**
46 | * The Command's Usage
47 | *
48 | * @var string
49 | */
50 | protected $usage = 'make:seeder [options]';
51 |
52 | /**
53 | * The Command's Arguments
54 | *
55 | * @var array
56 | */
57 | protected $arguments = [
58 | 'name' => 'The seeder class name.',
59 | ];
60 |
61 | /**
62 | * The Command's Options
63 | *
64 | * @var array
65 | */
66 | protected $options = [
67 | '--namespace' => 'Set root namespace. Default: "APP_NAMESPACE".',
68 | '--suffix' => 'Append the component title to the class name (e.g. User => UserSeeder).',
69 | '--force' => 'Force overwrite existing file.',
70 | ];
71 |
72 | /**
73 | * Actually execute a command.
74 | *
75 | * @param array $params
76 | */
77 | public function run(array $params)
78 | {
79 | $this->component = 'Seeder';
80 | $this->directory = 'Database\Seeds';
81 | $this->template = 'seeder.tpl.php';
82 |
83 | $this->execute($params);
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/system/Commands/Generators/Views/command.tpl.php:
--------------------------------------------------------------------------------
1 | <@php
2 |
3 | namespace {namespace};
4 |
5 | use CodeIgniter\CLI\BaseCommand;
6 | use CodeIgniter\CLI\CLI;
7 |
8 | use CodeIgniter\CLI\GeneratorTrait;
9 |
10 |
11 | class {class} extends BaseCommand
12 | {
13 |
14 | use GeneratorTrait;
15 |
16 |
17 | /**
18 | * The Command's Group
19 | *
20 | * @var string
21 | */
22 | protected $group = '{group}';
23 |
24 | /**
25 | * The Command's Name
26 | *
27 | * @var string
28 | */
29 | protected $name = '{command}';
30 |
31 | /**
32 | * The Command's Description
33 | *
34 | * @var string
35 | */
36 | protected $description = '';
37 |
38 | /**
39 | * The Command's Usage
40 | *
41 | * @var string
42 | */
43 | protected $usage = '{command} [arguments] [options]';
44 |
45 | /**
46 | * The Command's Arguments
47 | *
48 | * @var array
49 | */
50 | protected $arguments = [];
51 |
52 | /**
53 | * The Command's Options
54 | *
55 | * @var array
56 | */
57 | protected $options = [];
58 |
59 | /**
60 | * Actually execute a command.
61 | *
62 | * @param array $params
63 | */
64 | public function run(array $params)
65 | {
66 |
67 | $this->component = 'Command';
68 | $this->directory = 'Commands';
69 | $this->template = 'command.tpl.php';
70 |
71 | $this->execute($params);
72 |
73 | //
74 |
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/system/Commands/Generators/Views/config.tpl.php:
--------------------------------------------------------------------------------
1 | <@php
2 |
3 | namespace {namespace};
4 |
5 | use CodeIgniter\Config\BaseConfig;
6 |
7 | class {class} extends BaseConfig
8 | {
9 | //
10 | }
11 |
--------------------------------------------------------------------------------
/system/Commands/Generators/Views/entity.tpl.php:
--------------------------------------------------------------------------------
1 | <@php
2 |
3 | namespace {namespace};
4 |
5 | use CodeIgniter\Entity;
6 |
7 | class {class} extends Entity
8 | {
9 | protected $datamap = [];
10 | protected $dates = [
11 | 'created_at',
12 | 'updated_at',
13 | 'deleted_at',
14 | ];
15 | protected $casts = [];
16 | }
17 |
--------------------------------------------------------------------------------
/system/Commands/Generators/Views/filter.tpl.php:
--------------------------------------------------------------------------------
1 | <@php
2 |
3 | namespace {namespace};
4 |
5 | use CodeIgniter\Filters\FilterInterface;
6 | use CodeIgniter\HTTP\RequestInterface;
7 | use CodeIgniter\HTTP\ResponseInterface;
8 |
9 | class {class} implements FilterInterface
10 | {
11 | /**
12 | * Do whatever processing this filter needs to do.
13 | * By default it should not return anything during
14 | * normal execution. However, when an abnormal state
15 | * is found, it should return an instance of
16 | * CodeIgniter\HTTP\Response. If it does, script
17 | * execution will end and that Response will be
18 | * sent back to the client, allowing for error pages,
19 | * redirects, etc.
20 | *
21 | * @param RequestInterface $request
22 | * @param array|null $arguments
23 | *
24 | * @return mixed
25 | */
26 | public function before(RequestInterface $request, $arguments = null)
27 | {
28 | //
29 | }
30 |
31 | /**
32 | * Allows After filters to inspect and modify the response
33 | * object as needed. This method does not allow any way
34 | * to stop execution of other after filters, short of
35 | * throwing an Exception or Error.
36 | *
37 | * @param RequestInterface $request
38 | * @param ResponseInterface $response
39 | * @param array|null $arguments
40 | *
41 | * @return mixed
42 | */
43 | public function after(RequestInterface $request, ResponseInterface $response, $arguments = null)
44 | {
45 | //
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/system/Commands/Generators/Views/migration.tpl.php:
--------------------------------------------------------------------------------
1 | <@php
2 |
3 | namespace {namespace};
4 |
5 | use CodeIgniter\Database\Migration;
6 |
7 | class {class} extends Migration
8 | {
9 |
10 | protected $DBGroup = '= $DBGroup ?>';
11 |
12 | public function up()
13 | {
14 | $this->forge->addField([
15 | 'id' => ['type' => 'VARCHAR', 'constraint' => 128, 'null' => false],
16 | 'ip_address' => ['type' => 'VARCHAR', 'constraint' => 45, 'null' => false],
17 | 'timestamp' => ['type' => 'INT', 'unsigned' => true, 'null' => false, 'default' => 0],
18 | 'data' => ['type' => 'TEXT', 'null' => false, 'default' => ''],
19 | ]);
20 |
21 | $this->forge->addKey(['id', 'ip_address'], true);
22 |
23 | $this->forge->addKey('id', true);
24 |
25 | $this->forge->addKey('timestamp');
26 | $this->forge->createTable('= $table ?>', true);
27 | }
28 |
29 | public function down()
30 | {
31 | $this->forge->dropTable('= $table ?>', true);
32 | }
33 |
34 | public function up()
35 | {
36 | //
37 | }
38 |
39 | public function down()
40 | {
41 | //
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/system/Commands/Generators/Views/model.tpl.php:
--------------------------------------------------------------------------------
1 | <@php
2 |
3 | namespace {namespace};
4 |
5 | use CodeIgniter\Model;
6 |
7 | class {class} extends Model
8 | {
9 | protected $DBGroup = '{DBGroup}';
10 | protected $table = '{table}';
11 | protected $primaryKey = 'id';
12 | protected $useAutoIncrement = true;
13 | protected $insertID = 0;
14 | protected $returnType = '{return}';
15 | protected $useSoftDelete = false;
16 | protected $protectFields = true;
17 | protected $allowedFields = [];
18 |
19 | // Dates
20 | protected $useTimestamps = false;
21 | protected $dateFormat = 'datetime';
22 | protected $createdField = 'created_at';
23 | protected $updatedField = 'updated_at';
24 | protected $deletedField = 'deleted_at';
25 |
26 | // Validation
27 | protected $validationRules = [];
28 | protected $validationMessages = [];
29 | protected $skipValidation = false;
30 | protected $cleanValidationRules = true;
31 |
32 | // Callbacks
33 | protected $allowCallbacks = true;
34 | protected $beforeInsert = [];
35 | protected $afterInsert = [];
36 | protected $beforeUpdate = [];
37 | protected $afterUpdate = [];
38 | protected $beforeFind = [];
39 | protected $afterFind = [];
40 | protected $beforeDelete = [];
41 | protected $afterDelete = [];
42 | }
43 |
--------------------------------------------------------------------------------
/system/Commands/Generators/Views/seeder.tpl.php:
--------------------------------------------------------------------------------
1 | <@php
2 |
3 | namespace {namespace};
4 |
5 | use CodeIgniter\Database\Seeder;
6 |
7 | class {class} extends Seeder
8 | {
9 | public function run()
10 | {
11 | //
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/system/Commands/Generators/Views/validation.tpl.php:
--------------------------------------------------------------------------------
1 | <@php
2 |
3 | namespace {namespace};
4 |
5 | class {class}
6 | {
7 | // public function custom_rule(): bool
8 | // {
9 | // return true;
10 | // }
11 | }
12 |
--------------------------------------------------------------------------------
/system/Commands/Housekeeping/ClearDebugbar.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Commands\Housekeeping;
13 |
14 | use CodeIgniter\CLI\BaseCommand;
15 | use CodeIgniter\CLI\CLI;
16 |
17 | /**
18 | * ClearDebugbar Command
19 | */
20 | class ClearDebugbar extends BaseCommand
21 | {
22 | /**
23 | * The group the command is lumped under
24 | * when listing commands.
25 | *
26 | * @var string
27 | */
28 | protected $group = 'Housekeeping';
29 |
30 | /**
31 | * The Command's name
32 | *
33 | * @var string
34 | */
35 | protected $name = 'debugbar:clear';
36 |
37 | /**
38 | * The Command's usage
39 | *
40 | * @var string
41 | */
42 | protected $usage = 'debugbar:clear';
43 |
44 | /**
45 | * The Command's short description.
46 | *
47 | * @var string
48 | */
49 | protected $description = 'Clears all debugbar JSON files.';
50 |
51 | /**
52 | * Actually runs the command.
53 | *
54 | * @param array $params
55 | *
56 | * @return void
57 | */
58 | public function run(array $params)
59 | {
60 | helper('filesystem');
61 |
62 | if (! delete_files(WRITEPATH . 'debugbar'))
63 | {
64 | // @codeCoverageIgnoreStart
65 | CLI::error('Error deleting the debugbar JSON files.');
66 | CLI::newLine();
67 | return;
68 | // @codeCoverageIgnoreEnd
69 | }
70 |
71 | CLI::write('Debugbar cleared.', 'green');
72 | CLI::newLine();
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/system/Commands/Server/rewrite.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | /*
13 | * CodeIgniter PHP-Development Server Rewrite Rules
14 | *
15 | * This script works with the CLI serve command to help run a seamless
16 | * development server based around PHP's built-in development
17 | * server. This file simply tries to mimic Apache's mod_rewrite
18 | * functionality so the site will operate as normal.
19 | */
20 |
21 | // @codeCoverageIgnoreStart
22 | // Avoid this file run when listing commands
23 | if (PHP_SAPI === 'cli')
24 | {
25 | return;
26 | }
27 |
28 | $uri = urldecode(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH));
29 |
30 | // Front Controller path - expected to be in the default folder
31 | $fcpath = $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR;
32 |
33 | // Full path
34 | $path = $fcpath . ltrim($uri, '/');
35 |
36 | // If $path is an existing file or folder within the public folder
37 | // then let the request handle it like normal.
38 | if ($uri !== '/' && (is_file($path) || is_dir($path)))
39 | {
40 | return false;
41 | }
42 |
43 | // Otherwise, we'll load the index file and let
44 | // the framework handle the request from here.
45 | require_once $fcpath . 'index.php';
46 | // @codeCoverageIgnoreEnd
47 |
--------------------------------------------------------------------------------
/system/Config/Config.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Config;
13 |
14 | /**
15 | * Class Config
16 | *
17 | * @deprecated Use CodeIgniter\Config\Factories::config()
18 | */
19 | class Config
20 | {
21 | /**
22 | * Create new configuration instances or return
23 | * a shared instance
24 | *
25 | * @param string $name Configuration name
26 | * @param boolean $getShared Use shared instance
27 | *
28 | * @return mixed|null
29 | */
30 | public static function get(string $name, bool $getShared = true)
31 | {
32 | return Factories::config($name, ['getShared' => $getShared]);
33 | }
34 |
35 | /**
36 | * Helper method for injecting mock instances while testing.
37 | *
38 | * @param string $name
39 | * @param object $instance
40 | */
41 | public static function injectMock(string $name, $instance)
42 | {
43 | Factories::injectMock('config', $name, $instance);
44 | }
45 |
46 | /**
47 | * Resets the static arrays
48 | */
49 | public static function reset()
50 | {
51 | Factories::reset('config');
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/system/Config/Factory.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Config;
13 |
14 | /**
15 | * Factories Configuration file.
16 | *
17 | * Provides overriding directives for how
18 | * Factories should handle discovery and
19 | * instantiation of specific components.
20 | * Each property should correspond to the
21 | * lowercase, plural component name.
22 | */
23 | class Factory extends BaseConfig
24 | {
25 | /**
26 | * Supplies a default set of options to merge for
27 | * all unspecified factory components.
28 | *
29 | * @var array
30 | */
31 | public static $default = [
32 | 'component' => null,
33 | 'path' => null,
34 | 'instanceOf' => null,
35 | 'getShared' => true,
36 | 'preferApp' => true,
37 | ];
38 |
39 | /**
40 | * Specifies that Models should always favor child
41 | * classes to allow easy extension of module Models.
42 | *
43 | * @var array
44 | */
45 | public $models = [
46 | 'preferApp' => true,
47 | ];
48 | }
49 |
--------------------------------------------------------------------------------
/system/Config/Routes.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | use CodeIgniter\Exceptions\PageNotFoundException;
13 |
14 | /**
15 | * System URI Routing
16 | *
17 | * This file contains any routing to system tools, such as command-line
18 | * tools for migrations, etc.
19 | *
20 | * It is called by Config\Routes, and has the $routes RouteCollection
21 | * already loaded up and ready for us to use.
22 | */
23 |
24 | // Prevent access to BaseController
25 | $routes->add('BaseController(:any)', function () {
26 | throw PageNotFoundException::forPageNotFound();
27 | });
28 |
29 | // Prevent access to initController method
30 | $routes->add('(:any)/initController', function () {
31 | throw PageNotFoundException::forPageNotFound();
32 | });
33 |
34 | // Migrations
35 | $routes->cli('migrations/(:segment)/(:segment)', '\CodeIgniter\Commands\MigrationsCommand::$1/$2');
36 | $routes->cli('migrations/(:segment)', '\CodeIgniter\Commands\MigrationsCommand::$1');
37 | $routes->cli('migrations', '\CodeIgniter\Commands\MigrationsCommand::index');
38 |
39 | // CLI Catchall - uses a _remap to call Commands
40 | $routes->cli('ci(:any)', '\CodeIgniter\CLI\CommandRunner::index/$1');
41 |
--------------------------------------------------------------------------------
/system/Database/Exceptions/DatabaseException.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Database\Exceptions;
13 |
14 | use Error;
15 |
16 | class DatabaseException extends Error implements ExceptionInterface
17 | {
18 | /**
19 | * Exit status code
20 | *
21 | * @var integer
22 | */
23 | protected $code = 8;
24 | }
25 |
--------------------------------------------------------------------------------
/system/Database/Exceptions/ExceptionInterface.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Database\Exceptions;
13 |
14 | /**
15 | * Provides a domain-level interface for broad capture
16 | * of all database-related exceptions.
17 | *
18 | * catch (\CodeIgniter\Database\Exceptions\ExceptionInterface) { ... }
19 | */
20 | interface ExceptionInterface extends \CodeIgniter\Exceptions\ExceptionInterface
21 | {
22 | }
23 |
--------------------------------------------------------------------------------
/system/Database/Migration.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Database;
13 |
14 | use Config\Database;
15 |
16 | /**
17 | * Class Migration
18 | */
19 | abstract class Migration
20 | {
21 | /**
22 | * The name of the database group to use.
23 | *
24 | * @var string
25 | */
26 | protected $DBGroup;
27 |
28 | /**
29 | * Database Connection instance
30 | *
31 | * @var ConnectionInterface
32 | */
33 | protected $db;
34 |
35 | /**
36 | * Database Forge instance.
37 | *
38 | * @var Forge
39 | */
40 | protected $forge;
41 |
42 | //--------------------------------------------------------------------
43 |
44 | /**
45 | * Constructor.
46 | *
47 | * @param Forge $forge
48 | */
49 | public function __construct(Forge $forge = null)
50 | {
51 | $this->forge = ! is_null($forge) ? $forge : Database::forge($this->DBGroup ?? config('Database')->defaultGroup);
52 |
53 | $this->db = $this->forge->getConnection();
54 | }
55 |
56 | //--------------------------------------------------------------------
57 |
58 | /**
59 | * Returns the database group name this migration uses.
60 | *
61 | * @return string
62 | */
63 | public function getDBGroup(): ?string
64 | {
65 | return $this->DBGroup;
66 | }
67 |
68 | //--------------------------------------------------------------------
69 |
70 | /**
71 | * Perform a migration step.
72 | */
73 | abstract public function up();
74 |
75 | //--------------------------------------------------------------------
76 |
77 | /**
78 | * Revert a migration step.
79 | */
80 | abstract public function down();
81 |
82 | //--------------------------------------------------------------------
83 | }
84 |
--------------------------------------------------------------------------------
/system/Database/ModelFactory.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Database;
13 |
14 | use CodeIgniter\Config\Factories;
15 |
16 | /**
17 | * Returns new or shared Model instances
18 | *
19 | * @deprecated Use CodeIgniter\Config\Factories::models()
20 | */
21 | class ModelFactory
22 | {
23 | /**
24 | * Creates new Model instances or returns a shared instance
25 | *
26 | * @param string $name Model name, namespace optional
27 | * @param boolean $getShared Use shared instance
28 | * @param ConnectionInterface $connection
29 | *
30 | * @return mixed|null
31 | */
32 | public static function get(string $name, bool $getShared = true, ConnectionInterface $connection = null)
33 | {
34 | return Factories::models($name, ['getShared' => $getShared], $connection);
35 | }
36 |
37 | /**
38 | * Helper method for injecting mock instances while testing.
39 | *
40 | * @param string $name
41 | * @param object $instance
42 | */
43 | public static function injectMock(string $name, $instance)
44 | {
45 | Factories::injectMock('models', $name, $instance);
46 | }
47 |
48 | /**
49 | * Resets the static arrays
50 | */
51 | public static function reset()
52 | {
53 | Factories::reset('models');
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/system/Database/MySQLi/Builder.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Database\MySQLi;
13 |
14 | use CodeIgniter\Database\BaseBuilder;
15 |
16 | /**
17 | * Builder for MySQLi
18 | */
19 | class Builder extends BaseBuilder
20 | {
21 | /**
22 | * Identifier escape character
23 | *
24 | * @var string
25 | */
26 | protected $escapeChar = '`';
27 |
28 | /**
29 | * Specifies which sql statements
30 | * support the ignore option.
31 | *
32 | * @var array
33 | */
34 | protected $supportedIgnoreStatements = [
35 | 'update' => 'IGNORE',
36 | 'insert' => 'IGNORE',
37 | 'delete' => 'IGNORE',
38 | ];
39 |
40 | /**
41 | * FROM tables
42 | *
43 | * Groups tables in FROM clauses if needed, so there is no confusion
44 | * about operator precedence.
45 | *
46 | * Note: This is only used (and overridden) by MySQL.
47 | *
48 | * @return string
49 | */
50 | protected function _fromTables(): string
51 | {
52 | if (! empty($this->QBJoin) && count($this->QBFrom) > 1)
53 | {
54 | return '(' . implode(', ', $this->QBFrom) . ')';
55 | }
56 |
57 | return implode(', ', $this->QBFrom);
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/system/Database/MySQLi/Utils.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Database\MySQLi;
13 |
14 | use CodeIgniter\Database\BaseUtils;
15 | use CodeIgniter\Database\Exceptions\DatabaseException;
16 |
17 | /**
18 | * Utils for MySQLi
19 | */
20 | class Utils extends BaseUtils
21 | {
22 | /**
23 | * List databases statement
24 | *
25 | * @var string
26 | */
27 | protected $listDatabases = 'SHOW DATABASES';
28 |
29 | /**
30 | * OPTIMIZE TABLE statement
31 | *
32 | * @var string
33 | */
34 | protected $optimizeTable = 'OPTIMIZE TABLE %s';
35 |
36 | //--------------------------------------------------------------------
37 |
38 | /**
39 | * Platform dependent version of the backup function.
40 | *
41 | * @param array|null $prefs
42 | *
43 | * @return mixed
44 | */
45 | public function _backup(array $prefs = null)
46 | {
47 | throw new DatabaseException('Unsupported feature of the database platform you are using.');
48 | }
49 |
50 | //--------------------------------------------------------------------
51 | }
52 |
--------------------------------------------------------------------------------
/system/Database/Postgre/Utils.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Database\Postgre;
13 |
14 | use CodeIgniter\Database\BaseUtils;
15 | use CodeIgniter\Database\Exceptions\DatabaseException;
16 |
17 | /**
18 | * Utils for Postgre
19 | */
20 | class Utils extends BaseUtils
21 | {
22 | /**
23 | * List databases statement
24 | *
25 | * @var string
26 | */
27 | protected $listDatabases = 'SELECT datname FROM pg_database';
28 |
29 | /**
30 | * OPTIMIZE TABLE statement
31 | *
32 | * @var string
33 | */
34 | protected $optimizeTable = 'REINDEX TABLE %s';
35 |
36 | //--------------------------------------------------------------------
37 |
38 | /**
39 | * Platform dependent version of the backup function.
40 | *
41 | * @param array|null $prefs
42 | *
43 | * @return mixed
44 | */
45 | public function _backup(array $prefs = null)
46 | {
47 | throw new DatabaseException('Unsupported feature of the database platform you are using.');
48 | }
49 |
50 | //--------------------------------------------------------------------
51 | }
52 |
--------------------------------------------------------------------------------
/system/Database/SQLSRV/Utils.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Database\SQLSRV;
13 |
14 | use CodeIgniter\Database\BaseUtils;
15 | use CodeIgniter\Database\Exceptions\DatabaseException;
16 |
17 | /**
18 | * Utils for SQLSRV
19 | */
20 | class Utils extends BaseUtils
21 | {
22 | /**
23 | * List databases statement
24 | *
25 | * @var string
26 | */
27 | protected $listDatabases = 'EXEC sp_helpdb'; // Can also be: EXEC sp_databases
28 |
29 | /**
30 | * OPTIMIZE TABLE statement
31 | *
32 | * @var string
33 | */
34 | protected $optimizeTable = 'ALTER INDEX all ON %s REORGANIZE';
35 |
36 | //--------------------------------------------------------------------
37 |
38 | /**
39 | * Platform dependent version of the backup function.
40 | *
41 | * @param array|null $prefs
42 | *
43 | * @return mixed
44 | */
45 | public function _backup(array $prefs = null)
46 | {
47 | throw new DatabaseException('Unsupported feature of the database platform you are using.');
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/system/Database/SQLite3/Utils.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Database\SQLite3;
13 |
14 | use CodeIgniter\Database\BaseUtils;
15 | use CodeIgniter\Database\Exceptions\DatabaseException;
16 |
17 | /**
18 | * Utils for SQLite3
19 | */
20 | class Utils extends BaseUtils
21 | {
22 | /**
23 | * OPTIMIZE TABLE statement
24 | *
25 | * @var string
26 | */
27 | protected $optimizeTable = 'REINDEX %s';
28 |
29 | //--------------------------------------------------------------------
30 |
31 | /**
32 | * Platform dependent version of the backup function.
33 | *
34 | * @param array|null $prefs
35 | *
36 | * @return mixed
37 | */
38 | public function _backup(array $prefs = null)
39 | {
40 | throw new DatabaseException('Unsupported feature of the database platform you are using.');
41 | }
42 |
43 | //--------------------------------------------------------------------
44 | }
45 |
--------------------------------------------------------------------------------
/system/Debug/Toolbar/Collectors/Config.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Debug\Toolbar\Collectors;
13 |
14 | use CodeIgniter\CodeIgniter;
15 | use Config\App;
16 | use Config\Services;
17 |
18 | /**
19 | * Debug toolbar configuration
20 | */
21 | class Config
22 | {
23 | /**
24 | * Return toolbar config values as an array.
25 | *
26 | * @return array
27 | */
28 | public static function display(): array
29 | {
30 | $config = config(App::class);
31 |
32 | return [
33 | 'ciVersion' => CodeIgniter::CI_VERSION,
34 | 'phpVersion' => phpversion(),
35 | 'phpSAPI' => php_sapi_name(),
36 | 'environment' => ENVIRONMENT,
37 | 'baseURL' => $config->baseURL,
38 | 'timezone' => app_timezone(),
39 | 'locale' => Services::request()->getLocale(),
40 | 'cspEnabled' => $config->CSPEnabled,
41 | ];
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/system/Debug/Toolbar/Collectors/Timers.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Debug\Toolbar\Collectors;
13 |
14 | use Config\Services;
15 |
16 | /**
17 | * Timers collector
18 | */
19 | class Timers extends BaseCollector
20 | {
21 | /**
22 | * Whether this collector has data that can
23 | * be displayed in the Timeline.
24 | *
25 | * @var boolean
26 | */
27 | protected $hasTimeline = true;
28 |
29 | /**
30 | * Whether this collector needs to display
31 | * content in a tab or not.
32 | *
33 | * @var boolean
34 | */
35 | protected $hasTabContent = false;
36 |
37 | /**
38 | * The 'title' of this Collector.
39 | * Used to name things in the toolbar HTML.
40 | *
41 | * @var string
42 | */
43 | protected $title = 'Timers';
44 |
45 | //--------------------------------------------------------------------
46 |
47 | /**
48 | * Child classes should implement this to return the timeline data
49 | * formatted for correct usage.
50 | *
51 | * @return array
52 | */
53 | protected function formatTimelineData(): array
54 | {
55 | $data = [];
56 |
57 | $benchmark = Services::timer(true);
58 | $rows = $benchmark->getTimers(6);
59 |
60 | foreach ($rows as $name => $info)
61 | {
62 | if ($name === 'total_execution')
63 | {
64 | continue;
65 | }
66 |
67 | $data[] = [
68 | 'name' => ucwords(str_replace('_', ' ', $name)),
69 | 'component' => 'Timer',
70 | 'start' => $info['start'],
71 | 'duration' => $info['end'] - $info['start'],
72 | ];
73 | }
74 |
75 | return $data;
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/system/Debug/Toolbar/Views/_config.tpl:
--------------------------------------------------------------------------------
1 |
2 | Read the CodeIgniter docs...
3 |
4 |
5 |
6 |
7 |
8 | CodeIgniter Version: |
9 | { ciVersion } |
10 |
11 |
12 | PHP Version: |
13 | { phpVersion } |
14 |
15 |
16 | PHP SAPI: |
17 | { phpSAPI } |
18 |
19 |
20 | Environment: |
21 | { environment } |
22 |
23 |
24 | Base URL: |
25 |
26 | { if $baseURL == '' }
27 |
28 | The $baseURL should always be set manually to prevent possible URL personification from external parties.
29 |
30 | { else }
31 | { baseURL }
32 | { endif }
33 | |
34 |
35 |
36 | Timezone: |
37 | { timezone } |
38 |
39 |
40 | Locale: |
41 | { locale } |
42 |
43 |
44 | Content Security Policy Enabled: |
45 | { if $cspEnabled } Yes { else } No { endif } |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/system/Debug/Toolbar/Views/_database.tpl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Time |
5 | Query String |
6 |
7 |
8 |
9 | {queries}
10 |
11 | {duration} |
12 | {! sql !} |
13 |
14 | {/queries}
15 |
16 |
17 |
--------------------------------------------------------------------------------
/system/Debug/Toolbar/Views/_events.tpl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Time |
5 | Event Name |
6 | Times Called |
7 |
8 |
9 |
10 | {events}
11 |
12 | { duration } ms |
13 | {event} |
14 | {count} |
15 |
16 | {/events}
17 |
18 |
19 |
--------------------------------------------------------------------------------
/system/Debug/Toolbar/Views/_files.tpl:
--------------------------------------------------------------------------------
1 |
2 |
3 | {userFiles}
4 |
5 | {name} |
6 | {path} |
7 |
8 | {/userFiles}
9 | {coreFiles}
10 |
11 | {name} |
12 | {path} |
13 |
14 | {/coreFiles}
15 |
16 |
17 |
--------------------------------------------------------------------------------
/system/Debug/Toolbar/Views/_history.tpl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Action |
5 | Datetime |
6 | Status |
7 | Method |
8 | URL |
9 | Content-Type |
10 | Is AJAX? |
11 |
12 |
13 |
14 | {files}
15 |
16 |
17 |
18 | |
19 | {datetime} |
20 | {status} |
21 | {method} |
22 | {url} |
23 | {contentType} |
24 | {isAJAX} |
25 |
26 | {/files}
27 |
28 |
29 |
--------------------------------------------------------------------------------
/system/Debug/Toolbar/Views/_logs.tpl:
--------------------------------------------------------------------------------
1 | { if $logs == [] }
2 | Nothing was logged. If you were expecting logged items, ensure that LoggerConfig file has the correct threshold set.
3 | { else }
4 |
5 |
6 |
7 | Severity |
8 | Message |
9 |
10 |
11 |
12 | {logs}
13 |
14 | {level} |
15 | {msg} |
16 |
17 | {/logs}
18 |
19 |
20 | { endif }
21 |
--------------------------------------------------------------------------------
/system/Debug/Toolbar/Views/_routes.tpl:
--------------------------------------------------------------------------------
1 | Matched Route
2 |
3 |
4 |
5 | {matchedRoute}
6 |
7 | Directory: |
8 | {directory} |
9 |
10 |
11 | Controller: |
12 | {controller} |
13 |
14 |
15 | Method: |
16 | {method} |
17 |
18 |
19 | Params: |
20 | {paramCount} / {truePCount} |
21 |
22 | {params}
23 |
24 | {name} |
25 | {value} |
26 |
27 | {/params}
28 | {/matchedRoute}
29 |
30 |
31 |
32 |
33 | Defined Routes
34 |
35 |
36 |
37 |
38 | Method |
39 | Route |
40 | Handler |
41 |
42 |
43 |
44 | {routes}
45 |
46 | {method} |
47 | {route} |
48 | {handler} |
49 |
50 | {/routes}
51 |
52 |
53 |
--------------------------------------------------------------------------------
/system/Encryption/EncrypterInterface.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Encryption;
13 |
14 | use CodeIgniter\Encryption\Exceptions\EncryptionException;
15 |
16 | /**
17 | * CodeIgniter Encryption Handler
18 | *
19 | * Provides two-way keyed encryption
20 | */
21 | interface EncrypterInterface
22 | {
23 | /**
24 | * Encrypt - convert plaintext into ciphertext
25 | *
26 | * @param string $data Input data
27 | * @param array|string|null $params Overridden parameters, specifically the key
28 | *
29 | * @throws EncryptionException
30 | *
31 | * @return string
32 | */
33 | public function encrypt($data, $params = null);
34 |
35 | /**
36 | * Decrypt - convert ciphertext into plaintext
37 | *
38 | * @param string $data Encrypted data
39 | * @param array|string|null $params Overridden parameters, specifically the key
40 | *
41 | * @throws EncryptionException
42 | *
43 | * @return string
44 | */
45 | public function decrypt($data, $params = null);
46 | }
47 |
--------------------------------------------------------------------------------
/system/Exceptions/AlertError.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Exceptions;
13 |
14 | use Error;
15 |
16 | /**
17 | * Error: Action must be taken immediately (system/db down, etc)
18 | */
19 | class AlertError extends Error
20 | {
21 | }
22 |
--------------------------------------------------------------------------------
/system/Exceptions/CastException.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Exceptions;
13 |
14 | /**
15 | * Cast Exceptions.
16 | */
17 | class CastException extends CriticalError
18 | {
19 | use DebugTraceableTrait;
20 |
21 | /**
22 | * Error code
23 | *
24 | * @var integer
25 | */
26 | protected $code = 3;
27 |
28 | public static function forInvalidJsonFormatException(int $error)
29 | {
30 | switch($error)
31 | {
32 | case JSON_ERROR_DEPTH:
33 | return new static(lang('Cast.jsonErrorDepth'));
34 | case JSON_ERROR_STATE_MISMATCH:
35 | return new static(lang('Cast.jsonErrorStateMismatch'));
36 | case JSON_ERROR_CTRL_CHAR:
37 | return new static(lang('Cast.jsonErrorCtrlChar'));
38 | case JSON_ERROR_SYNTAX:
39 | return new static(lang('Cast.jsonErrorSyntax'));
40 | case JSON_ERROR_UTF8:
41 | return new static(lang('Cast.jsonErrorUtf8'));
42 | default:
43 | return new static(lang('Cast.jsonErrorUnknown'));
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/system/Exceptions/ConfigException.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Exceptions;
13 |
14 | /**
15 | * Exception for automatic logging.
16 | */
17 | class ConfigException extends CriticalError
18 | {
19 | use DebugTraceableTrait;
20 |
21 | /**
22 | * Error code
23 | *
24 | * @var integer
25 | */
26 | protected $code = 3;
27 |
28 | public static function forDisabledMigrations()
29 | {
30 | return new static(lang('Migrations.disabled'));
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/system/Exceptions/CriticalError.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Exceptions;
13 |
14 | use Error;
15 |
16 | /**
17 | * Error: Critical conditions, like component unavailable, etc.
18 | */
19 | class CriticalError extends Error
20 | {
21 | }
22 |
--------------------------------------------------------------------------------
/system/Exceptions/DebugTraceableTrait.php:
--------------------------------------------------------------------------------
1 | getTrace()[0];
28 |
29 | if (isset($trace['class']) && $trace['class'] === static::class)
30 | {
31 | ['line' => $this->line, 'file' => $this->file] = $trace;
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/system/Exceptions/DownloadException.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Exceptions;
13 |
14 | use RuntimeException;
15 |
16 | /**
17 | * Class DownloadException
18 | */
19 | class DownloadException extends RuntimeException implements ExceptionInterface
20 | {
21 | use DebugTraceableTrait;
22 |
23 | public static function forCannotSetFilePath(string $path)
24 | {
25 | return new static(lang('HTTP.cannotSetFilepath', [$path]));
26 | }
27 |
28 | public static function forCannotSetBinary()
29 | {
30 | return new static(lang('HTTP.cannotSetBinary'));
31 | }
32 |
33 | public static function forNotFoundDownloadSource()
34 | {
35 | return new static(lang('HTTP.notFoundDownloadSource'));
36 | }
37 |
38 | public static function forCannotSetCache()
39 | {
40 | return new static(lang('HTTP.cannotSetCache'));
41 | }
42 |
43 | public static function forCannotSetStatusCode(int $code, string $reason)
44 | {
45 | return new static(lang('HTTP.cannotSetStatusCode', [$code, $reason]));
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/system/Exceptions/EmergencyError.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Exceptions;
13 |
14 | use Error;
15 |
16 | /**
17 | * Error: system is unusable
18 | */
19 | class EmergencyError extends Error
20 | {
21 | }
22 |
--------------------------------------------------------------------------------
/system/Exceptions/ExceptionInterface.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Exceptions;
13 |
14 | /**
15 | * Provides a domain-level interface for broad capture
16 | * of all framework-related exceptions.
17 | *
18 | * catch (\CodeIgniter\Exceptions\ExceptionInterface) { ... }
19 | */
20 |
21 | interface ExceptionInterface
22 | {
23 | }
24 |
--------------------------------------------------------------------------------
/system/Exceptions/FrameworkException.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Exceptions;
13 |
14 | use RuntimeException;
15 |
16 | /**
17 | * Class FrameworkException
18 | *
19 | * A collection of exceptions thrown by the framework
20 | * that can only be determined at run time.
21 | */
22 | class FrameworkException extends RuntimeException implements ExceptionInterface
23 | {
24 | use DebugTraceableTrait;
25 |
26 | public static function forEnabledZlibOutputCompression()
27 | {
28 | return new static(lang('Core.enabledZlibOutputCompression'));
29 | }
30 |
31 | public static function forInvalidFile(string $path)
32 | {
33 | return new static(lang('Core.invalidFile', [$path]));
34 | }
35 |
36 | public static function forCopyError(string $path)
37 | {
38 | return new static(lang('Core.copyError', [$path]));
39 | }
40 |
41 | public static function forMissingExtension(string $extension)
42 | {
43 | return new static(lang('Core.missingExtension', [$extension]));
44 | }
45 |
46 | public static function forNoHandlers(string $class)
47 | {
48 | return new static(lang('Core.noHandlers', [$class]));
49 | }
50 |
51 | public static function forFabricatorCreateFailed(string $table, string $reason)
52 | {
53 | return new static(lang('Fabricator.createFailed', [$table, $reason]));
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/system/Exceptions/ModelException.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Exceptions;
13 |
14 | /**
15 | * Model Exceptions.
16 | */
17 |
18 | class ModelException extends FrameworkException
19 | {
20 | public static function forNoPrimaryKey(string $modelName)
21 | {
22 | return new static(lang('Database.noPrimaryKey', [$modelName]));
23 | }
24 |
25 | public static function forNoDateFormat(string $modelName)
26 | {
27 | return new static(lang('Database.noDateFormat', [$modelName]));
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/system/Exceptions/PageNotFoundException.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Exceptions;
13 |
14 | use OutOfBoundsException;
15 |
16 | class PageNotFoundException extends OutOfBoundsException implements ExceptionInterface
17 | {
18 | use DebugTraceableTrait;
19 |
20 | /**
21 | * Error code
22 | *
23 | * @var integer
24 | */
25 | protected $code = 404;
26 |
27 | public static function forPageNotFound(string $message = null)
28 | {
29 | return new static($message ?? lang('HTTP.pageNotFound'));
30 | }
31 |
32 | public static function forEmptyController()
33 | {
34 | return new static(lang('HTTP.emptyController'));
35 | }
36 |
37 | public static function forControllerNotFound(string $controller, string $method)
38 | {
39 | return new static(lang('HTTP.controllerNotFound', [$controller, $method]));
40 | }
41 |
42 | public static function forMethodNotFound(string $method)
43 | {
44 | return new static(lang('HTTP.methodNotFound', [$method]));
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/system/Files/Exceptions/FileException.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Files\Exceptions;
13 |
14 | use CodeIgniter\Exceptions\DebugTraceableTrait;
15 | use CodeIgniter\Exceptions\ExceptionInterface;
16 | use RuntimeException;
17 |
18 | class FileException extends RuntimeException implements ExceptionInterface
19 | {
20 | use DebugTraceableTrait;
21 |
22 | public static function forUnableToMove(string $from = null, string $to = null, string $error = null)
23 | {
24 | return new static(lang('Files.cannotMove', [$from, $to, $error]));
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/system/Files/Exceptions/FileNotFoundException.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Files\Exceptions;
13 |
14 | use CodeIgniter\Exceptions\DebugTraceableTrait;
15 | use CodeIgniter\Exceptions\ExceptionInterface;
16 | use RuntimeException;
17 |
18 | class FileNotFoundException extends RuntimeException implements ExceptionInterface
19 | {
20 | use DebugTraceableTrait;
21 |
22 | public static function forFileNotFound(string $path)
23 | {
24 | return new static(lang('Files.fileNotFound', [$path]));
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/system/Filters/DebugToolbar.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Filters;
13 |
14 | use CodeIgniter\HTTP\IncomingRequest;
15 | use CodeIgniter\HTTP\RequestInterface;
16 | use CodeIgniter\HTTP\Response;
17 | use CodeIgniter\HTTP\ResponseInterface;
18 | use Config\Services;
19 |
20 | /**
21 | * Debug toolbar filter
22 | */
23 | class DebugToolbar implements FilterInterface
24 | {
25 | /**
26 | * We don't need to do anything here.
27 | *
28 | * @param RequestInterface|IncomingRequest $request
29 | * @param array|null $arguments
30 | *
31 | * @return void
32 | */
33 | public function before(RequestInterface $request, $arguments = null)
34 | {
35 | }
36 |
37 | //--------------------------------------------------------------------
38 |
39 | /**
40 | * If the debug flag is set (CI_DEBUG) then collect performance
41 | * and debug information and display it in a toolbar.
42 | *
43 | * @param RequestInterface|IncomingRequest $request
44 | * @param ResponseInterface|Response $response
45 | * @param array|null $arguments
46 | *
47 | * @return void
48 | */
49 | public function after(RequestInterface $request, ResponseInterface $response, $arguments = null)
50 | {
51 | Services::toolbar()->prepare($request, $response);
52 | }
53 |
54 | //--------------------------------------------------------------------
55 | }
56 |
--------------------------------------------------------------------------------
/system/Filters/Exceptions/FilterException.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Filters\Exceptions;
13 |
14 | use CodeIgniter\Exceptions\ConfigException;
15 | use CodeIgniter\Exceptions\ExceptionInterface;
16 |
17 | /**
18 | * FilterException
19 | */
20 | class FilterException extends ConfigException implements ExceptionInterface
21 | {
22 | /**
23 | * Thrown when the provided alias is not within
24 | * the list of configured filter aliases.
25 | *
26 | * @param string $alias
27 | *
28 | * @return static
29 | */
30 | public static function forNoAlias(string $alias)
31 | {
32 | return new static(lang('Filters.noFilter', [$alias]));
33 | }
34 |
35 | /**
36 | * Thrown when the filter class does not implement FilterInterface.
37 | *
38 | * @param string $class
39 | *
40 | * @return static
41 | */
42 | public static function forIncorrectInterface(string $class)
43 | {
44 | return new static(lang('Filters.incorrectInterface', [$class]));
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/system/Filters/FilterInterface.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Filters;
13 |
14 | use CodeIgniter\HTTP\RequestInterface;
15 | use CodeIgniter\HTTP\ResponseInterface;
16 |
17 | /**
18 | * Filter interface
19 | */
20 | interface FilterInterface
21 | {
22 | /**
23 | * Do whatever processing this filter needs to do.
24 | * By default it should not return anything during
25 | * normal execution. However, when an abnormal state
26 | * is found, it should return an instance of
27 | * CodeIgniter\HTTP\Response. If it does, script
28 | * execution will end and that Response will be
29 | * sent back to the client, allowing for error pages,
30 | * redirects, etc.
31 | *
32 | * @param RequestInterface $request
33 | * @param null $arguments
34 | *
35 | * @return mixed
36 | */
37 | public function before(RequestInterface $request, $arguments = null);
38 |
39 | //--------------------------------------------------------------------
40 |
41 | /**
42 | * Allows After filters to inspect and modify the response
43 | * object as needed. This method does not allow any way
44 | * to stop execution of other after filters, short of
45 | * throwing an Exception or Error.
46 | *
47 | * @param RequestInterface $request
48 | * @param ResponseInterface $response
49 | * @param null $arguments
50 | *
51 | * @return mixed
52 | */
53 | public function after(RequestInterface $request, ResponseInterface $response, $arguments = null);
54 |
55 | //--------------------------------------------------------------------
56 | }
57 |
--------------------------------------------------------------------------------
/system/Filters/Honeypot.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Filters;
13 |
14 | use CodeIgniter\Honeypot\Exceptions\HoneypotException;
15 | use CodeIgniter\HTTP\RequestInterface;
16 | use CodeIgniter\HTTP\ResponseInterface;
17 | use Config\Services;
18 |
19 | /**
20 | * Honeypot filter
21 | */
22 | class Honeypot implements FilterInterface
23 | {
24 | /**
25 | * Checks if Honeypot field is empty; if not
26 | * then the requester is a bot
27 | *
28 | * @param RequestInterface $request
29 | * @param array|null $arguments
30 | *
31 | * @return void
32 | */
33 | public function before(RequestInterface $request, $arguments = null)
34 | {
35 | $honeypot = Services::honeypot(new \Config\Honeypot());
36 | if ($honeypot->hasContent($request))
37 | {
38 | throw HoneypotException::isBot();
39 | }
40 | }
41 |
42 | /**
43 | * Attach a honeypot to the current response.
44 | *
45 | * @param RequestInterface $request
46 | * @param ResponseInterface $response
47 | * @param array|null $arguments
48 | *
49 | * @return void
50 | */
51 | public function after(RequestInterface $request, ResponseInterface $response, $arguments = null)
52 | {
53 | $honeypot = Services::honeypot(new \Config\Honeypot());
54 | $honeypot->attachHoneypot($response);
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/system/Format/Format.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Format;
13 |
14 | use CodeIgniter\Format\Exceptions\FormatException;
15 | use Config\Format as FormatConfig;
16 |
17 | /**
18 | * The Format class is a convenient place to create Formatters.
19 | */
20 | class Format
21 | {
22 | /**
23 | * Configuration instance
24 | *
25 | * @var FormatConfig
26 | */
27 | protected $config;
28 |
29 | /**
30 | * Constructor.
31 | *
32 | * @param FormatConfig $config
33 | */
34 | public function __construct(FormatConfig $config)
35 | {
36 | $this->config = $config;
37 | }
38 |
39 | /**
40 | * Returns the current configuration instance.
41 | *
42 | * @return FormatConfig
43 | */
44 | public function getConfig()
45 | {
46 | return $this->config;
47 | }
48 |
49 | /**
50 | * A Factory method to return the appropriate formatter for the given mime type.
51 | *
52 | * @param string $mime
53 | *
54 | * @throws FormatException
55 | *
56 | * @return FormatterInterface
57 | */
58 | public function getFormatter(string $mime): FormatterInterface
59 | {
60 | if (! array_key_exists($mime, $this->config->formatters))
61 | {
62 | throw FormatException::forInvalidMime($mime);
63 | }
64 |
65 | $className = $this->config->formatters[$mime];
66 |
67 | if (! class_exists($className))
68 | {
69 | throw FormatException::forInvalidFormatter($className);
70 | }
71 |
72 | $class = new $className();
73 |
74 | if (! $class instanceof FormatterInterface)
75 | {
76 | throw FormatException::forInvalidFormatter($className);
77 | }
78 |
79 | return $class;
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/system/Format/FormatterInterface.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Format;
13 |
14 | /**
15 | * Formatter interface
16 | */
17 | interface FormatterInterface
18 | {
19 | /**
20 | * Takes the given data and formats it.
21 | *
22 | * @param string|array $data
23 | *
24 | * @return mixed
25 | */
26 | public function format($data);
27 | }
28 |
--------------------------------------------------------------------------------
/system/Format/JSONFormatter.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Format;
13 |
14 | use CodeIgniter\Format\Exceptions\FormatException;
15 | use Config\Format;
16 |
17 | /**
18 | * JSON data formatter
19 | */
20 | class JSONFormatter implements FormatterInterface
21 | {
22 | /**
23 | * Takes the given data and formats it.
24 | *
25 | * @param mixed $data
26 | *
27 | * @return string|boolean (JSON string | false)
28 | */
29 | public function format($data)
30 | {
31 | $config = new Format();
32 |
33 | $options = $config->formatterOptions['application/json'] ?? JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES;
34 | $options = $options | JSON_PARTIAL_OUTPUT_ON_ERROR;
35 |
36 | $options = ENVIRONMENT === 'production' ? $options : $options | JSON_PRETTY_PRINT;
37 |
38 | $result = json_encode($data, $options, 512);
39 |
40 | if (! in_array(json_last_error(), [JSON_ERROR_NONE, JSON_ERROR_RECURSION], true))
41 | {
42 | throw FormatException::forInvalidJSON(json_last_error_msg());
43 | }
44 |
45 | return $result;
46 | }
47 |
48 | //--------------------------------------------------------------------
49 | }
50 |
--------------------------------------------------------------------------------
/system/Helpers/security_helper.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | use Config\Services;
13 |
14 | /**
15 | * CodeIgniter Security Helpers
16 | */
17 |
18 | if (! function_exists('sanitize_filename'))
19 | {
20 | /**
21 | * Sanitize a filename to use in a URI.
22 | *
23 | * @param string $filename
24 | *
25 | * @return string
26 | */
27 | function sanitize_filename(string $filename): string
28 | {
29 | return Services::security()->sanitizeFilename($filename);
30 | }
31 | }
32 |
33 | //--------------------------------------------------------------------
34 |
35 | if (! function_exists('strip_image_tags'))
36 | {
37 | /**
38 | * Strip Image Tags
39 | *
40 | * @param string $str
41 | *
42 | * @return string
43 | */
44 | function strip_image_tags(string $str): string
45 | {
46 | return preg_replace([
47 | '#
#i',
48 | '#
`]+)).*?\>#i',
49 | ], '\\2', $str
50 | );
51 | }
52 | }
53 |
54 | //--------------------------------------------------------------------
55 |
56 | if (! function_exists('encode_php_tags'))
57 | {
58 | /**
59 | * Convert PHP tags to entities
60 | *
61 | * @param string $str
62 | *
63 | * @return string
64 | */
65 | function encode_php_tags(string $str): string
66 | {
67 | return str_replace(['', '?>'], ['<?', '?>'], $str);
68 | }
69 | }
70 |
71 | //--------------------------------------------------------------------
72 |
--------------------------------------------------------------------------------
/system/Helpers/test_helper.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | use CodeIgniter\Test\Fabricator;
13 |
14 | /**
15 | * CodeIgniter Test Helpers
16 | */
17 | //--------------------------------------------------------------------
18 |
19 | if (! function_exists('fake'))
20 | {
21 | /**
22 | * Creates a single item using Fabricator.
23 | *
24 | * @param Model|object|string $model Instance or name of the model
25 | * @param array|null $overrides Overriding data to pass to Fabricator::setOverrides()
26 | *
27 | * @return object|array
28 | */
29 | function fake($model, array $overrides = null)
30 | {
31 | // Get a model-appropriate Fabricator instance
32 | $fabricator = new Fabricator($model);
33 |
34 | // Set overriding data, if necessary
35 | if ($overrides)
36 | {
37 | $fabricator->setOverrides($overrides);
38 | }
39 |
40 | return $fabricator->create();
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/system/Helpers/xml_helper.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | /**
13 | * CodeIgniter XML Helpers
14 | */
15 |
16 | if (! function_exists('xml_convert'))
17 | {
18 | /**
19 | * Convert Reserved XML characters to Entities
20 | *
21 | * @param string $str
22 | * @param boolean $protectAll
23 | * @return string
24 | */
25 | function xml_convert(string $str, bool $protectAll = false): string
26 | {
27 | $temp = '__TEMP_AMPERSANDS__';
28 |
29 | // Replace entities to temporary markers so that
30 | // ampersands won't get messed up
31 | $str = preg_replace('/(\d+);/', $temp . '\\1;', $str);
32 |
33 | if ($protectAll === true)
34 | {
35 | $str = preg_replace('/&(\w+);/', $temp . '\\1;', $str);
36 | }
37 |
38 | $original = [
39 | '&',
40 | '<',
41 | '>',
42 | '"',
43 | "'",
44 | '-',
45 | ];
46 |
47 | $replacement = [
48 | '&',
49 | '<',
50 | '>',
51 | '"',
52 | ''',
53 | '-',
54 | ];
55 |
56 | $str = str_replace($original, $replacement, $str);
57 |
58 | // Decode the temp markers back to entities
59 | $str = preg_replace('/' . $temp . '(\d+);/', '\\1;', $str);
60 |
61 | if ($protectAll === true)
62 | {
63 | return preg_replace('/' . $temp . '(\w+);/', '&\\1;', $str);
64 | }
65 |
66 | return $str;
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/system/Honeypot/Exceptions/HoneypotException.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Honeypot\Exceptions;
13 |
14 | use CodeIgniter\Exceptions\ConfigException;
15 | use CodeIgniter\Exceptions\ExceptionInterface;
16 |
17 | class HoneypotException extends ConfigException implements ExceptionInterface
18 | {
19 | public static function forNoTemplate()
20 | {
21 | return new static(lang('Honeypot.noTemplate'));
22 | }
23 |
24 | public static function forNoNameField()
25 | {
26 | return new static(lang('Honeypot.noNameField'));
27 | }
28 |
29 | public static function forNoHiddenValue()
30 | {
31 | return new static(lang('Honeypot.noHiddenValue'));
32 | }
33 |
34 | public static function isBot()
35 | {
36 | return new static(lang('Honeypot.theClientIsABot'));
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/system/Images/Exceptions/ImageException.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Images\Exceptions;
13 |
14 | use CodeIgniter\Exceptions\ExceptionInterface;
15 | use CodeIgniter\Exceptions\FrameworkException;
16 |
17 | class ImageException extends FrameworkException implements ExceptionInterface
18 | {
19 | public static function forMissingImage()
20 | {
21 | return new static(lang('Images.sourceImageRequired'));
22 | }
23 |
24 | public static function forFileNotSupported()
25 | {
26 | return new static(lang('Images.fileNotSupported'));
27 | }
28 |
29 | public static function forMissingAngle()
30 | {
31 | return new static(lang('Images.rotationAngleRequired'));
32 | }
33 |
34 | public static function forInvalidDirection(string $dir = null)
35 | {
36 | return new static(lang('Images.invalidDirection', [$dir]));
37 | }
38 |
39 | public static function forInvalidPath()
40 | {
41 | return new static(lang('Images.invalidPath'));
42 | }
43 |
44 | public static function forEXIFUnsupported()
45 | {
46 | return new static(lang('Images.exifNotSupported'));
47 | }
48 |
49 | public static function forInvalidImageCreate(string $extra = null)
50 | {
51 | return new static(lang('Images.unsupportedImageCreate') . ' ' . $extra);
52 | }
53 |
54 | public static function forSaveFailed()
55 | {
56 | return new static(lang('Images.saveFailed'));
57 | }
58 |
59 | public static function forInvalidImageLibraryPath(string $path = null)
60 | {
61 | return new static(lang('Images.libPathInvalid', [$path]));
62 | }
63 |
64 | public static function forImageProcessFailed()
65 | {
66 | return new static(lang('Images.imageProcessFailed'));
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/system/Language/en/CLI.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | // CLI language settings
13 | return [
14 | 'altCommandPlural' => 'Did you mean one of these?',
15 | 'altCommandSingular' => 'Did you mean this?',
16 | 'commandNotFound' => 'Command "{0}" not found.',
17 | 'generator' => [
18 | 'cancelOperation' => 'Operation has been cancelled.',
19 | 'className' => 'Class name',
20 | 'commandType' => 'Command type',
21 | 'databaseGroup' => 'Database group',
22 | 'fileCreate' => 'File created: {0}',
23 | 'fileError' => 'Error while creating file: {0}',
24 | 'fileExist' => 'File exists: {0}',
25 | 'fileOverwrite' => 'File overwritten: {0}',
26 | 'parentClass' => 'Parent class',
27 | 'returnType' => 'Return type',
28 | 'tableName' => 'Table name',
29 | 'usingCINamespace' => 'Warning: Using the "CodeIgniter" namespace will generate the file in the system directory.'
30 | ],
31 | 'helpArguments' => 'Arguments:',
32 | 'helpDescription' => 'Description:',
33 | 'helpOptions' => 'Options:',
34 | 'helpUsage' => 'Usage:',
35 | 'invalidColor' => 'Invalid {0} color: {1}.',
36 | 'namespaceNotDefined' => 'Namespace "{0}" is not defined.',
37 | ];
38 |
--------------------------------------------------------------------------------
/system/Language/en/Cache.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | // Cache language settings
13 | return [
14 | 'unableToWrite' => 'Cache unable to write to {0}',
15 | 'invalidHandlers' => 'Cache config must have an array of $validHandlers.',
16 | 'noBackup' => 'Cache config must have a handler and backupHandler set.',
17 | 'handlerNotFound' => 'Cache config has an invalid handler or backup handler specified.',
18 | ];
19 |
--------------------------------------------------------------------------------
/system/Language/en/Cast.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | // Cast language settings
13 | return [
14 | 'jsonErrorDepth' => 'Maximum stack depth exceeded',
15 | 'jsonErrorStateMismatch' => 'Underflow or the modes mismatch',
16 | 'jsonErrorCtrlChar' => 'Unexpected control character found',
17 | 'jsonErrorSyntax' => 'Syntax error, malformed JSON',
18 | 'jsonErrorUtf8' => 'Malformed UTF-8 characters, possibly incorrectly encoded',
19 | 'jsonErrorUnknown' => 'Unknown error',
20 | ];
21 |
--------------------------------------------------------------------------------
/system/Language/en/Core.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | // Core language settings
13 | return [
14 | 'copyError' => 'An error was encountered while attempting to replace the file ({0}). Please make sure your file directory is writable.',
15 | 'enabledZlibOutputCompression' => 'Your zlib.output_compression ini directive is turned on. This will not work well with output buffers.',
16 | 'invalidFile' => 'Invalid file: {0}',
17 | 'missingExtension' => 'The framework needs the following extension(s) installed and loaded: {0}.',
18 | 'noHandlers' => '{0} must provide at least one Handler.',
19 | ];
20 |
--------------------------------------------------------------------------------
/system/Language/en/Database.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | // Database language settings
13 | return [
14 | 'invalidEvent' => '{0} is not a valid Model Event callback.',
15 | 'invalidArgument' => 'You must provide a valid {0}.',
16 | 'invalidAllowedFields' => 'Allowed fields must be specified for model: {0}',
17 | 'emptyDataset' => 'There is no data to {0}.',
18 | 'emptyPrimaryKey' => 'There is no primary key defined when trying to make {0}.',
19 | 'failGetFieldData' => 'Failed to get field data from database.',
20 | 'failGetIndexData' => 'Failed to get index data from database.',
21 | 'failGetForeignKeyData' => 'Failed to get foreign key data from database.',
22 | 'parseStringFail' => 'Parsing key string failed.',
23 | 'featureUnavailable' => 'This feature is not available for the database you are using.',
24 | 'tableNotFound' => 'Table `{0}` was not found in the current database.',
25 | 'noPrimaryKey' => '`{0}` model class does not specify a Primary Key.',
26 | 'noDateFormat' => '`{0}` model class does not have a valid dateFormat.',
27 | 'fieldNotExists' => 'Field `{0}` not found.',
28 | 'forEmptyInputGiven' => 'Empty statement is given for the field `{0}`',
29 | 'forFindColumnHaveMultipleColumns' => 'Only single column allowed in Column name.',
30 | ];
31 |
--------------------------------------------------------------------------------
/system/Language/en/Encryption.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | // Encryption language settings
13 | return [
14 | 'noDriverRequested' => 'No driver requested; Miss Daisy will be so upset!',
15 | 'noHandlerAvailable' => 'Unable to find an available {0} encryption handler.',
16 | 'unKnownHandler' => '"{0}" cannot be configured.',
17 | 'starterKeyNeeded' => 'Encrypter needs a starter key.',
18 | 'authenticationFailed' => 'Decrypting: authentication failed.',
19 | 'encryptionFailed' => 'Encryption failed.',
20 | ];
21 |
--------------------------------------------------------------------------------
/system/Language/en/Fabricator.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | // Fabricator language settings
13 | return [
14 | 'invalidModel' => 'Invalid model supplied for fabrication.',
15 | 'missingFormatters' => 'No valid formatters defined.',
16 | 'createFailed' => 'Fabricator failed to insert on table {0}: {1}.',
17 | ];
18 |
--------------------------------------------------------------------------------
/system/Language/en/Files.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | // Files language settings
13 | return [
14 | 'fileNotFound' => 'File not found: {0}',
15 | 'cannotMove' => 'Could not move file {0} to {1} ({2})',
16 | ];
17 |
--------------------------------------------------------------------------------
/system/Language/en/Filters.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | // Filters language settings
13 | return [
14 | 'noFilter' => '{0} filter must have a matching alias defined.',
15 | 'incorrectInterface' => '{0} must implement CodeIgniter\Filters\FilterInterface.',
16 | ];
17 |
--------------------------------------------------------------------------------
/system/Language/en/Format.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | // Format language settings
13 | return [
14 | 'invalidFormatter' => '"{0}" is not a valid Formatter class.',
15 | 'invalidJSON' => 'Failed to parse json string, error: "{0}".',
16 | 'invalidMime' => 'No Formatter defined for mime type: "{0}".',
17 | 'missingExtension' => 'The SimpleXML extension is required to format XML.',
18 | ];
19 |
--------------------------------------------------------------------------------
/system/Language/en/Log.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | // Log language settings
13 | return [
14 | 'invalidLogLevel' => '{0} is an invalid log level.',
15 | ];
16 |
--------------------------------------------------------------------------------
/system/Language/en/Number.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | // Number language settings
13 | return [
14 | 'terabyteAbbr' => 'TB',
15 | 'gigabyteAbbr' => 'GB',
16 | 'megabyteAbbr' => 'MB',
17 | 'kilobyteAbbr' => 'KB',
18 | 'bytes' => 'Bytes',
19 |
20 | // don't forget the space in front of these!
21 | 'thousand' => ' thousand',
22 | 'million' => ' million',
23 | 'billion' => ' billion',
24 | 'trillion' => ' trillion',
25 | 'quadrillion' => ' quadrillion',
26 | ];
27 |
--------------------------------------------------------------------------------
/system/Language/en/Pager.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | // Pager language settings
13 | return [
14 | 'pageNavigation' => 'Page navigation',
15 | 'first' => 'First',
16 | 'previous' => 'Previous',
17 | 'next' => 'Next',
18 | 'last' => 'Last',
19 | 'older' => 'Older',
20 | 'newer' => 'Newer',
21 | 'invalidTemplate' => '{0} is not a valid Pager template.',
22 | 'invalidPaginationGroup' => '{0} is not a valid Pagination group.',
23 | ];
24 |
--------------------------------------------------------------------------------
/system/Language/en/RESTful.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | // RESTful language settings
13 | return [
14 | 'notImplemented' => '"{0}" action not implemented.',
15 | ];
16 |
--------------------------------------------------------------------------------
/system/Language/en/Router.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | // Router language settings
13 | return [
14 | 'invalidParameter' => 'A parameter does not match the expected type.',
15 | 'missingDefaultRoute' => 'Unable to determine what should be displayed. A default route has not been specified in the routing file.',
16 | ];
17 |
--------------------------------------------------------------------------------
/system/Language/en/Security.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | // Security language settings
13 | return [
14 | 'disallowedAction' => 'The action you requested is not allowed.',
15 | 'invalidSameSite' => 'The SameSite value must be None, Lax, Strict, or a blank string. Given: {0}',
16 | ];
17 |
--------------------------------------------------------------------------------
/system/Language/en/Session.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | // Session language settings
13 | return [
14 | 'missingDatabaseTable' => '`sessionSavePath` must have the table name for the Database Session Handler to work.',
15 | 'invalidSavePath' => 'Session: Configured save path "{0}" is not a directory, does not exist or cannot be created.',
16 | 'writeProtectedSavePath' => 'Session: Configured save path "{0}" is not writable by the PHP process.',
17 | 'emptySavePath' => 'Session: No save path configured.',
18 | 'invalidSavePathFormat' => 'Session: Invalid Redis save path format: {0}',
19 | 'invalidSameSiteSetting' => 'Session: The SameSite setting must be None, Lax, Strict, or a blank string. Given: {0}',
20 | ];
21 |
--------------------------------------------------------------------------------
/system/Language/en/Time.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | // Time language settings
13 | return [
14 | 'invalidFormat' => '"{0}" is not a valid datetime format',
15 | 'invalidMonth' => 'Months must be between 1 and 12. Given: {0}',
16 | 'invalidDay' => 'Days must be between 1 and 31. Given: {0}',
17 | 'invalidOverDay' => 'Days must be between 1 and {0}. Given: {1}',
18 | 'invalidHours' => 'Hours must be between 0 and 23. Given: {0}',
19 | 'invalidMinutes' => 'Minutes must be between 0 and 59. Given: {0}',
20 | 'invalidSeconds' => 'Seconds must be between 0 and 59. Given: {0}',
21 | 'years' => '{0, plural, =1{# year} other{# years}}',
22 | 'months' => '{0, plural, =1{# month} other{# months}}',
23 | 'weeks' => '{0, plural, =1{# week} other{# weeks}}',
24 | 'days' => '{0, plural, =1{# day} other{# days}}',
25 | 'hours' => '{0, plural, =1{# hour} other{# hours}}',
26 | 'minutes' => '{0, plural, =1{# minute} other{# minutes}}',
27 | 'seconds' => '{0, plural, =1{# second} other{# seconds}}',
28 | 'ago' => '{0} ago',
29 | 'inFuture' => 'in {0}',
30 | 'yesterday' => 'Yesterday',
31 | 'tomorrow' => 'Tomorrow',
32 | 'now' => 'Just now',
33 | ];
34 |
--------------------------------------------------------------------------------
/system/Language/en/View.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | // View language settings
13 | return [
14 | 'invalidCellMethod' => '{class}::{method} is not a valid method.',
15 | 'missingCellParameters' => '{class}::{method} has no params.',
16 | 'invalidCellParameter' => '{0} is not a valid param name.',
17 | 'noCellClass' => 'No view cell class provided.',
18 | 'invalidCellClass' => 'Unable to locate view cell class: {0}.',
19 | 'tagSyntaxError' => 'You have a syntax error in your Parser tags: {0}',
20 | ];
21 |
--------------------------------------------------------------------------------
/system/Log/Exceptions/LogException.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Log\Exceptions;
13 |
14 | use CodeIgniter\Exceptions\FrameworkException;
15 |
16 | class LogException extends FrameworkException
17 | {
18 | public static function forInvalidLogLevel(string $level)
19 | {
20 | return new static(lang('Log.invalidLogLevel', [$level]));
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/system/Log/Handlers/HandlerInterface.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Log\Handlers;
13 |
14 | /**
15 | * Expected behavior for a Log handler
16 | */
17 | interface HandlerInterface
18 | {
19 | /**
20 | * Handles logging the message.
21 | * If the handler returns false, then execution of handlers
22 | * will stop. Any handlers that have not run, yet, will not
23 | * be run.
24 | *
25 | * @param string $level
26 | * @param string $message
27 | *
28 | * @return boolean
29 | */
30 | public function handle($level, $message): bool;
31 |
32 | //--------------------------------------------------------------------
33 |
34 | /**
35 | * Checks whether the Handler will handle logging items of this
36 | * log Level.
37 | *
38 | * @param string $level
39 | *
40 | * @return boolean
41 | */
42 | public function canHandle(string $level): bool;
43 |
44 | //--------------------------------------------------------------------
45 |
46 | /**
47 | * Sets the preferred date format to use when logging.
48 | *
49 | * @param string $format
50 | *
51 | * @return HandlerInterface
52 | */
53 | public function setDateFormat(string $format);
54 |
55 | //--------------------------------------------------------------------
56 | }
57 |
--------------------------------------------------------------------------------
/system/Modules/Modules.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Modules;
13 |
14 | /**
15 | * Modules Class
16 | *
17 | * @link https://codeigniter.com/user_guide/general/modules.html
18 | */
19 | class Modules
20 | {
21 | /**
22 | * Auto-Discover
23 | *
24 | * @var boolean
25 | */
26 | public $enabled = true;
27 |
28 | /**
29 | * Auto-Discovery Within Composer Packages
30 | *
31 | * @var boolean
32 | */
33 | public $discoverInComposer = true;
34 |
35 | /**
36 | * Auto-Discover Rules Handler
37 | *
38 | * @var array
39 | */
40 | public $aliases = [];
41 |
42 | /**
43 | * Should the application auto-discover the requested resource.
44 | *
45 | * @param string $alias
46 | *
47 | * @return boolean
48 | */
49 | public function shouldDiscover(string $alias): bool
50 | {
51 | if (! $this->enabled)
52 | {
53 | return false;
54 | }
55 |
56 | return in_array(strtolower($alias), $this->aliases, true);
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/system/Pager/Exceptions/PagerException.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Pager\Exceptions;
13 |
14 | use CodeIgniter\Exceptions\FrameworkException;
15 |
16 | class PagerException extends FrameworkException
17 | {
18 | public static function forInvalidTemplate(string $template = null)
19 | {
20 | return new static(lang('Pager.invalidTemplate', [$template]));
21 | }
22 |
23 | public static function forInvalidPaginationGroup(string $group = null)
24 | {
25 | return new static(lang('Pager.invalidPaginationGroup', [$group]));
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/system/Pager/Views/default_full.php:
--------------------------------------------------------------------------------
1 | setSurroundCount(2);
9 | ?>
10 |
11 |
48 |
--------------------------------------------------------------------------------
/system/Pager/Views/default_head.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | use CodeIgniter\Pager\PagerRenderer;
13 |
14 | /**
15 | * @var PagerRenderer $pager
16 | */
17 | $pager->setSurroundCount(0);
18 |
19 | if ($pager->hasPrevious())
20 | {
21 | echo '' . PHP_EOL;
22 | }
23 |
24 | echo '' . PHP_EOL;
25 |
26 | if ($pager->hasNext())
27 | {
28 | echo '' . PHP_EOL;
29 | }
30 |
--------------------------------------------------------------------------------
/system/Pager/Views/default_simple.php:
--------------------------------------------------------------------------------
1 | setSurroundCount(0);
9 | ?>
10 |
24 |
--------------------------------------------------------------------------------
/system/Router/Exceptions/RedirectException.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Router\Exceptions;
13 |
14 | use Exception;
15 |
16 | /**
17 | * RedirectException
18 | */
19 | class RedirectException extends Exception
20 | {
21 | /**
22 | * Status code for redirects
23 | *
24 | * @var integer
25 | */
26 | protected $code = 302;
27 | }
28 |
--------------------------------------------------------------------------------
/system/Router/Exceptions/RouterException.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Router\Exceptions;
13 |
14 | use CodeIgniter\Exceptions\FrameworkException;
15 |
16 | /**
17 | * RouterException
18 | */
19 | class RouterException extends FrameworkException
20 | {
21 | /**
22 | * Thrown when the actual parameter type does not match
23 | * the expected types.
24 | *
25 | * @return RouterException
26 | */
27 | public static function forInvalidParameterType()
28 | {
29 | return new static(lang('Router.invalidParameterType'));
30 | }
31 |
32 | /**
33 | * Thrown when a default route is not set.
34 | *
35 | * @return RouterException
36 | */
37 | public static function forMissingDefaultRoute()
38 | {
39 | return new static(lang('Router.missingDefaultRoute'));
40 | }
41 |
42 | /**
43 | * Throw when controller or its method is not found.
44 | *
45 | * @param string $controller
46 | * @param string $method
47 | *
48 | * @return RouterException
49 | */
50 | public static function forControllerNotFound(string $controller, string $method)
51 | {
52 | return new static(lang('HTTP.controllerNotFound', [$controller, $method]));
53 | }
54 |
55 | /**
56 | * Throw when route is not valid.
57 | *
58 | * @param string $route
59 | *
60 | * @return RouterException
61 | */
62 | public static function forInvalidRoute(string $route)
63 | {
64 | return new static(lang('HTTP.invalidRoute', [$route]));
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/system/Security/Exceptions/SecurityException.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Security\Exceptions;
13 |
14 | use CodeIgniter\Exceptions\FrameworkException;
15 |
16 | class SecurityException extends FrameworkException
17 | {
18 | public static function forDisallowedAction()
19 | {
20 | return new static(lang('Security.disallowedAction'), 403);
21 | }
22 |
23 | public static function forInvalidSameSite(string $samesite)
24 | {
25 | return new static(lang('Security.invalidSameSite', [$samesite]));
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/system/Session/Exceptions/SessionException.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Session\Exceptions;
13 |
14 | use CodeIgniter\Exceptions\FrameworkException;
15 |
16 | class SessionException extends FrameworkException
17 | {
18 | public static function forMissingDatabaseTable()
19 | {
20 | return new static(lang('Session.missingDatabaseTable'));
21 | }
22 |
23 | public static function forInvalidSavePath(string $path = null)
24 | {
25 | return new static(lang('Session.invalidSavePath', [$path]));
26 | }
27 |
28 | public static function forWriteProtectedSavePath(string $path = null)
29 | {
30 | return new static(lang('Session.writeProtectedSavePath', [$path]));
31 | }
32 |
33 | public static function forEmptySavepath()
34 | {
35 | return new static(lang('Session.emptySavePath'));
36 | }
37 |
38 | public static function forInvalidSavePathFormat(string $path)
39 | {
40 | return new static(lang('Session.invalidSavePathFormat', [$path]));
41 | }
42 |
43 | public static function forInvalidSameSiteSetting(string $samesite)
44 | {
45 | return new static(lang('Session.invalidSameSiteSetting', [$samesite]));
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/system/Test/FeatureTestCase.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Test;
13 |
14 | use CodeIgniter\Router\RouteCollection;
15 |
16 | /**
17 | * Class FeatureTestCase
18 | *
19 | * Provides a base class with the trait for doing full HTTP testing
20 | * against your application.
21 | */
22 | class FeatureTestCase extends CIDatabaseTestCase
23 | {
24 | use FeatureTestTrait;
25 |
26 | /**
27 | * If present, will override application
28 | * routes when using call().
29 | *
30 | * @var RouteCollection
31 | */
32 | protected $routes;
33 |
34 | /**
35 | * Values to be set in the SESSION global
36 | * before running the test.
37 | *
38 | * @var array
39 | */
40 | protected $session = [];
41 |
42 | /**
43 | * Enabled auto clean op buffer after request call
44 | *
45 | * @var boolean
46 | */
47 | protected $clean = true;
48 |
49 | /**
50 | * Custom request's headers
51 | *
52 | * @var array
53 | */
54 | protected $headers = [];
55 |
56 | /**
57 | * Allows for formatting the request body to what
58 | * the controller is going to expect
59 | *
60 | * @var string
61 | */
62 | protected $bodyFormat = '';
63 |
64 | /**
65 | * Allows for directly setting the body to what
66 | * it needs to be.
67 | *
68 | * @var mixed
69 | */
70 | protected $requestBody = '';
71 | }
72 |
--------------------------------------------------------------------------------
/system/Test/Filters/CITestStreamFilter.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Test\Filters;
13 |
14 | use php_user_filter;
15 |
16 | /**
17 | * Class to extract an output snapshot.
18 | * Used to capture output during unit testing, so that it can
19 | * be used in assertions.
20 | */
21 | class CITestStreamFilter extends php_user_filter
22 | {
23 | /**
24 | * Buffer to capture stream content.
25 | *
26 | * @var string
27 | */
28 | public static $buffer = '';
29 |
30 | /**
31 | * Output filtering - catch it all.
32 | *
33 | * @param resource $in
34 | * @param resource $out
35 | * @param integer $consumed
36 | * @param boolean $closing
37 | *
38 | * @return integer
39 | */
40 | public function filter($in, $out, &$consumed, $closing)
41 | {
42 | while ($bucket = stream_bucket_make_writeable($in))
43 | {
44 | static::$buffer .= $bucket->data;
45 |
46 | $consumed += $bucket->datalen;
47 | }
48 |
49 | // @phpstan-ignore-next-line
50 | return PSFS_PASS_ON;
51 | }
52 | }
53 |
54 | // @codeCoverageIgnoreStart
55 | stream_filter_register('CITestStreamFilter', 'CodeIgniter\Test\Filters\CITestStreamFilter');
56 | // @codeCoverageIgnoreEnd
57 |
--------------------------------------------------------------------------------
/system/Test/Mock/MockAppConfig.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Test\Mock;
13 |
14 | class MockAppConfig
15 | {
16 | public $baseURL = 'http://example.com/';
17 |
18 | public $uriProtocol = 'REQUEST_URI';
19 |
20 | public $cookiePrefix = '';
21 | public $cookieDomain = '';
22 | public $cookiePath = '/';
23 | public $cookieSecure = false;
24 | public $cookieHTTPOnly = false;
25 | public $cookieSameSite = 'Lax';
26 |
27 | public $proxyIPs = '';
28 |
29 | public $CSRFProtection = false;
30 | public $CSRFTokenName = 'csrf_test_name';
31 | public $CSRFHeaderName = 'X-CSRF-TOKEN';
32 | public $CSRFCookieName = 'csrf_cookie_name';
33 | public $CSRFExpire = 7200;
34 | public $CSRFRegenerate = true;
35 | public $CSRFExcludeURIs = ['http://example.com'];
36 | public $CSRFRedirect = false;
37 | public $CSRFSameSite = 'Lax';
38 |
39 | public $CSPEnabled = false;
40 |
41 | public $defaultLocale = 'en';
42 | public $negotiateLocale = false;
43 | public $supportedLocales = [
44 | 'en',
45 | 'es',
46 | ];
47 | }
48 |
--------------------------------------------------------------------------------
/system/Test/Mock/MockAutoload.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Test\Mock;
13 |
14 | use Config\Autoload;
15 |
16 | class MockAutoload extends Autoload
17 | {
18 | public $psr4 = [];
19 |
20 | public $classmap = [];
21 |
22 | public function __construct()
23 | {
24 | // Don't call the parent since we don't want the default mappings.
25 | // parent::__construct();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/system/Test/Mock/MockBuilder.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Test\Mock;
13 |
14 | use CodeIgniter\Database\BaseBuilder;
15 | use CodeIgniter\Database\ConnectionInterface;
16 |
17 | class MockBuilder extends BaseBuilder
18 | {
19 | public function __construct($tableName, ConnectionInterface &$db, array $options = null)
20 | {
21 | parent::__construct($tableName, $db, $options);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/system/Test/Mock/MockCLIConfig.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Test\Mock;
13 |
14 | use Config\App;
15 |
16 | class MockCLIConfig extends App
17 | {
18 | public $baseURL = 'http://example.com/';
19 |
20 | public $uriProtocol = 'REQUEST_URI';
21 |
22 | public $cookiePrefix = '';
23 | public $cookieDomain = '';
24 | public $cookiePath = '/';
25 | public $cookieSecure = false;
26 | public $cookieHTTPOnly = false;
27 | public $cookieSameSite = 'Lax';
28 |
29 | public $proxyIPs = '';
30 |
31 | public $CSRFProtection = false;
32 | public $CSRFTokenName = 'csrf_test_name';
33 | public $CSRFCookieName = 'csrf_cookie_name';
34 | public $CSRFExpire = 7200;
35 | public $CSRFRegenerate = true;
36 | public $CSRFExcludeURIs = ['http://example.com'];
37 | public $CSRFSameSite = 'Lax';
38 |
39 | public $CSPEnabled = false;
40 |
41 | public $defaultLocale = 'en';
42 | public $negotiateLocale = false;
43 | public $supportedLocales = [
44 | 'en',
45 | 'es',
46 | ];
47 | }
48 |
--------------------------------------------------------------------------------
/system/Test/Mock/MockCURLRequest.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Test\Mock;
13 |
14 | use CodeIgniter\HTTP\CURLRequest;
15 |
16 | /**
17 | * Class MockCURLRequest
18 | *
19 | * Simply allows us to not actually call cURL during the
20 | * test runs. Instead, we can set the desired output
21 | * and get back the set options.
22 | */
23 | class MockCURLRequest extends CURLRequest
24 | {
25 | public $curl_options;
26 |
27 | protected $output = '';
28 |
29 | //--------------------------------------------------------------------
30 |
31 | public function setOutput($output)
32 | {
33 | $this->output = $output;
34 |
35 | return $this;
36 | }
37 |
38 | //--------------------------------------------------------------------
39 |
40 | protected function sendRequest(array $curlOptions = []): string
41 | {
42 | // Save so we can access later.
43 | $this->curl_options = $curlOptions;
44 |
45 | return $this->output;
46 | }
47 |
48 | //--------------------------------------------------------------------
49 | // for testing purposes only
50 | public function getBaseURI()
51 | {
52 | return $this->baseURI;
53 | }
54 |
55 | // for testing purposes only
56 | public function getDelay()
57 | {
58 | return $this->delay;
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/system/Test/Mock/MockCodeIgniter.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Test\Mock;
13 |
14 | use CodeIgniter\CodeIgniter;
15 |
16 | class MockCodeIgniter extends CodeIgniter
17 | {
18 | protected function callExit($code)
19 | {
20 | // Do not call exit() in testing.
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/system/Test/Mock/MockCommon.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | if (! function_exists('is_cli'))
13 | {
14 | /**
15 | * Is CLI?
16 | *
17 | * Test to see if a request was made from the command line.
18 | * You can set the return value for testing.
19 | *
20 | * @param boolean $newReturn return value to set
21 | * @return boolean
22 | */
23 | function is_cli(bool $newReturn = null): bool
24 | {
25 | // PHPUnit always runs via CLI.
26 | static $returnValue = true;
27 |
28 | if ($newReturn !== null)
29 | {
30 | $returnValue = $newReturn;
31 | }
32 |
33 | return $returnValue;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/system/Test/Mock/MockEmail.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Test\Mock;
13 |
14 | use CodeIgniter\Email\Email;
15 | use CodeIgniter\Events\Events;
16 |
17 | class MockEmail extends Email
18 | {
19 | /**
20 | * Value to return from mocked send().
21 | *
22 | * @var boolean
23 | */
24 | public $returnValue = true;
25 |
26 | public function send($autoClear = true)
27 | {
28 | if ($this->returnValue)
29 | {
30 | $this->setArchiveValues();
31 |
32 | if ($autoClear)
33 | {
34 | $this->clear();
35 | }
36 |
37 | Events::trigger('email', $this->archive);
38 | }
39 |
40 | return $this->returnValue;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/system/Test/Mock/MockEvents.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Test\Mock;
13 |
14 | use CodeIgniter\Events\Events;
15 |
16 | /**
17 | * Events
18 | */
19 | class MockEvents extends Events
20 | {
21 | public function getListeners()
22 | {
23 | return self::$listeners;
24 | }
25 |
26 | public function getEventsFile()
27 | {
28 | return self::$files;
29 | }
30 |
31 | public function getSimulate()
32 | {
33 | return self::$simulate;
34 | }
35 |
36 | public function unInitialize()
37 | {
38 | static::$initialized = false;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/system/Test/Mock/MockFileLogger.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Test\Mock;
13 |
14 | use CodeIgniter\Log\Handlers\FileHandler;
15 |
16 | /**
17 | * Class MockFileLogger
18 | *
19 | * Extends FileHandler, exposing some inner workings
20 | */
21 | class MockFileLogger extends FileHandler
22 | {
23 | /**
24 | * Where would the log be written?
25 | */
26 | public $destination;
27 |
28 | //--------------------------------------------------------------------
29 |
30 | public function __construct(array $config)
31 | {
32 | parent::__construct($config);
33 | $this->handles = $config['handles'] ?? [];
34 | $this->destination = $this->path . 'log-' . date('Y-m-d') . '.' . $this->fileExtension;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/system/Test/Mock/MockIncomingRequest.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Test\Mock;
13 |
14 | use CodeIgniter\HTTP\IncomingRequest;
15 |
16 | class MockIncomingRequest extends IncomingRequest
17 | {
18 | // public function populateHeaders()
19 | // {
20 | // // Don't do anything... force the tester to manually set the headers they want.
21 | // }
22 |
23 | public function detectURI($protocol, $baseURL)
24 | {
25 | // Do nothing...
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/system/Test/Mock/MockLanguage.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Test\Mock;
13 |
14 | use CodeIgniter\Language\Language;
15 |
16 | class MockLanguage extends Language
17 | {
18 | /**
19 | * Stores the data that should be
20 | * returned by the 'requireFile()' method.
21 | *
22 | * @var mixed
23 | */
24 | protected $data;
25 |
26 | //--------------------------------------------------------------------
27 |
28 | /**
29 | * Sets the data that should be returned by the
30 | * 'requireFile()' method to allow easy overrides
31 | * during testing.
32 | *
33 | * @param array $data
34 | * @param string $file
35 | * @param string|null $locale
36 | *
37 | * @return $this
38 | */
39 | public function setData(string $file, array $data, string $locale = null)
40 | {
41 | $this->language[$locale ?? $this->locale][$file] = $data;
42 |
43 | return $this;
44 | }
45 |
46 | //--------------------------------------------------------------------
47 |
48 | /**
49 | * Provides an override that allows us to set custom
50 | * data to be returned easily during testing.
51 | *
52 | * @param string $path
53 | *
54 | * @return array
55 | */
56 | protected function requireFile(string $path): array
57 | {
58 | return $this->data ?? [];
59 | }
60 |
61 | //--------------------------------------------------------------------
62 |
63 | /**
64 | * Arbitrarily turnoff internationalization support for testing
65 | */
66 | public function disableIntlSupport()
67 | {
68 | $this->intlSupport = false;
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/system/Test/Mock/MockQuery.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Test\Mock;
13 |
14 | use CodeIgniter\Database\Query;
15 |
16 | class MockQuery extends Query
17 | {
18 | }
19 |
--------------------------------------------------------------------------------
/system/Test/Mock/MockResourceController.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Test\Mock;
13 |
14 | use CodeIgniter\RESTful\ResourceController;
15 |
16 | class MockResourceController extends ResourceController
17 | {
18 | public function getModel()
19 | {
20 | return $this->model;
21 | }
22 |
23 | public function getModelName()
24 | {
25 | return $this->modelName;
26 | }
27 |
28 | public function getFormat()
29 | {
30 | return $this->format;
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/system/Test/Mock/MockResourcePresenter.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Test\Mock;
13 |
14 | use CodeIgniter\API\ResponseTrait;
15 | use CodeIgniter\RESTful\ResourcePresenter;
16 |
17 | class MockResourcePresenter extends ResourcePresenter
18 | {
19 | use ResponseTrait;
20 |
21 | public function getModel()
22 | {
23 | return $this->model;
24 | }
25 |
26 | public function getModelName()
27 | {
28 | return $this->modelName;
29 | }
30 |
31 | public function getFormat()
32 | {
33 | return $this->format;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/system/Test/Mock/MockResponse.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Test\Mock;
13 |
14 | use CodeIgniter\HTTP\Response;
15 |
16 | /**
17 | * Class MockResponse
18 | */
19 | class MockResponse extends Response
20 | {
21 | /**
22 | * If true, will not write output. Useful during testing.
23 | *
24 | * @var boolean
25 | */
26 | protected $pretend = true;
27 |
28 | // for testing
29 | public function getPretend()
30 | {
31 | return $this->pretend;
32 | }
33 |
34 | // artificial error for testing
35 | public function misbehave()
36 | {
37 | $this->statusCode = 0;
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/system/Test/Mock/MockSecurity.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Test\Mock;
13 |
14 | use CodeIgniter\HTTP\RequestInterface;
15 | use CodeIgniter\Security\Security;
16 |
17 | class MockSecurity extends Security
18 | {
19 | public function sendCookie(RequestInterface $request)
20 | {
21 | $_COOKIE['csrf_cookie_name'] = $this->hash;
22 |
23 | return $this;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/system/Test/Mock/MockSecurityConfig.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Test\Mock;
13 |
14 | use \CodeIgniter\Config\BaseService;
15 | use CodeIgniter\Autoloader\FileLocator;
16 |
17 | class MockServices extends BaseService
18 | {
19 | public $psr4 = [
20 | 'Tests/Support' => TESTPATH . '_support/',
21 | ];
22 |
23 | public $classmap = [];
24 |
25 | //--------------------------------------------------------------------
26 |
27 | public function __construct()
28 | {
29 | // Don't call the parent since we don't want the default mappings.
30 | // parent::__construct();
31 | }
32 |
33 | //--------------------------------------------------------------------
34 | public static function locator(bool $getShared = true)
35 | {
36 | return new FileLocator(static::autoloader());
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/system/Test/Mock/MockTable.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Test\Mock;
13 |
14 | use BadMethodCallException;
15 | use CodeIgniter\View\Table;
16 |
17 | class MockTable extends Table
18 | {
19 | // Override inaccessible protected method
20 | public function __call($method, $params)
21 | {
22 | if (is_callable([$this, '_' . $method]))
23 | {
24 | return call_user_func_array([$this, '_' . $method], $params);
25 | }
26 |
27 | throw new BadMethodCallException('Method ' . $method . ' was not found');
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/system/ThirdParty/Escaper/Exception/ExceptionInterface.php:
--------------------------------------------------------------------------------
1 | resource_type) {
35 | return $this->resource_type.' resource';
36 | }
37 |
38 | return 'resource';
39 | }
40 |
41 | public function transplant(BasicObject $old)
42 | {
43 | parent::transplant($old);
44 |
45 | if ($old instanceof self) {
46 | $this->resource_type = $old->resource_type;
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/system/ThirdParty/Kint/Object/StreamObject.php:
--------------------------------------------------------------------------------
1 | stream_meta = $meta;
38 | }
39 |
40 | public function getValueShort()
41 | {
42 | if (empty($this->stream_meta['uri'])) {
43 | return;
44 | }
45 |
46 | $uri = $this->stream_meta['uri'];
47 |
48 | if (\stream_is_local($uri)) {
49 | return Kint::shortenPath($uri);
50 | }
51 |
52 | return $uri;
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/system/ThirdParty/Kint/Object/TraceObject.php:
--------------------------------------------------------------------------------
1 | size) {
40 | return 'empty';
41 | }
42 |
43 | return parent::getSize();
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/system/ThirdParty/Kint/Parser/BinaryPlugin.php:
--------------------------------------------------------------------------------
1 | encoding, array('ASCII', 'UTF-8'), true)) {
46 | $o->value->hints[] = 'binary';
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/system/ThirdParty/Kint/Renderer/Rich/BlacklistPlugin.php:
--------------------------------------------------------------------------------
1 | '.$this->renderLockedHeader($o, 'Blacklisted').'';
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/system/ThirdParty/Kint/Renderer/Rich/DepthLimitPlugin.php:
--------------------------------------------------------------------------------
1 | '.$this->renderLockedHeader($o, 'Depth Limit').'';
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/system/ThirdParty/Kint/Renderer/Rich/ObjectPluginInterface.php:
--------------------------------------------------------------------------------
1 | '.$this->renderLockedHeader($o, 'Recursion').'';
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/system/ThirdParty/Kint/Renderer/Rich/TabPluginInterface.php:
--------------------------------------------------------------------------------
1 | contents);
37 |
38 | if ($dt) {
39 | return ''.$dt->setTimeZone(new DateTimeZone('UTC'))->format('Y-m-d H:i:s T').'
';
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/system/ThirdParty/Kint/Renderer/Text/BlacklistPlugin.php:
--------------------------------------------------------------------------------
1 | depth) {
37 | $out .= $this->renderer->colorTitle($this->renderer->renderTitle($o)).PHP_EOL;
38 | }
39 |
40 | $out .= $this->renderer->renderHeader($o).' '.$this->renderer->colorValue('BLACKLISTED').PHP_EOL;
41 |
42 | return $out;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/system/ThirdParty/Kint/Renderer/Text/DepthLimitPlugin.php:
--------------------------------------------------------------------------------
1 | depth) {
37 | $out .= $this->renderer->colorTitle($this->renderer->renderTitle($o)).PHP_EOL;
38 | }
39 |
40 | $out .= $this->renderer->renderHeader($o).' '.$this->renderer->colorValue('DEPTH LIMIT').PHP_EOL;
41 |
42 | return $out;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/system/ThirdParty/Kint/Renderer/Text/Plugin.php:
--------------------------------------------------------------------------------
1 | renderer = $r;
38 | }
39 |
40 | abstract public function render(BasicObject $o);
41 | }
42 |
--------------------------------------------------------------------------------
/system/ThirdParty/Kint/Renderer/Text/RecursionPlugin.php:
--------------------------------------------------------------------------------
1 | depth) {
37 | $out .= $this->renderer->colorTitle($this->renderer->renderTitle($o)).PHP_EOL;
38 | }
39 |
40 | $out .= $this->renderer->renderHeader($o).' '.$this->renderer->colorValue('RECURSION').PHP_EOL;
41 |
42 | return $out;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/system/ThirdParty/Kint/resources/compiled/microtime.js:
--------------------------------------------------------------------------------
1 | void 0===window.kintMicrotimeInitialized&&(window.kintMicrotimeInitialized=1,window.addEventListener("load",function(){"use strict";var c={},i=Array.prototype.slice.call(document.querySelectorAll("[data-kint-microtime-group]"),0);i.forEach(function(i){if(i.querySelector(".kint-microtime-lap")){var t=i.getAttribute("data-kint-microtime-group"),e=parseFloat(i.querySelector(".kint-microtime-lap").innerHTML),r=parseFloat(i.querySelector(".kint-microtime-avg").innerHTML);void 0===c[t]&&(c[t]={}),(void 0===c[t].min||c[t].min>e)&&(c[t].min=e),(void 0===c[t].max||c[t].maxlogger = $logger;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/system/ThirdParty/PSR/Log/NullLogger.php:
--------------------------------------------------------------------------------
1 | logger) { }`
11 | * blocks.
12 | */
13 | class NullLogger extends AbstractLogger
14 | {
15 | /**
16 | * Logs with an arbitrary level.
17 | *
18 | * @param mixed $level
19 | * @param string $message
20 | * @param array $context
21 | * @return null
22 | */
23 | public function log($level, $message, array $context = [])
24 | {
25 | // noop
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/system/Throttle/ThrottlerInterface.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Throttle;
13 |
14 | /**
15 | * Expected behavior of a Throttler
16 | */
17 | interface ThrottlerInterface
18 | {
19 | /**
20 | * Restricts the number of requests made by a single key within
21 | * a set number of seconds.
22 | *
23 | * Example:
24 | *
25 | * if (! $throttler->checkIPAddress($request->ipAddress(), 60, MINUTE))
26 | * {
27 | * die('You submitted over 60 requests within a minute.');
28 | * }
29 | *
30 | * @param string $key The name to use as the "bucket" name.
31 | * @param integer $capacity The number of requests the "bucket" can hold
32 | * @param integer $seconds The time it takes the "bucket" to completely refill
33 | * @param integer $cost The number of tokens this action uses.
34 | *
35 | * @return boolean
36 | */
37 | public function check(string $key, int $capacity, int $seconds, int $cost);
38 |
39 | //--------------------------------------------------------------------
40 |
41 | /**
42 | * Returns the number of seconds until the next available token will
43 | * be released for usage.
44 | *
45 | * @return integer
46 | */
47 | public function getTokenTime(): int;
48 | }
49 |
--------------------------------------------------------------------------------
/system/Validation/Exceptions/ValidationException.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\Validation\Exceptions;
13 |
14 | use CodeIgniter\Exceptions\FrameworkException;
15 |
16 | class ValidationException extends FrameworkException
17 | {
18 | public static function forRuleNotFound(string $rule = null)
19 | {
20 | return new static(lang('Validation.ruleNotFound', [$rule]));
21 | }
22 |
23 | public static function forGroupNotFound(string $group = null)
24 | {
25 | return new static(lang('Validation.groupNotFound', [$group]));
26 | }
27 |
28 | public static function forGroupNotArray(string $group = null)
29 | {
30 | return new static(lang('Validation.groupNotArray', [$group]));
31 | }
32 |
33 | public static function forInvalidTemplate(string $template = null)
34 | {
35 | return new static(lang('Validation.invalidTemplate', [$template]));
36 | }
37 |
38 | public static function forNoRuleSets()
39 | {
40 | return new static(lang('Validation.noRuleSets'));
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/system/Validation/Views/list.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | - = esc($error) ?>
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/system/Validation/Views/single.php:
--------------------------------------------------------------------------------
1 | = esc($error) ?>
2 |
--------------------------------------------------------------------------------
/system/View/Exceptions/ViewException.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace CodeIgniter\View\Exceptions;
13 |
14 | use CodeIgniter\Exceptions\FrameworkException;
15 |
16 | class ViewException extends FrameworkException
17 | {
18 | public static function forInvalidCellMethod(string $class, string $method)
19 | {
20 | return new static(lang('View.invalidCellMethod', ['class' => $class, 'method' => $method]));
21 | }
22 |
23 | public static function forMissingCellParameters(string $class, string $method)
24 | {
25 | return new static(lang('View.missingCellParameters', ['class' => $class, 'method' => $method]));
26 | }
27 |
28 | public static function forInvalidCellParameter(string $key)
29 | {
30 | return new static(lang('View.invalidCellParameter', [$key]));
31 | }
32 |
33 | public static function forNoCellClass()
34 | {
35 | return new static(lang('View.noCellClass'));
36 | }
37 |
38 | public static function forInvalidCellClass(string $class = null)
39 | {
40 | return new static(lang('View.invalidCellClass', [$class]));
41 | }
42 |
43 | public static function forTagSyntaxError(string $output)
44 | {
45 | return new static(lang('View.tagSyntaxError', [$output]));
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/system/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 403 Forbidden
5 |
6 |
7 |
8 | Directory access is forbidden.
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/writable/.htaccess:
--------------------------------------------------------------------------------
1 |
2 | Require all denied
3 |
4 |
5 | Deny from all
6 |
7 |
--------------------------------------------------------------------------------
/writable/cache/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 403 Forbidden
5 |
6 |
7 |
8 | Directory access is forbidden.
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/writable/logs/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 403 Forbidden
5 |
6 |
7 |
8 | Directory access is forbidden.
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/writable/session/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 403 Forbidden
5 |
6 |
7 |
8 | Directory access is forbidden.
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/writable/uploads/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 403 Forbidden
5 |
6 |
7 |
8 | Directory access is forbidden.
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------