From 9002edf31fe4ee8fce8442bb187c26c746e0a874 Mon Sep 17 00:00:00 2001 From: "John Paul E. Balandan, CPA" Date: Tue, 3 Nov 2026 13:30:23 +0800 Subject: [PATCH 1/2] docs: fix grammar inconsistencies, false claims, etc. --- .../source/changelogs/v4.0.0-alpha.1.rst | 182 ++++--- .../source/changelogs/v4.0.0-alpha.2.rst | 271 +++++----- .../source/changelogs/v4.0.0-alpha.3.rst | 480 +++++++++--------- .../source/changelogs/v4.0.0-alpha.4.rst | 319 ++++++------ .../source/changelogs/v4.0.0-alpha.5.rst | 375 +++++++------- .../source/changelogs/v4.0.0-beta.1.rst | 233 +++++---- .../source/changelogs/v4.0.0-beta.2.rst | 346 +++++++------ .../source/changelogs/v4.0.0-beta.3.rst | 246 +++++---- .../source/changelogs/v4.0.0-beta.4.rst | 275 +++++----- .../source/changelogs/v4.0.0-rc.1.rst | 335 ++++++------ .../source/changelogs/v4.0.0-rc.2.rst | 294 ++++++----- .../source/changelogs/v4.0.0-rc.3.rst | 209 ++++---- .../source/changelogs/v4.0.0-rc.4.rst | 20 +- user_guide_src/source/changelogs/v4.0.0.rst | 8 +- user_guide_src/source/changelogs/v4.0.3.rst | 12 +- user_guide_src/source/changelogs/v4.0.4.rst | 38 +- user_guide_src/source/changelogs/v4.0.5.rst | 16 +- user_guide_src/source/changelogs/v4.1.0.rst | 4 +- user_guide_src/source/changelogs/v4.1.2.rst | 18 +- user_guide_src/source/changelogs/v4.1.4.rst | 74 +-- user_guide_src/source/changelogs/v4.1.5.rst | 19 +- user_guide_src/source/changelogs/v4.1.6.rst | 16 +- user_guide_src/source/changelogs/v4.1.7.rst | 8 +- user_guide_src/source/changelogs/v4.2.0.rst | 125 +++-- user_guide_src/source/changelogs/v4.2.1.rst | 4 +- user_guide_src/source/changelogs/v4.2.11.rst | 2 +- user_guide_src/source/changelogs/v4.2.12.rst | 4 +- user_guide_src/source/changelogs/v4.2.2.rst | 8 +- user_guide_src/source/changelogs/v4.2.3.rst | 2 +- user_guide_src/source/changelogs/v4.2.5.rst | 7 +- user_guide_src/source/changelogs/v4.2.6.rst | 2 +- user_guide_src/source/changelogs/v4.2.7.rst | 8 +- user_guide_src/source/changelogs/v4.2.8.rst | 8 +- user_guide_src/source/changelogs/v4.2.9.rst | 2 +- user_guide_src/source/changelogs/v4.3.0.rst | 181 +++---- user_guide_src/source/changelogs/v4.3.1.rst | 4 +- user_guide_src/source/changelogs/v4.3.2.rst | 2 +- user_guide_src/source/changelogs/v4.3.3.rst | 4 +- user_guide_src/source/changelogs/v4.3.4.rst | 10 +- user_guide_src/source/changelogs/v4.3.5.rst | 10 +- user_guide_src/source/changelogs/v4.3.6.rst | 10 +- user_guide_src/source/changelogs/v4.3.7.rst | 2 +- user_guide_src/source/changelogs/v4.3.8.rst | 6 +- user_guide_src/source/changelogs/v4.4.0.rst | 205 ++++---- user_guide_src/source/changelogs/v4.4.1.rst | 7 +- user_guide_src/source/changelogs/v4.4.2.rst | 16 +- user_guide_src/source/changelogs/v4.4.4.rst | 16 +- user_guide_src/source/changelogs/v4.4.5.rst | 2 +- user_guide_src/source/changelogs/v4.4.6.rst | 2 +- user_guide_src/source/changelogs/v4.4.7.rst | 4 +- user_guide_src/source/changelogs/v4.4.8.rst | 2 +- user_guide_src/source/changelogs/v4.5.0.rst | 192 +++---- user_guide_src/source/changelogs/v4.5.4.rst | 2 +- user_guide_src/source/changelogs/v4.5.5.rst | 2 +- user_guide_src/source/changelogs/v4.5.6.rst | 10 +- user_guide_src/source/changelogs/v4.5.7.rst | 4 +- user_guide_src/source/changelogs/v4.6.0.rst | 98 ++-- user_guide_src/source/changelogs/v4.6.1.rst | 1 + user_guide_src/source/changelogs/v4.6.2.rst | 4 +- user_guide_src/source/changelogs/v4.6.4.rst | 13 +- user_guide_src/source/changelogs/v4.7.0.rst | 217 ++++---- user_guide_src/source/changelogs/v4.7.1.rst | 4 +- user_guide_src/source/changelogs/v4.7.3.rst | 2 +- user_guide_src/source/changelogs/v4.7.4.rst | 4 +- user_guide_src/source/changelogs/v4.7.6.rst | 2 +- user_guide_src/source/cli/cli_commands.rst | 16 +- user_guide_src/source/cli/cli_controllers.rst | 18 +- user_guide_src/source/cli/cli_generators.rst | 36 +- user_guide_src/source/cli/cli_library.rst | 33 +- user_guide_src/source/cli/cli_overview.rst | 6 +- user_guide_src/source/cli/cli_request.rst | 2 +- user_guide_src/source/cli/cli_signals.rst | 7 +- user_guide_src/source/cli/spark_commands.rst | 16 +- user_guide_src/source/concepts/autoloader.rst | 14 +- user_guide_src/source/concepts/factories.rst | 38 +- user_guide_src/source/concepts/goals.rst | 6 +- user_guide_src/source/concepts/http.rst | 22 +- user_guide_src/source/concepts/mvc.rst | 14 +- user_guide_src/source/concepts/security.rst | 126 ++--- user_guide_src/source/concepts/services.rst | 32 +- user_guide_src/source/concepts/structure.rst | 6 +- .../source/database/call_function.rst | 8 +- .../source/database/configuration.rst | 18 +- user_guide_src/source/database/connecting.rst | 12 +- user_guide_src/source/database/events.rst | 4 +- user_guide_src/source/database/examples.rst | 16 +- user_guide_src/source/database/helpers.rst | 24 +- user_guide_src/source/database/metadata.rst | 12 +- user_guide_src/source/database/queries.rst | 52 +- .../source/database/query_builder.rst | 232 ++++----- user_guide_src/source/database/results.rst | 73 ++- .../source/database/transactions.rst | 34 +- user_guide_src/source/database/utilities.rst | 16 +- user_guide_src/source/dbmgmt/db_commands.rst | 14 +- user_guide_src/source/dbmgmt/forge.rst | 66 +-- user_guide_src/source/dbmgmt/migration.rst | 56 +- user_guide_src/source/dbmgmt/seeds.rst | 10 +- .../source/extending/authentication.rst | 4 +- .../source/extending/basecontroller.rst | 10 +- .../source/extending/basecontroller/003.php | 5 +- user_guide_src/source/extending/common.rst | 2 +- .../source/extending/composer_packages.rst | 35 +- .../source/extending/contributing.rst | 2 +- .../source/extending/core_classes.rst | 88 ++-- .../source/extending/core_classes/004.php | 7 +- user_guide_src/source/extending/events.rst | 16 +- user_guide_src/source/general/ajax.rst | 12 +- user_guide_src/source/general/caching.rst | 8 +- .../source/general/common_functions.rst | 98 ++-- .../source/general/configuration.rst | 49 +- .../source/general/environments.rst | 24 +- user_guide_src/source/general/errors.rst | 54 +- user_guide_src/source/general/helpers.rst | 34 +- user_guide_src/source/general/logging.rst | 36 +- .../source/general/managing_apps.rst | 12 +- user_guide_src/source/general/modules.rst | 52 +- user_guide_src/source/general/urls.rst | 24 +- user_guide_src/source/guides/api/code/009.php | 2 +- .../source/guides/api/controller.rst | 14 +- .../source/guides/api/database-setup.rst | 12 +- .../source/guides/api/first-endpoint.rst | 8 +- user_guide_src/source/guides/api/index.rst | 4 +- .../guides/first-app/create_news_items.rst | 22 +- .../source/guides/first-app/index.rst | 20 +- .../source/guides/first-app/news_section.rst | 22 +- .../source/guides/first-app/static_pages.rst | 25 +- .../source/helpers/array_helper.rst | 40 +- .../source/helpers/cookie_helper.rst | 14 +- user_guide_src/source/helpers/date_helper.rst | 12 +- .../source/helpers/filesystem_helper.rst | 30 +- user_guide_src/source/helpers/form_helper.rst | 55 +- user_guide_src/source/helpers/html_helper.rst | 44 +- .../source/helpers/inflector_helper.rst | 6 +- .../source/helpers/number_helper.rst | 21 +- .../source/helpers/security_helper.rst | 2 +- user_guide_src/source/helpers/test_helper.rst | 9 +- user_guide_src/source/helpers/text_helper.rst | 54 +- user_guide_src/source/helpers/url_helper.rst | 50 +- user_guide_src/source/helpers/xml_helper.rst | 14 +- .../source/incoming/auto_routing_improved.rst | 117 +++-- .../source/incoming/content_negotiation.rst | 44 +- .../source/incoming/controller_attributes.rst | 10 +- .../source/incoming/controllers.rst | 60 +-- user_guide_src/source/incoming/filters.rst | 72 +-- .../source/incoming/incomingrequest.rst | 54 +- user_guide_src/source/incoming/message.rst | 20 +- .../source/incoming/methodspoofing.rst | 6 +- user_guide_src/source/incoming/request.rst | 30 +- user_guide_src/source/incoming/restful.rst | 68 +-- user_guide_src/source/incoming/routing.rst | 140 ++--- .../backward_compatibility_notes.rst | 6 +- .../source/installation/deployment.rst | 24 +- user_guide_src/source/installation/index.rst | 2 +- .../installation/installing_composer.rst | 46 +- .../source/installation/installing_manual.rst | 14 +- .../source/installation/repositories.rst | 11 +- .../source/installation/running.rst | 58 +-- .../source/installation/troubleshooting.rst | 10 +- .../source/installation/upgrade_405.rst | 14 +- .../source/installation/upgrade_410.rst | 2 +- .../source/installation/upgrade_412.rst | 18 +- .../source/installation/upgrade_413.rst | 2 +- .../source/installation/upgrade_414.rst | 4 +- .../source/installation/upgrade_415.rst | 48 +- .../source/installation/upgrade_416.rst | 6 +- .../source/installation/upgrade_417.rst | 2 +- .../source/installation/upgrade_418.rst | 2 +- .../source/installation/upgrade_420.rst | 67 +-- .../source/installation/upgrade_421.rst | 12 +- .../source/installation/upgrade_4210.rst | 2 +- .../source/installation/upgrade_4211.rst | 22 +- .../source/installation/upgrade_4212.rst | 8 +- .../source/installation/upgrade_422.rst | 24 +- .../source/installation/upgrade_426.rst | 8 +- .../source/installation/upgrade_427.rst | 4 +- .../source/installation/upgrade_428.rst | 6 +- .../source/installation/upgrade_430.rst | 221 ++++---- .../source/installation/upgrade_431.rst | 23 +- .../source/installation/upgrade_432.rst | 36 +- .../source/installation/upgrade_433.rst | 19 +- .../source/installation/upgrade_434.rst | 16 +- .../source/installation/upgrade_435.rst | 18 +- .../source/installation/upgrade_436.rst | 4 +- .../source/installation/upgrade_437.rst | 30 +- .../source/installation/upgrade_438.rst | 6 +- .../source/installation/upgrade_440.rst | 51 +- .../source/installation/upgrade_441.rst | 16 +- .../source/installation/upgrade_442.rst | 8 +- .../source/installation/upgrade_443.rst | 18 +- .../source/installation/upgrade_444.rst | 48 +- .../source/installation/upgrade_445.rst | 4 +- .../source/installation/upgrade_446.rst | 12 +- .../source/installation/upgrade_447.rst | 55 +- .../source/installation/upgrade_448.rst | 8 +- .../source/installation/upgrade_450.rst | 169 +++--- .../source/installation/upgrade_451.rst | 16 +- .../source/installation/upgrade_452.rst | 20 +- .../source/installation/upgrade_453.rst | 6 +- .../source/installation/upgrade_454.rst | 6 +- .../source/installation/upgrade_455.rst | 6 +- .../source/installation/upgrade_456.rst | 12 +- .../source/installation/upgrade_457.rst | 4 +- .../source/installation/upgrade_458.rst | 6 +- .../source/installation/upgrade_460.rst | 65 +-- .../source/installation/upgrade_461.rst | 29 +- .../source/installation/upgrade_462.rst | 46 +- .../source/installation/upgrade_463.rst | 8 +- .../source/installation/upgrade_464.rst | 13 +- .../source/installation/upgrade_465.rst | 2 +- .../source/installation/upgrade_470.rst | 49 +- .../source/installation/upgrade_471.rst | 15 +- .../source/installation/upgrade_472.rst | 2 +- .../source/installation/upgrade_473.rst | 18 +- .../source/installation/upgrade_474.rst | 2 +- .../source/installation/upgrade_475.rst | 13 +- .../source/installation/upgrade_476.rst | 2 +- .../source/installation/upgrade_4xx.rst | 103 ++-- .../installation/upgrade_configuration.rst | 6 +- .../installation/upgrade_controllers.rst | 24 +- .../source/installation/upgrade_database.rst | 49 +- .../source/installation/upgrade_emails.rst | 14 +- .../installation/upgrade_encryption.rst | 10 +- .../installation/upgrade_file_upload.rst | 6 +- .../installation/upgrade_html_tables.rst | 12 +- .../source/installation/upgrade_images.rst | 10 +- .../installation/upgrade_localization.rst | 10 +- .../installation/upgrade_migrations.rst | 34 +- .../source/installation/upgrade_models.rst | 18 +- .../installation/upgrade_pagination.rst | 18 +- .../source/installation/upgrade_responses.rst | 10 +- .../source/installation/upgrade_routing.rst | 26 +- .../source/installation/upgrade_security.rst | 8 +- .../source/installation/upgrade_sessions.rst | 19 +- .../installation/upgrade_validations.rst | 30 +- .../installation/upgrade_view_parser.rst | 10 +- .../source/installation/upgrade_views.rst | 16 +- .../source/installation/upgrading.rst | 4 +- .../source/installation/worker_mode.rst | 14 +- user_guide_src/source/intro/credits.rst | 4 +- user_guide_src/source/intro/index.rst | 14 +- user_guide_src/source/intro/psr.rst | 13 +- user_guide_src/source/intro/requirements.rst | 18 +- user_guide_src/source/libraries/caching.rst | 38 +- user_guide_src/source/libraries/cookies.rst | 79 ++- user_guide_src/source/libraries/cors.rst | 12 +- .../source/libraries/curlrequest.rst | 70 +-- user_guide_src/source/libraries/email.rst | 80 +-- .../source/libraries/encryption.rst | 37 +- .../source/libraries/file_collections.rst | 22 +- user_guide_src/source/libraries/files.rst | 28 +- user_guide_src/source/libraries/honeypot.rst | 10 +- user_guide_src/source/libraries/images.rst | 98 ++-- .../source/libraries/official_packages.rst | 20 +- .../source/libraries/pagination.rst | 66 +-- user_guide_src/source/libraries/publisher.rst | 68 +-- user_guide_src/source/libraries/security.rst | 47 +- user_guide_src/source/libraries/sessions.rst | 112 ++-- user_guide_src/source/libraries/throttler.rst | 34 +- user_guide_src/source/libraries/time.rst | 68 +-- .../source/libraries/typography.rst | 12 +- .../source/libraries/uploaded_files.rst | 68 +-- user_guide_src/source/libraries/uri.rst | 36 +- .../source/libraries/user_agent.rst | 14 +- .../source/libraries/validation.rst | 138 ++--- user_guide_src/source/models/entities.rst | 64 ++- user_guide_src/source/models/model.rst | 142 +++--- .../source/outgoing/alternative_php.rst | 14 +- .../source/outgoing/api_responses.rst | 47 +- .../source/outgoing/api_transformers.rst | 22 +- user_guide_src/source/outgoing/csp.rst | 22 +- .../source/outgoing/localization.rst | 42 +- user_guide_src/source/outgoing/response.rst | 89 ++-- user_guide_src/source/outgoing/table.rst | 16 +- user_guide_src/source/outgoing/view_cells.rst | 26 +- .../source/outgoing/view_decorators.rst | 4 +- .../source/outgoing/view_layouts.rst | 10 +- .../source/outgoing/view_parser.rst | 102 ++-- .../source/outgoing/view_renderer.rst | 45 +- user_guide_src/source/outgoing/views.rst | 28 +- user_guide_src/source/testing/benchmark.rst | 14 +- user_guide_src/source/testing/cli.rst | 14 +- user_guide_src/source/testing/controllers.rst | 38 +- user_guide_src/source/testing/database.rst | 20 +- user_guide_src/source/testing/debugging.rst | 46 +- user_guide_src/source/testing/fabricator.rst | 32 +- user_guide_src/source/testing/feature.rst | 30 +- user_guide_src/source/testing/mocking.rst | 12 +- user_guide_src/source/testing/overview.rst | 38 +- user_guide_src/source/testing/response.rst | 38 +- .../source/testing/session_testing.rst | 12 +- 290 files changed, 6025 insertions(+), 5843 deletions(-) diff --git a/user_guide_src/source/changelogs/v4.0.0-alpha.1.rst b/user_guide_src/source/changelogs/v4.0.0-alpha.1.rst index ba1f9b7e6a52..f2899e23888b 100644 --- a/user_guide_src/source/changelogs/v4.0.0-alpha.1.rst +++ b/user_guide_src/source/changelogs/v4.0.0-alpha.1.rst @@ -12,86 +12,102 @@ Release Date: September 28, 2018 New Packages List ----------------- - - API - - \\ ResponseTrait - - Autoloader - - \\ AutoLoader, FileLocator - - CLI - - \\ BaseCommand, CLI, CommandRunner, Console - - Cache - - \\ CacheFactory, CacheInterface - - \\ Handlers ... Dummy, File, Memcached, Predis, Redis, Wincache - - Commands - - \\ Help, ListCommands - - \\ Database \\ CreateMigration, MigrateCurrent, MigrateLatest, MigrateRefresh, - MigrateRollback, MigrateStatus, MigrateVersion, Seed - - \\ Server \\ Serve - - \\ Sessions \\ CreateMigration - - \\ Utilities \\ Namespaces, Routes - - Config - - \\ AutoloadConfig, BaseConfig, BaseService, Config, DotEnv, ForeignCharacters, - Routes, Services, View - - Database - - \\ BaseBuilder, BaseConnection, BasePreparedQuery, BaseResult, BaseUtils, Config, - ConnectionInterface, Database, Forge, Migration, MigrationRunner, PreparedQueryInterface, Query, - QueryInterface, ResultInterface, Seeder - - \\ MySQLi \\ Builder, Connection, Forge, PreparedQuery, Result - - \\ Postgre \\ Builder, Connection, Forge, PreparedQuery, Result, Utils - - \\ SQLite3 \\ Builder, Connection, Forge, PreparedQuery, Result, Utils - - Debug - - \\ Exceptions, Iterator, Timer, Toolbar - - \\ Toolbar \\ Collectors... - - Email - - \\ Email - - Events - - \\ Events - - Files - - \\ File - - Filters - - \\ FilterInterface, Filters - - Format - - \\ FormatterInterface, JSONFormatter, XMLFormatter - - HTTP - - \\ CLIRequest, CURLRequest, ContentSecurityPolicy, Header, - IncomingRequest, Message, Negotiate, Request, RequestInterface, - Response, ResponseInterface, URI, UserAgent - - \\ Files \\ FileCollection, UploadedFile, UploadedFileInterface - - Helpers - - ... array, cookie, date, filesystem, form, html, inflector, number, - security, text, url - - Honeypot - - \\ Honeypot - - I18n - - \\ Time, TimeDifference - - Images - - \\ Image, ImageHandlerInterface - - \\ Handlers ... Base, GD, ImageMagick - - Language - - \\ Language - - Log - - Logger, LoggerAwareTrait - - \\ Handlers ... Base, ChromeLogger, File, HandlerInterface - - Pager - - \\ Pager, PagerInterface, PagerRenderer - - Router - - \\ RouteCollection, RouteCollectionInterface, Router, RouterInterface - - Security - - \\ Security - - Session - - \\ Session, SessionInterface - - \\ Handlers ... Base, File, Memcached, Redis - - Test - - \\ CIDatabaseTestCase, CIUnitTestCase, FeatureResponse, FeatureTestCase, ReflectionHelper - - \\ Filters \\ CITestStreamFilter - - ThirdParty (bundled) - - \\ Kint (for \\Debug) - - \\ PSR \\ Log (for \\Log) - - \\ ZendEscaper \\ Escaper (for \\View) - - Throttle - - \\ Throttler, ThrottlerInterface - - Typography - - \\ Typography - - Validation - - \\ CreditCardRules, FileRules, FormatRules, Rules, Validation, ValidationInterface - - View - - \\ Cell, Filters, Parser, Plugins, RendererInterface, View +:: + + . + ├── API/ + │ └── ResponseTrait + ├── Autoloader/ + │ └── AutoLoader, FileLocator + ├── CLI/ + │ └── BaseCommand, CLI, CommandRunner, Console + ├── Cache/ + │ ├── CacheFactory, CacheInterface + │ └── Handlers/ + │ └── Dummy, File, Memcached, Predis, Redis, Wincache + ├── Commands/ + │ ├── Help, ListCommands + │ ├── Database/ + │ │ └── CreateMigration, MigrateCurrent, MigrateLatest, MigrateRefresh, MigrateRollback, MigrateStatus, + │ │ MigrateVersion, Seed + │ ├── Server/ + │ │ └── Serve + │ ├── Sessions/ + │ │ └── CreateMigration + │ └── Utilities/ + │ └── Namespaces, Routes + ├── Config/ + │ └── AutoloadConfig, BaseConfig, BaseService, Config, DotEnv, ForeignCharacters, Routes, Services, View + ├── Database/ + │ ├── BaseBuilder, BaseConnection, BasePreparedQuery, BaseResult, BaseUtils, Config, ConnectionInterface, + │ │ Database, Forge, Migration, MigrationRunner, PreparedQueryInterface, Query, QueryInterface, + │ │ ResultInterface, Seeder + │ ├── MySQLi/ + │ │ └── Builder, Connection, Forge, PreparedQuery, Result + │ ├── Postgre/ + │ │ └── Builder, Connection, Forge, PreparedQuery, Result, Utils + │ └── SQLite3/ + │ └── Builder, Connection, Forge, PreparedQuery, Result, Utils + ├── Debug/ + │ ├── Exceptions, Iterator, Timer, Toolbar + │ └── Toolbar/ + │ └── Collectors... + ├── Email/ + │ └── Email + ├── Events/ + │ └── Events + ├── Files/ + │ └── File + ├── Filters/ + │ └── FilterInterface, Filters + ├── Format/ + │ └── FormatterInterface, JSONFormatter, XMLFormatter + ├── HTTP/ + │ ├── CLIRequest, CURLRequest, ContentSecurityPolicy, Header, IncomingRequest, Message, Negotiate, Request, + │ │ RequestInterface, Response, ResponseInterface, URI, UserAgent + │ └── Files/ + │ └── FileCollection, UploadedFile, UploadedFileInterface + ├── Helpers/ + │ └── array, cookie, date, filesystem, form, html, inflector, number, security, text, url + ├── Honeypot/ + │ └── Honeypot + ├── I18n/ + │ └── Time, TimeDifference + ├── Images/ + │ ├── Image, ImageHandlerInterface + │ └── Handlers/ + │ └── Base, GD, ImageMagick + ├── Language/ + │ └── Language + ├── Log/ + │ ├── Logger, LoggerAwareTrait + │ └── Handlers/ + │ └── Base, ChromeLogger, File, HandlerInterface + ├── Pager/ + │ └── Pager, PagerInterface, PagerRenderer + ├── Router/ + │ └── RouteCollection, RouteCollectionInterface, Router, RouterInterface + ├── Security/ + │ └── Security + ├── Session/ + │ ├── Session, SessionInterface + │ └── Handlers/ + │ └── Base, File, Memcached, Redis + ├── Test/ + │ ├── CIDatabaseTestCase, CIUnitTestCase, FeatureResponse, FeatureTestCase, ReflectionHelper + │ └── Filters/ + │ └── CITestStreamFilter + ├── ThirdParty/ (bundled) + │ ├── Kint (for Debug) + │ ├── PSR/ + │ │ └── Log (for Log) + │ └── ZendEscaper/ + │ └── Escaper (for View) + ├── Throttle/ + │ └── Throttler, ThrottlerInterface + ├── Typography/ + │ └── Typography + ├── Validation/ + │ └── CreditCardRules, FileRules, FormatRules, Rules, Validation, ValidationInterface + └── View/ + └── Cell, Filters, Parser, Plugins, RendererInterface, View diff --git a/user_guide_src/source/changelogs/v4.0.0-alpha.2.rst b/user_guide_src/source/changelogs/v4.0.0-alpha.2.rst index a7c7e68fa36d..9bfddb6f2ab5 100644 --- a/user_guide_src/source/changelogs/v4.0.0-alpha.2.rst +++ b/user_guide_src/source/changelogs/v4.0.0-alpha.2.rst @@ -14,142 +14,139 @@ Changed Files The list of changed files follows, with PR numbers shown. -application / - - composer.json #1312 - - Config/Boot/development, production, testing #1312 - - Config/Paths #1341 - - Config/Routes #1281 - - Filters/Honeypot #1314 - - Views/errors/cli/error_404 #1272 - - Views/welcome_message #1342 +.. code-block:: text -public / - - .htaccess #1281 - - index #1295, #1313 - -system / - - CLI/ - - CommandRunner #1350, #1356 - - Commands/ - - Server/Serve #1313 - - Config/ - - AutoloadConfig #1271 - - Services #1341 - - Database/ - - BaseBuilder #1217 - - BaseUtils #1209, #1329 - - Database #1339 - - MySQLi/Utils #1209 - - Debug/Toolbar/ - - Views/toolbar.css #1342 - - Exceptions/ - - CastException #1283 - - DownloadException #1239 - - FrameworkException #1313 - - Filters/ - - Filters #1239 - - Helpers/ - - cookie_helper #1286 - - form_helper #1244, #1327 - - url_helper #1321 - - xml_helper #1209 - - Honeypot/ - - Honeypot #1314 - - HTTP/ - - CliRequest #1303 - - CURLRequest #1303 - - DownloadResponse #1239 - - Exceptions/HTTPException #1303 - - IncomingRequest #1304, #1313 - - Negotiate #1306 - - RedirectResponse #1300, #1306, #1329 - - Response #1239, #1286 - - ResponseInterface #1239 - - URI #1300 - - Language/en/ - - Cast #1283 - - HTTP #1239 - - Router/ - - RouteCollection #1285, #1355 - - Test/ - - CIUnitTestCase #1312, #1361 - - FeatureTestCase #1282 - - CodeIgniter #1239 #1337 - - Common #1291 - - Entity #1283, #1311 - - Model #1311 - -tests / - - API/ - - ResponseTraitTest #1302 - - Commands/ - - CommandsTest #1356 - - Database/ - - BaseBuilderTest #1217 - - Live/ModelTest #1311 - - Debug/ - - TimerTest #1273 - - Helpers/ - - CookieHelperTest #1286 - - Honeypot/ - - HoneypotTest #1314 - - HTTP/ - - Files/ - - FileMovingTest #1302 - - UploadedFileTest #1302 - - CLIRequestTest #1303 - - CURLRequestTest #1303 - - DownloadResponseTest #1239 - - NegotiateTest #1306 - - RedirectResponseTest #1300, #1306, #1329 - - ResponseTest #1239 - - I18n/ - - TimeTest #1273, #1316 - - Router/ - - RouteTest #1285, #1355 - - Test/ - - TestCaseEmissionsTest #1312 - - TestCaseTest #1312 - - View/ - - ParserTest #1311 - - EntityTest #1319 - -user_guide_src /source/ - - cli/ - - cli_request #1303 - - database/ - - query_builder #1217 - - utilities #1209 - - extending/ - - contributing #1280 - - general/ - - common_functions #1300, #1329 - - helpers #1291 - - managing_apps #1341 - - helpers/ - - xml_helper #1321 - - incoming/ - - controllers #1323 - - routing #1337 - - intro/ - - requirements #1280, #1303 - - installation/ #1280, #1303 - - troubleshooting #1265 - - libraries/ - - curlrequest #1303 - - honeypot #1314 - - sessions #1333 - - uploaded_files #1302 - - models/ - - entities #1283 - - outgoing/ - - response #1340 - - testing/ - - overview #1312 - - tutorial... #1265, #1281, #1294 - -/ - - spark #1305 + . + ├── application/ + │ ├── composer.json #1312 + │ ├── Config/Boot/development, production, testing #1312 + │ ├── Config/Paths #1341 + │ ├── Config/Routes #1281 + │ ├── Filters/Honeypot #1314 + │ ├── Views/errors/cli/error_404 #1272 + │ └── Views/welcome_message #1342 + ├── public/ + │ ├── .htaccess #1281 + │ └── index #1295, #1313 + ├── system/ + │ ├── CLI/ + │ │ └── CommandRunner #1350, #1356 + │ ├── Commands/ + │ │ └── Server/Serve #1313 + │ ├── Config/ + │ │ ├── AutoloadConfig #1271 + │ │ └── Services #1341 + │ ├── Database/ + │ │ ├── BaseBuilder #1217 + │ │ ├── BaseUtils #1209, #1329 + │ │ ├── Database #1339 + │ │ └── MySQLi/Utils #1209 + │ ├── Debug/Toolbar/ + │ │ └── Views/toolbar.css #1342 + │ ├── Exceptions/ + │ │ ├── CastException #1283 + │ │ ├── DownloadException #1239 + │ │ └── FrameworkException #1313 + │ ├── Filters/ + │ │ └── Filters #1239 + │ ├── Helpers/ + │ │ ├── cookie_helper #1286 + │ │ ├── form_helper #1244, #1327 + │ │ ├── url_helper #1321 + │ │ └── xml_helper #1209 + │ ├── Honeypot/ + │ │ └── Honeypot #1314 + │ ├── HTTP/ + │ │ ├── CliRequest #1303 + │ │ ├── CURLRequest #1303 + │ │ ├── DownloadResponse #1239 + │ │ ├── Exceptions/HTTPException #1303 + │ │ ├── IncomingRequest #1304, #1313 + │ │ ├── Negotiate #1306 + │ │ ├── RedirectResponse #1300, #1306, #1329 + │ │ ├── Response #1239, #1286 + │ │ ├── ResponseInterface #1239 + │ │ └── URI #1300 + │ ├── Language/en/ + │ │ ├── Cast #1283 + │ │ └── HTTP #1239 + │ ├── Router/ + │ │ └── RouteCollection #1285, #1355 + │ ├── Test/ + │ │ ├── CIUnitTestCase #1312, #1361 + │ │ └── FeatureTestCase #1282 + │ ├── CodeIgniter #1239 #1337 + │ ├── Common #1291 + │ ├── Entity #1283, #1311 + │ └── Model #1311 + ├── tests/ + │ ├── API/ + │ │ └── ResponseTraitTest #1302 + │ ├── Commands/ + │ │ └── CommandsTest #1356 + │ ├── Database/ + │ │ ├── BaseBuilderTest #1217 + │ │ └── Live/ModelTest #1311 + │ ├── Debug/ + │ │ └── TimerTest #1273 + │ ├── Helpers/ + │ │ └── CookieHelperTest #1286 + │ ├── Honeypot/ + │ │ └── HoneypotTest #1314 + │ ├── HTTP/ + │ │ ├── Files/ + │ │ │ ├── FileMovingTest #1302 + │ │ │ └── UploadedFileTest #1302 + │ │ ├── CLIRequestTest #1303 + │ │ ├── CURLRequestTest #1303 + │ │ ├── DownloadResponseTest #1239 + │ │ ├── NegotiateTest #1306 + │ │ ├── RedirectResponseTest #1300, #1306, #1329 + │ │ └── ResponseTest #1239 + │ ├── I18n/ + │ │ └── TimeTest #1273, #1316 + │ ├── Router/ + │ │ └── RouteTest #1285, #1355 + │ ├── Test/ + │ │ ├── TestCaseEmissionsTest #1312 + │ │ └── TestCaseTest #1312 + │ ├── View/ + │ │ └── ParserTest #1311 + │ └── EntityTest #1319 + ├── user_guide_src/source/ + │ ├── cli/ + │ │ └── cli_request #1303 + │ ├── database/ + │ │ ├── query_builder #1217 + │ │ └── utilities #1209 + │ ├── extending/ + │ │ └── contributing #1280 + │ ├── general/ + │ │ ├── common_functions #1300, #1329 + │ │ ├── helpers #1291 + │ │ └── managing_apps #1341 + │ ├── helpers/ + │ │ └── xml_helper #1321 + │ ├── incoming/ + │ │ ├── controllers #1323 + │ │ └── routing #1337 + │ ├── intro/ + │ │ └── requirements #1280, #1303 + │ ├── installation/ #1280, #1303 + │ │ └── troubleshooting #1265 + │ ├── libraries/ + │ │ ├── curlrequest #1303 + │ │ ├── honeypot #1314 + │ │ ├── sessions #1333 + │ │ └── uploaded_files #1302 + │ ├── models/ + │ │ └── entities #1283 + │ ├── outgoing/ + │ │ └── response #1340 + │ ├── testing/ + │ │ └── overview #1312 + │ └── tutorial... #1265, #1281, #1294 + └── spark #1305 PRs merged ---------- @@ -171,7 +168,7 @@ PRs merged - #1333 Error in user guide for session config. Fixes #1330 - #1329 Tweaks - #1327 FIX form_hidden and form_open - value escaping as is in form_input. -- #1323 Fix doc error : show_404() doesn't exist any more +- #1323 Fix doc error: show_404() doesn't exist any more - #1321 Added missing xml_helper UG page - #1319 Testing/entity - #1316 Refactor TimeTest @@ -195,7 +192,7 @@ PRs merged - #1280 Add contributing reference to user guide - #1273 Fix/timing - #1272 Fix undefined variable "heading" in cli 404 -- #1271 remove inexistent "CodeIgniter\Loader" from AutoloadConfig::classmap +- #1271 remove nonexistent "CodeIgniter\Loader" from AutoloadConfig::classmap - #1269 Release notes & process - #1266 Adjusting the release build scripts - #1265 WIP Fix docs re PHP server diff --git a/user_guide_src/source/changelogs/v4.0.0-alpha.3.rst b/user_guide_src/source/changelogs/v4.0.0-alpha.3.rst index 83213e5e3883..cac7d9153055 100644 --- a/user_guide_src/source/changelogs/v4.0.0-alpha.3.rst +++ b/user_guide_src/source/changelogs/v4.0.0-alpha.3.rst @@ -14,240 +14,236 @@ Changed Files The list of changed files follows, with PR numbers shown. -- admin/ - - framework/* #1553 - - starter/* #1553 - - docbot #1553 - - release* #1484, - - pre-commit #1388 - - README.md #1553 - - setup.sh #1388 +.. code-block:: text -- application / - - Config/ - - Autoload #1396, #1416 - - Mimes #1368, #1465 - - Pager #622 - - Services #1469 - - Filters/Honeypot #1376 - - Views/ - - errors/* #1415, #1413, #1469 - - form.php removed #1442 - -- public / - - index.php #1388, #1457 - -- system / - - Autoloader/ - - Autoloader #1547 - - FileLocator #1547, #1550 - - Cache/ - - Exceptions/CacheException #1525 - - Handlers/FileHandler #1547, #1525 - - Handlers/MemcachedHandler #1383 - - CLI/ - - CLI #1432, #1489 - - Commands/ - - Database/ - - CreateMigration #1374, #1422, #1431 - - MigrateCurrent #1431 - - MigrateLatest #1431 - - MigrateRollback #1431 - - MigrateStatus #1431 - - MigrateVersion #1431 - - Sessions/CrateMigration #1357 - - Config/ - - AutoloadConfig #1416 - - BaseService #1469 - - Mimes #1453 - - Services #1180, #1469 - - Database/ - - BaseBuilder #1335, #1491, #1522 - - BaseConnection #1335, #1407, #1491, #1522 - - BaseResult #1426 - - Config #1465, #1469, #1554 - - Forge #1343, #1449, #1470, #1530 - - MigrationRunner #1371 - - MySQLi/Connection #1335, #1449 - - MySQLi/Forge #1343, #1344, #1530 - - MySQLi/Result #1530 - - Postgre/Connection #1335, #1449 - - Postgre/Forge #1530 - - SQLite3/Connection #1335, #1449 - - SQLite3/Forge #1470, #1547 - - Debug - - Exceptions #1500 - - Toolbar #1370, #1465, #1469, #1547 - - Toolbar/Views/toolbar.tpl #1469 - - Email/ - - Email #1389, #1413, #1438, #1454, #1465, #1469, #1547 - - Events/ - - Events #1465, #1469, #1547 - - Files/ - - File #1399, #1547 - - Format/ - - XMLFormatter #1471 - - Helpers/ - - array_helper #1412 - - filesystem_helper #1547 - - Honeypot/ - - Honeypot #1460 - - HTTP/ - - CURLRequest #1547, #1498 - - DownloadResponse #1375 - - Exceptions/DownloadException #1405 - - Files/FileCollection #1506 - - Files/UploadedFile #1335, #1399, #1500, #1506, #1547 - - IncomingRequest #1445, #1469, #1496 - - Message #1497 - - RedirectResponse #1387, #1451, #1464 - - Response #1456, #1472, #1477, #1486, #1504, #1505, #1497, #622 - - ResponseInterface #1384 - - UploadedFile #1368, #1456 - - URI #1213, #1469, #1508 - - Images/Handlers/ - - ImageMagickHandler #1546 - - Language/ - - en/Cache #1525 - - en/Database #1335 - - en/Filters #1378 - - en/Migrations #1374 - - Language #1480, #1489 - - Log/ - - Handlers/FileHandler #1547 - - Pager/ - - Pager #1213, #622 - - PagerInterface #622 - - PagerRenderer #1213, #622 - - Views/default_full #622 - - Views/default_head #622 - - Views/default_simple #622 - - Router/ - - RouteCollection #1464, #1524 - - RouteCollectionInterface #1406, #1410 - - Router #1523, #1547 - - Session/Handlers/ - - BaseHandler #1180, #1483 - - DatabaseHandler #1180 - - FileHandler #1180, #1547 - - MemcachedHandler #1180 - - RedisHandler #1180 - - Test/ - - CIUnitTestCase #1467 - - FeatureTestCase #1427, #1468 - - Filters/CITestStreamFilter #1465 - - Validation / - - CreditCardRules #1447, #1529 - - FormatRules #1507 - - Rules #1345 - - Validation #1345 - - View/ - - Filters #1469 - - Parser #1417, #1547 - - View #1357, #1377, #1410, #1547 - - bootstrap #1547 - - CodeIgniter #1465, #1505, #1523, 2047b5a, #1547 - - Common #1486, #1496, #1504, #1513 - - ComposerScripts #1469, #1547 - - Controller #1423 - - Entity #1369, #1373 - - Model #1345, #1380, #1373, #1440 - -- tests / - - _support/ - - HTTP/MockResponse #1456 - - _bootstrap.php #1397, #1443 - - Cache/Handlers/ - - FileHandlerTest #1547, #1525 - - MemcachedHandlerTest #1180, #1383 - - RedisHandlerTest #1180, #1481 - - CLI/ - - CLITest #1467, #1489 - - Commands/ - - SessionCommandsTest #1455 - - Database/Live/ - - ConnectTest #1554 - - ForgeTest #1449, #1470 - - HTTP/ - - CURLRequestTest#1498 - - Files/FileCOllectionTest #1506 - - Files/FileMovingTest #1424 - - DownloadResponseTest #1375 - - IncomingRequestTest #1496 - - RedirectResponseTest #1387, #1456 - - ResponseCookieTest #1472, #1509 - - ResponseSendTest #1477, #1486, #1509 - - ResponseTest #1375, #1456, #1472, #1486, #622 - - URITest #1456, #1495 - - Helpers/ - - DateHelperTest #1479 - - I18n/ - - TimeTest #1467, #1473 - - Language/ - - LanguageTest #1480 - - Log/ - - FileHandlerTest #1425 - - Pager/ - - PagerRendererTest #1213, #622 - - PagerTest #622 - - Router/ - - RouteCollectionTest #1438, #1524 - - RouterTest #1438, #1523 - - Session/ - - SessionTest #1180 - - Test/ - - BootstrapFCPATHTest #1397 - - FeatureTestCase #1468 - - TestCaseEmissionsTest #1477 - - TestCaseTest #1390 - - Throttle/ - - ThrottleTest #1398 - - Validation/ - - FormatRulesTest #1507 - - View/ - - ParserTest #1335 - - CodeIgniterTest #1500 - - CommonFunctionsSendTest #1486, #1509 - - CommonFunctionsTest #1180, #1486, #1496 - -- user_guide_src /source/ - - changelogs/ #1385, #1490, #1553 - - concepts/ - - autoloader #1547 - - security #1540 - - services #1469 - - structure #1448 - - database/ - - queries #1407 - - dbmgmt/ - - forge #1470 - - migration #1374, #1385, #1431 - - seeds #1482 - - extending/ - - core_classes #1469 - - helpers/ - - form_helper #1499 - - installation/ - - index #1388 - - libraries/ - - caching #1525 - - pagination #1213 - - validation #27868b, #1540 - - models/ - - entities #1518, #1540 - - outgoing/ - - response #1472, #1494 - - testing/ - - overview #1467 - - tutorial/ - - create_news_item #1442 - - static_pages #1547 - -- / - - composer.json #1388, #1418, #1536, #1553 - - README.md #1553 - - spark 2047b5a - - .travis.yml #1394 + . + ├── admin/ + │ ├── framework/* #1553 + │ ├── starter/* #1553 + │ ├── docbot #1553 + │ ├── release* #1484, + │ ├── pre-commit #1388 + │ ├── README.md #1553 + │ └── setup.sh #1388 + ├── application/ + │ ├── Config/ + │ │ ├── Autoload #1396, #1416 + │ │ ├── Mimes #1368, #1465 + │ │ ├── Pager #622 + │ │ └── Services #1469 + │ ├── Filters/Honeypot #1376 + │ └── Views/ + │ ├── errors/* #1415, #1413, #1469 + │ └── form.php removed #1442 + ├── public/ + │ └── index.php #1388, #1457 + ├── system/ + │ ├── Autoloader/ + │ │ ├── Autoloader #1547 + │ │ └── FileLocator #1547, #1550 + │ ├── Cache/ + │ │ ├── Exceptions/CacheException #1525 + │ │ ├── Handlers/FileHandler #1547, #1525 + │ │ └── Handlers/MemcachedHandler #1383 + │ ├── CLI/ + │ │ └── CLI #1432, #1489 + │ ├── Commands/ + │ │ ├── Database/ + │ │ │ ├── CreateMigration #1374, #1422, #1431 + │ │ │ ├── MigrateCurrent #1431 + │ │ │ ├── MigrateLatest #1431 + │ │ │ ├── MigrateRollback #1431 + │ │ │ ├── MigrateStatus #1431 + │ │ │ └── MigrateVersion #1431 + │ │ └── Sessions/CreateMigration #1357 + │ ├── Config/ + │ │ ├── AutoloadConfig #1416 + │ │ ├── BaseService #1469 + │ │ ├── Mimes #1453 + │ │ └── Services #1180, #1469 + │ ├── Database/ + │ │ ├── BaseBuilder #1335, #1491, #1522 + │ │ ├── BaseConnection #1335, #1407, #1491, #1522 + │ │ ├── BaseResult #1426 + │ │ ├── Config #1465, #1469, #1554 + │ │ ├── Forge #1343, #1449, #1470, #1530 + │ │ ├── MigrationRunner #1371 + │ │ ├── MySQLi/Connection #1335, #1449 + │ │ ├── MySQLi/Forge #1343, #1344, #1530 + │ │ ├── MySQLi/Result #1530 + │ │ ├── Postgre/Connection #1335, #1449 + │ │ ├── Postgre/Forge #1530 + │ │ ├── SQLite3/Connection #1335, #1449 + │ │ └── SQLite3/Forge #1470, #1547 + │ ├── Debug + │ │ ├── Exceptions #1500 + │ │ ├── Toolbar #1370, #1465, #1469, #1547 + │ │ └── Toolbar/Views/toolbar.tpl #1469 + │ ├── Email/ + │ │ └── Email #1389, #1413, #1438, #1454, #1465, #1469, #1547 + │ ├── Events/ + │ │ └── Events #1465, #1469, #1547 + │ ├── Files/ + │ │ └── File #1399, #1547 + │ ├── Format/ + │ │ └── XMLFormatter #1471 + │ ├── Helpers/ + │ │ ├── array_helper #1412 + │ │ └── filesystem_helper #1547 + │ ├── Honeypot/ + │ │ └── Honeypot #1460 + │ ├── HTTP/ + │ │ ├── CURLRequest #1547, #1498 + │ │ ├── DownloadResponse #1375 + │ │ ├── Exceptions/DownloadException #1405 + │ │ ├── Files/FileCollection #1506 + │ │ ├── Files/UploadedFile #1335, #1399, #1500, #1506, #1547 + │ │ ├── IncomingRequest #1445, #1469, #1496 + │ │ ├── Message #1497 + │ │ ├── RedirectResponse #1387, #1451, #1464 + │ │ ├── Response #1456, #1472, #1477, #1486, #1504, #1505, #1497, #622 + │ │ ├── ResponseInterface #1384 + │ │ ├── UploadedFile #1368, #1456 + │ │ └── URI #1213, #1469, #1508 + │ ├── Images/Handlers/ + │ │ └── ImageMagickHandler #1546 + │ ├── Language/ + │ │ ├── en/Cache #1525 + │ │ ├── en/Database #1335 + │ │ ├── en/Filters #1378 + │ │ ├── en/Migrations #1374 + │ │ └── Language #1480, #1489 + │ ├── Log/ + │ │ └── Handlers/FileHandler #1547 + │ ├── Pager/ + │ │ ├── Pager #1213, #622 + │ │ ├── PagerInterface #622 + │ │ ├── PagerRenderer #1213, #622 + │ │ ├── Views/default_full #622 + │ │ ├── Views/default_head #622 + │ │ └── Views/default_simple #622 + │ ├── Router/ + │ │ ├── RouteCollection #1464, #1524 + │ │ ├── RouteCollectionInterface #1406, #1410 + │ │ └── Router #1523, #1547 + │ ├── Session/Handlers/ + │ │ ├── BaseHandler #1180, #1483 + │ │ ├── DatabaseHandler #1180 + │ │ ├── FileHandler #1180, #1547 + │ │ ├── MemcachedHandler #1180 + │ │ └── RedisHandler #1180 + │ ├── Test/ + │ │ ├── CIUnitTestCase #1467 + │ │ ├── FeatureTestCase #1427, #1468 + │ │ └── Filters/CITestStreamFilter #1465 + │ ├── Validation/ + │ │ ├── CreditCardRules #1447, #1529 + │ │ ├── FormatRules #1507 + │ │ ├── Rules #1345 + │ │ └── Validation #1345 + │ ├── View/ + │ │ ├── Filters #1469 + │ │ ├── Parser #1417, #1547 + │ │ └── View #1357, #1377, #1410, #1547 + │ ├── bootstrap #1547 + │ ├── CodeIgniter #1465, #1505, #1523, 2047b5a, #1547 + │ ├── Common #1486, #1496, #1504, #1513 + │ ├── ComposerScripts #1469, #1547 + │ ├── Controller #1423 + │ ├── Entity #1369, #1373 + │ └── Model #1345, #1380, #1373, #1440 + ├── tests/ + │ ├── _support/ + │ │ ├── HTTP/MockResponse #1456 + │ │ └── _bootstrap.php #1397, #1443 + │ ├── Cache/Handlers/ + │ │ ├── FileHandlerTest #1547, #1525 + │ │ ├── MemcachedHandlerTest #1180, #1383 + │ │ └── RedisHandlerTest #1180, #1481 + │ ├── CLI/ + │ │ └── CLITest #1467, #1489 + │ ├── Commands/ + │ │ └── SessionCommandsTest #1455 + │ ├── Database/Live/ + │ │ ├── ConnectTest #1554 + │ │ └── ForgeTest #1449, #1470 + │ ├── HTTP/ + │ │ ├── CURLRequestTest#1498 + │ │ ├── Files/FileCollectionTest #1506 + │ │ ├── Files/FileMovingTest #1424 + │ │ ├── DownloadResponseTest #1375 + │ │ ├── IncomingRequestTest #1496 + │ │ ├── RedirectResponseTest #1387, #1456 + │ │ ├── ResponseCookieTest #1472, #1509 + │ │ ├── ResponseSendTest #1477, #1486, #1509 + │ │ ├── ResponseTest #1375, #1456, #1472, #1486, #622 + │ │ └── URITest #1456, #1495 + │ ├── Helpers/ + │ │ └── DateHelperTest #1479 + │ ├── I18n/ + │ │ └── TimeTest #1467, #1473 + │ ├── Language/ + │ │ └── LanguageTest #1480 + │ ├── Log/ + │ │ └── FileHandlerTest #1425 + │ ├── Pager/ + │ │ ├── PagerRendererTest #1213, #622 + │ │ └── PagerTest #622 + │ ├── Router/ + │ │ ├── RouteCollectionTest #1438, #1524 + │ │ └── RouterTest #1438, #1523 + │ ├── Session/ + │ │ └── SessionTest #1180 + │ ├── Test/ + │ │ ├── BootstrapFCPATHTest #1397 + │ │ ├── FeatureTestCase #1468 + │ │ ├── TestCaseEmissionsTest #1477 + │ │ └── TestCaseTest #1390 + │ ├── Throttle/ + │ │ └── ThrottleTest #1398 + │ ├── Validation/ + │ │ └── FormatRulesTest #1507 + │ ├── View/ + │ │ └── ParserTest #1335 + │ ├── CodeIgniterTest #1500 + │ ├── CommonFunctionsSendTest #1486, #1509 + │ └── CommonFunctionsTest #1180, #1486, #1496 + ├── user_guide_src/source/ + │ ├── changelogs/ #1385, #1490, #1553 + │ ├── concepts/ + │ │ ├── autoloader #1547 + │ │ ├── security #1540 + │ │ ├── services #1469 + │ │ └── structure #1448 + │ ├── database/ + │ │ └── queries #1407 + │ ├── dbmgmt/ + │ │ ├── forge #1470 + │ │ ├── migration #1374, #1385, #1431 + │ │ └── seeds #1482 + │ ├── extending/ + │ │ └── core_classes #1469 + │ ├── helpers/ + │ │ └── form_helper #1499 + │ ├── installation/ + │ │ └── index #1388 + │ ├── libraries/ + │ │ ├── caching #1525 + │ │ ├── pagination #1213 + │ │ └── validation #27868b, #1540 + │ ├── models/ + │ │ └── entities #1518, #1540 + │ ├── outgoing/ + │ │ └── response #1472, #1494 + │ ├── testing/ + │ │ └── overview #1467 + │ └── tutorial/ + │ ├── create_news_item #1442 + │ └── static_pages #1547 + ├── composer.json #1388, #1418, #1536, #1553 + ├── README.md #1553 + ├── spark 2047b5a + └── .travis.yml #1394 PRs merged ---------- @@ -259,7 +255,7 @@ PRs merged - #1547 Change file exists to is file - #1546 ImageMagickHandler::__construct ... - #1540 Update validation class User Guide -- #1530 database performance improvement : use foreach() when possible +- #1530 database performance improvement: use foreach() when possible - 2047b5a Don't run filters when using spark. - #1539 remove mb\_* (mb string usage) in CreditCardRules - #1536 ext-json in composer.json @@ -302,7 +298,7 @@ PRs merged - #1472 HTTP\Response cookie testing & missing functionality - #1471 remove unused local variable $result in XMLFormatter::format() - #1470 Allow create table with array field constraints -- #1469 use static:: instead of self:: for call protected/public functions as well +- #1469 use static:: instead of self:: to call protected/public functions as well - #1468 Fix FeatureTestCaseTest output buffer - #1467 Provide time testing within tolerance - #1466 Fix phpdocs for BaseBuilder @@ -315,7 +311,7 @@ PRs merged - #1456 Beef up HTTP URI & Response testing - #1455 un-ignore app/Database/Migrations directory - #1454 add missing break; in loop at Email::getEncoding() -- #1453 BugFix if there extension has only one mime type +- #1453 BugFix if the extension has only one mime type - #1451 remove unneeded $session->start(); check on RedirectResponse - #1450 phpcbf: fix all at once - #1449 Simplify how to get indexData from mysql/mariadb @@ -340,7 +336,7 @@ PRs merged - #1418 normalize composer.json - #1417 fix Parser::parsePairs always escapes - #1416 remove $psr4['Tests\Support'] definition in application\Config\Autoload -- #1415 remove unneded "defined('BASEPATH') ... +- #1415 remove unneeded "defined('BASEPATH') ... - #1413 set more_entropy = true in all uniqid() usage - #1412 function_exists() typo fixes on array_helper - #1411 add missing break; in loop in View::render() @@ -359,8 +355,8 @@ PRs merged - #1389 Capitalize email filename - #1388 Phpcs Auto-fix on commit - #1387 Redirect to named route -- #1385 Fix migration page; udpate changelog -- #1384 add missing ResponseInterface contants +- #1385 Fix migration page and update changelog +- #1384 add missing ResponseInterface constants - #1383 fix TypeError in MemcachedHandler::__construct() - #1381 Remove unused use statements - #1380 count() improvement, use truthy check @@ -377,9 +373,9 @@ PRs merged - #1360 rm --cached php_errors.log file - #1357 Update template file is not .php compatibility - #1345 is_unique tried to connect to default database instead of defined in DBGroup -- #1344 Not to quote unecessary table options -- #1343 Avoid add two single quote to constraint -- #1335 Review and improvements in databases drivers MySQLi, Postgre and SQLite +- #1344 Do not quote unnecessary table options +- #1343 Avoid adding two single quotes to constraint +- #1335 Review and improvements in database drivers MySQLi, Postgre and SQLite - #1213 URI segment as page number in Pagination - #1180 using HTTP\Request instance to pull ip address - #622 Add Header Link Pagination diff --git a/user_guide_src/source/changelogs/v4.0.0-alpha.4.rst b/user_guide_src/source/changelogs/v4.0.0-alpha.4.rst index 892eaabc99bd..229b1b9f74d2 100644 --- a/user_guide_src/source/changelogs/v4.0.0-alpha.4.rst +++ b/user_guide_src/source/changelogs/v4.0.0-alpha.4.rst @@ -12,8 +12,8 @@ Release Date: Dec 15, 2018 Highlights ---------- -- Refactor for consistency: folder application renamed to app; - constant BASEPATH renamed to SYSTEMPATH +- Refactor for consistency: folder application renamed to **app/**; + constant ``BASEPATH`` renamed to ``SYSTEMPATH`` - Debug toolbar gets its own config, history collector - Numerous corrections and enhancements @@ -22,162 +22,159 @@ Changed Files The list of changed files follows, with PR numbers shown. -- admin/ - - docbot #1573 - - framework/composer.json #1555 - - release #1573 - - release-deploy #1573 - - starter/composer.json #1573, #1600 - -- app/ - - Config/ - - App #1571 - - Autoload #1579 - - ContentSecurityPolicy #1581 - - Events #1571, #1595 - - Paths #1579 - - Routes #1579 - - Services #1579 - - Toolbar #1571, #1579 - - Filters/ - - Toolbar #1571 - - Views/ - - errors/* #1579 - -- public/ - - index #1579 - -- system/ - - Autoloader/ - - Autoloader #1562 - - FileLocator #1562, #1579 - - CLI/ - - CommandRunner #1562 - - Config/ - - AutoloadConfig #1555, #1579 - - BaseConfig #1562 - - Services #1571, #1562 - - Database/ - - BaseBuilder #a0fc68 - - MigrationRunner #1585 - - MySQLi/Connection #1561, #8f205a - - Debug/ - - Collectors/* #1571, #1589, #1579 - - Exceptions #1579 - - Toolbar #1571 - - Views/toolbar.tpl #1571 - - Views/toolbarloader.js #1594 - - Helpers/ - - form_helper #1548 - - url_helper #1588 - - HTTP/ - - ContentSecurityPolicy #1581 - - DownloadResponse - - I18n/ - - Time #1603 - - Language/ - - Language #1587, #1562, #1610 - - en/ - - CLI #1562 - - HTTP #d7dfc5 - - Log/ - - Handlers/FileHandler #1579 - - Logger #1562, #1579 - - Session/ - - Handlers/DatabaseHandler #1598 - - Test/ - - CIUnitTest #1581, #1593, #1579 - - FeatureResponse #1593 - - FeatureTestCase #1593 - - View/ - - View #1571, #1579 - - bootstrap #1579 - - CodeIgniter #ab8b5b, #1579 - - Common #1569, #1563, #1562, #1601, #1579 - - Entity #4c7bfe, #1575 - - Model #1602, #a0fc68 - -- tests/ - - Autoloader/ - - AutolaoderTest #1562, #1579 - - FileLocatorTest #1562, #1579 - - Config/ - - ServicesTest #1562 - - Database/ - - Live/ModelTest #1602, #a0fc68 - - Files/ - - FileTest #1579 - - Helpers/ - - FormHelperTest #1548 - - URLHelperTest #1588 - - HTTP/ - - ContentSecurityPolicyTest #1581 - - DownloadResponseTest #1576, #1579 - - IncomingRequestDetectingTest #1576 - - IncomingRequestTest #1576 - - RedirectResponseTest #1562 - - ResponseTest #1576 - - I18n/ - - TimeDifferenceTest #1603 - - TimeTest #1603 - - Language/ - -LanguageTest #1587, #1610 - - Log/ - - FileHandlerTest #1579 - - Router/ - - RouterCollectionTest #1562 - - RouterTest #1562 - - Test/ - - FeatureResponseTest #1593 - - FeatureTestCaseTest #1593 - - TestCaseTest #1593 - - Validation/ - - ValidationTest #1562 - - View/ - - ParserPluginTest #1562 - - ParserTest #1562 - - ViewTest #1562 - - CodeIgniterTest #1562 - - CommonFunctionsTest #1569, #1562 - - EntityTest #4c7bfe, #1575 - -- user_guide_src/source/ - - cli/ - - cli #1579 - - cli_commands #1579 - - concepts/ - - autoloader #1579 - - mvc #1579 - - services #1579 - - structure #1579 - - database/ - - configuration #1579 - - dbmgt/ - - migration #1579 - - seeds #1579 - - general/ - - common_functions #d7dfc5, #1579 - - configuration #1608 - - errors #1579 - - installation/ - - downloads #1579 - - models/ - - entities #547792, #1575 - - outgoing/ - - localization #1610 - - response #1581, #1579 - - view_parser #1579 - - testing/ - - debugging #1579 - - overview #1593, #1579 - - tutorial/ - - news_section #1586 - - static_pages #1579 - -- composer.json #1555 -- ComposerScripts #1551 -- spark #1579 -- Vagrantfile.dist #1459 +.. code-block:: text + + . + ├── admin/ + │ ├── docbot #1573 + │ ├── framework/composer.json #1555 + │ ├── release #1573 + │ ├── release-deploy #1573 + │ └── starter/composer.json #1573, #1600 + ├── app/ + │ ├── Config/ + │ │ ├── App #1571 + │ │ ├── Autoload #1579 + │ │ ├── ContentSecurityPolicy #1581 + │ │ ├── Events #1571, #1595 + │ │ ├── Paths #1579 + │ │ ├── Routes #1579 + │ │ ├── Services #1579 + │ │ └── Toolbar #1571, #1579 + │ ├── Filters/ + │ │ └── Toolbar #1571 + │ └── Views/ + │ └── errors/* #1579 + ├── public/ + │ └── index #1579 + ├── system/ + │ ├── Autoloader/ + │ │ ├── Autoloader #1562 + │ │ └── FileLocator #1562, #1579 + │ ├── CLI/ + │ │ └── CommandRunner #1562 + │ ├── Config/ + │ │ ├── AutoloadConfig #1555, #1579 + │ │ ├── BaseConfig #1562 + │ │ └── Services #1571, #1562 + │ ├── Database/ + │ │ ├── BaseBuilder #a0fc68 + │ │ ├── MigrationRunner #1585 + │ │ └── MySQLi/Connection #1561, #8f205a + │ ├── Debug/ + │ │ ├── Collectors/* #1571, #1589, #1579 + │ │ ├── Exceptions #1579 + │ │ ├── Toolbar #1571 + │ │ ├── Views/toolbar.tpl #1571 + │ │ └── Views/toolbarloader.js #1594 + │ ├── Helpers/ + │ │ ├── form_helper #1548 + │ │ └── url_helper #1588 + │ ├── HTTP/ + │ │ ├── ContentSecurityPolicy #1581 + │ │ └── DownloadResponse + │ ├── I18n/ + │ │ └── Time #1603 + │ ├── Language/ + │ │ ├── Language #1587, #1562, #1610 + │ │ └── en/ + │ │ ├── CLI #1562 + │ │ └── HTTP #d7dfc5 + │ ├── Log/ + │ │ ├── Handlers/FileHandler #1579 + │ │ └── Logger #1562, #1579 + │ ├── Session/ + │ │ └── Handlers/DatabaseHandler #1598 + │ ├── Test/ + │ │ ├── CIUnitTest #1581, #1593, #1579 + │ │ ├── FeatureResponse #1593 + │ │ └── FeatureTestCase #1593 + │ ├── View/ + │ │ └── View #1571, #1579 + │ ├── bootstrap #1579 + │ ├── CodeIgniter #ab8b5b, #1579 + │ ├── Common #1569, #1563, #1562, #1601, #1579 + │ ├── Entity #4c7bfe, #1575 + │ └── Model #1602, #a0fc68 + ├── tests/ + │ ├── Autoloader/ + │ │ ├── AutoloaderTest #1562, #1579 + │ │ └── FileLocatorTest #1562, #1579 + │ ├── Config/ + │ │ └── ServicesTest #1562 + │ ├── Database/ + │ │ └── Live/ModelTest #1602, #a0fc68 + │ ├── Files/ + │ │ └── FileTest #1579 + │ ├── Helpers/ + │ │ ├── FormHelperTest #1548 + │ │ └── URLHelperTest #1588 + │ ├── HTTP/ + │ │ ├── ContentSecurityPolicyTest #1581 + │ │ ├── DownloadResponseTest #1576, #1579 + │ │ ├── IncomingRequestDetectingTest #1576 + │ │ ├── IncomingRequestTest #1576 + │ │ ├── RedirectResponseTest #1562 + │ │ └── ResponseTest #1576 + │ ├── I18n/ + │ │ ├── TimeDifferenceTest #1603 + │ │ └── TimeTest #1603 + │ ├── Language/ + │ │ └── LanguageTest #1587, #1610 + │ ├── Log/ + │ │ └── FileHandlerTest #1579 + │ ├── Router/ + │ │ ├── RouterCollectionTest #1562 + │ │ └── RouterTest #1562 + │ ├── Test/ + │ │ ├── FeatureResponseTest #1593 + │ │ ├── FeatureTestCaseTest #1593 + │ │ └── TestCaseTest #1593 + │ ├── Validation/ + │ │ └── ValidationTest #1562 + │ ├── View/ + │ │ ├── ParserPluginTest #1562 + │ │ ├── ParserTest #1562 + │ │ └── ViewTest #1562 + │ ├── CodeIgniterTest #1562 + │ ├── CommonFunctionsTest #1569, #1562 + │ └── EntityTest #4c7bfe, #1575 + ├── user_guide_src/source/ + │ ├── cli/ + │ │ ├── cli #1579 + │ │ └── cli_commands #1579 + │ ├── concepts/ + │ │ ├── autoloader #1579 + │ │ ├── mvc #1579 + │ │ ├── services #1579 + │ │ └── structure #1579 + │ ├── database/ + │ │ └── configuration #1579 + │ ├── dbmgt/ + │ │ ├── migration #1579 + │ │ └── seeds #1579 + │ ├── general/ + │ │ ├── common_functions #d7dfc5, #1579 + │ │ ├── configuration #1608 + │ │ └── errors #1579 + │ ├── installation/ + │ │ └── downloads #1579 + │ ├── models/ + │ │ └── entities #547792, #1575 + │ ├── outgoing/ + │ │ ├── localization #1610 + │ │ ├── response #1581, #1579 + │ │ └── view_parser #1579 + │ ├── testing/ + │ │ ├── debugging #1579 + │ │ └── overview #1593, #1579 + │ └── tutorial/ + │ ├── news_section #1586 + │ └── static_pages #1579 + ├── composer.json #1555 + ├── ComposerScripts #1551 + ├── spark #1579 + └── Vagrantfile.dist #1459 PRs merged ---------- @@ -188,7 +185,7 @@ PRs merged - #1606 release framework script clean up - #1603 Flesh out I18n testing - #8f305a Catch mysql connection errors and sanitize username and password -- #1602 Model's first and update didn't work primary key-less tables +- #1602 Model's first and update didn't work with primary key-less tables - #1601 clean up \Config\Services in Common.php - #1600 admin/starter/composer.json clean up - #1598 use $defaultGroup as default value for database session DBGroup @@ -216,8 +213,8 @@ PRs merged - #1562 Integrates Autoloader and FileLocator - #1561 Update Connection.php - #1557 remove \ prefix on use statements -- #1556 using protected intead of public modifier for setUp() function in tests +- #1556 using protected instead of public modifier for setUp() function in tests - #1555 autoload clean up: remove Psr\Log namespace from composer.json - #1551 remove manual define "system/" directory prefix at ComposerScripts -- #1548 allows to set empty html attr +- #1548 allows setting empty html attr - #1459 Add Vagrantfile diff --git a/user_guide_src/source/changelogs/v4.0.0-alpha.5.rst b/user_guide_src/source/changelogs/v4.0.0-alpha.5.rst index 60de564217c4..91eda4fbdef8 100644 --- a/user_guide_src/source/changelogs/v4.0.0-alpha.5.rst +++ b/user_guide_src/source/changelogs/v4.0.0-alpha.5.rst @@ -12,14 +12,15 @@ Release Date: Jan 30, 2019 Highlights ---------- -- added $maxQueries setting to app/Config/Toolbar.php -- updated PHP dependency to 7.2 -- new feature branches have been created for the email and queue modules, so they don't impact the release of 4.0.0 -- dropped several language messages that were unused (eg Migrations.missingTable) and added some new (eg Migrations.invalidType) -- lots of bug fixes, especially for the database support -- provided filters (CSRF, Honeypot, DebugToolbar) have been moved from app/Filters/ to system/Filters/ -- revisited the installation and tutorial sections of the user guide -- code coverage is at 77% ... getting ever closer to our target of 80% :) +- Added ``$maxQueries`` setting to **app/Config/Toolbar.php** +- Updated PHP dependency to 7.2 +- New feature branches have been created for the email and queue modules, so they don't impact the release of 4.0.0 +- Dropped several language messages that were unused (e.g., ``Migrations.missingTable``) + and added some new ones (e.g., ``Migrations.invalidType``) +- Lots of bug fixes, especially for the database support +- Provided filters (``CSRF``, ``Honeypot``, ``DebugToolbar``) have been moved from **app/Filters/** to **system/Filters/** +- Revisited the installation and tutorial sections of the user guide +- Code coverage is at 77% ... getting ever closer to our target of 80% :) We hope this will be the last alpha, and that the next pre-release will be our first beta ... fingers crossed! @@ -28,185 +29,179 @@ Changed Files The list of changed files follows, with PR numbers shown. -- admin/ - - starter/ - - README.md #1637 - - app/Config/Paths.php #1685 - - release-appstarter #1685 +.. code-block:: text -- app/ - - Config/ - - Filters #1686 - - Modules #1665 - - Services #614216 - - Toolbar - -- contributing/ - - guidelines.rst #1671, #1673 - - internals.rst #1671 - -- public/ - - index.php #1648, #1670 - -- system/ - - Autoloader/ - - Autoloader #1665, #1672 - - FileLocator #1665 - - Commands/ - - Database/MigrationRollback #1683 - - Config/ - - BaseConfig #1635 - - BaseService #1635, #1665 - - Paths #1626 - - Services #614216, #3a4ade, #1643 - - View #1616 - - Database/ - - BaseBuilder #1640, #1663, #1677 - - BaseConnection #1677 - - Config #6b8b8b, #1660 - - MigrationRunner #81d371, #1660 - - Query #1677 - - Database/Postgre/ - - Builder #d2b377 - - Debug/Toolbar/Collectors/ - - Logs #1654 - - Views #3a4ade - - Events/ - - Events #1635 - - Exceptions/ - - ConfigException #1660 - - Files/ - - Exceptions/FileException #1636 - - File #1636 - - Filters/ - - Filters #1635, #1625, #6dab8f - - CSRF #1686 - - DebugToolbar #1686 - - Honeypot #1686 - - Helpers/ - - form_helper #1633 - - html_helper #1538 - - xml_helper #1641 - - HTTP/ - - ContentSecurityPolicy #1641, #1642 - - URI #2e698a - - Language/ - - /en/Files #1636 - - Language #1641 - - Log/ - - Handlers/FileHandler #1641 - - Router/ - - RouteCollection #1665, #5951c3 - - Router #9e435c, #7993a7, #1678 - - Session/ - - Handlers/BaseHandler #1684 - - Handlers/FileHandler #1684 - - Handlers/MemcachedHandler #1679 - - Session #1679 - - bootstrap #81d371, #1665 - - Common #1660 - - Entity #1623, #1622 - - Model #1617, #1632, #1656, #1689 - -- tests/ - - README.md #1671 - -- tests/system/ - - API/ - - ResponseTraitTest #1635 - - Autoloader/ - - AutoloaderTest #1665 - - FileLocatorTest #1665, #1686 - - CLI/ - - CommandRunnerTest #1635 - - CommandsTest #1635 - - Config/ - - BaseConfigTest #1635 - - ConfigTest #1643 - - ServicesTest #1635, #1643 - - Database/Builder/ - - AliasTest #bea1dd - - DeleteTest #1677 - - GroupTest #1640 - - InsertTest #1640, #1677 - - LikeTest #1640, #1677 - - SelectTest #1663 - - UpdateTest #1640, #1677 - - WhereTest #1640, #1677 - - Database/Live/ - - AliasTest #1675 - - ConnectTest #1660, #1675 - - ForgeTest #6b8b8b - - InsertTest #1677 - - Migrations/MigrationRunnerTest #1660, #1675 - - ModelTest #1617, #1689 - - Events/ - - EventTest #1635 - - Filters/ - - CSRFTest #1686 - - DebugToolbarTest #1686 - - FiltersTest #1635, #6dab8f, #1686 - - HoneypotTest #1686 - - Helpers/ - - FormHelperTest #1633 - - XMLHelperTest #1641 - - Honeypot/ - - HoneypotTest #1686 - - HTTP/ - - ContentSecurityPolicyTest #1641 - - IncomingRequestTest #1641 - - Language/ - - LanguageTest #1643 - - Router/ - - RouteCollectionTest #5951c3 - - RouterTest #9e435c - - Validation/ - - RulesTest #1689 - - View/ - - ParserPluginTest #1669 - - ParserTest #1669 - -- user_guide_src/ - - - concepts/ - - autoloader #1665 - - structure #1648 - - database/ - - connecting #1660 - - transactions #1645 - - general/ - - configuration #1643 - - managing_apps #5f305a, #1648 - - modules #1613, #1665 - - helpers/ - - form_helper #1633 - - incoming/ - - filters #1686 - - index #4a1886 - - methodspoofing #4a1886 - - installation/ - - index #1690, #1693 - - installing_composer #1673, #1690 - - installing_git #1673, #1690 - - installing_manual #1673, #1690 - - repositories #1673, #1690 - - running #1690, #1691 - - troubleshooting #1690, #1693 - - libraries/ - - honeypot #1686 - - index #1643, #1690 - - throttler #1686 - - tutorial/ - - create_news_item #1693 - - index #1693 - - news_section #1693 - - static_pages #1693 - -- composer.json #1670 -- contributing.md #1670 -- README.md #1670 -- spark #1648 -- .travis.yml #1649, #1670 + . + ├── admin/ + │ ├── starter/ + │ │ ├── README.md #1637 + │ │ └── app/Config/Paths.php #1685 + │ └── release-appstarter #1685 + ├── app/ + │ └── Config/ + │ ├── Filters #1686 + │ ├── Modules #1665 + │ └── Services #614216 + │ └── Toolbar + ├── contributing/ + │ ├── guidelines.rst #1671, #1673 + │ └── internals.rst #1671 + ├── public/ + │ └── index.php #1648, #1670 + ├── system/ + │ ├── Autoloader/ + │ │ ├── Autoloader #1665, #1672 + │ │ └── FileLocator #1665 + │ ├── Commands/ + │ │ └── Database/MigrationRollback #1683 + │ ├── Config/ + │ │ ├── BaseConfig #1635 + │ │ ├── BaseService #1635, #1665 + │ │ ├── Paths #1626 + │ │ ├── Services #614216, #3a4ade, #1643 + │ │ └── View #1616 + │ ├── Database/ + │ │ ├── BaseBuilder #1640, #1663, #1677 + │ │ ├── BaseConnection #1677 + │ │ ├── Config #6b8b8b, #1660 + │ │ ├── MigrationRunner #81d371, #1660 + │ │ └── Query #1677 + │ ├── Database/Postgre/ + │ │ └── Builder #d2b377 + │ ├── Debug/Toolbar/Collectors/ + │ │ ├── Logs #1654 + │ │ └── Views #3a4ade + │ ├── Events/ + │ │ └── Events #1635 + │ ├── Exceptions/ + │ │ └── ConfigException #1660 + │ ├── Files/ + │ │ ├── Exceptions/FileException #1636 + │ │ └── File #1636 + │ ├── Filters/ + │ │ ├── Filters #1635, #1625, #6dab8f + │ │ ├── CSRF #1686 + │ │ ├── DebugToolbar #1686 + │ │ └── Honeypot #1686 + │ ├── Helpers/ + │ │ ├── form_helper #1633 + │ │ ├── html_helper #1538 + │ │ └── xml_helper #1641 + │ ├── HTTP/ + │ │ ├── ContentSecurityPolicy #1641, #1642 + │ │ └── URI #2e698a + │ ├── Language/ + │ │ ├── /en/Files #1636 + │ │ └── Language #1641 + │ ├── Log/ + │ │ └── Handlers/FileHandler #1641 + │ ├── Router/ + │ │ ├── RouteCollection #1665, #5951c3 + │ │ └── Router #9e435c, #7993a7, #1678 + │ ├── Session/ + │ │ ├── Handlers/BaseHandler #1684 + │ │ ├── Handlers/FileHandler #1684 + │ │ ├── Handlers/MemcachedHandler #1679 + │ │ └── Session #1679 + │ ├── bootstrap #81d371, #1665 + │ ├── Common #1660 + │ ├── Entity #1623, #1622 + │ └── Model #1617, #1632, #1656, #1689 + ├── tests/ + │ └── README.md #1671 + ├── tests/system/ + │ ├── API/ + │ │ └── ResponseTraitTest #1635 + │ ├── Autoloader/ + │ │ ├── AutoloaderTest #1665 + │ │ └── FileLocatorTest #1665, #1686 + │ ├── CLI/ + │ │ ├── CommandRunnerTest #1635 + │ │ └── CommandsTest #1635 + │ ├── Config/ + │ │ ├── BaseConfigTest #1635 + │ │ ├── ConfigTest #1643 + │ │ └── ServicesTest #1635, #1643 + │ ├── Database/Builder/ + │ │ ├── AliasTest #bea1dd + │ │ ├── DeleteTest #1677 + │ │ ├── GroupTest #1640 + │ │ ├── InsertTest #1640, #1677 + │ │ ├── LikeTest #1640, #1677 + │ │ ├── SelectTest #1663 + │ │ ├── UpdateTest #1640, #1677 + │ │ └── WhereTest #1640, #1677 + │ ├── Database/Live/ + │ │ ├── AliasTest #1675 + │ │ ├── ConnectTest #1660, #1675 + │ │ ├── ForgeTest #6b8b8b + │ │ ├── InsertTest #1677 + │ │ ├── Migrations/MigrationRunnerTest #1660, #1675 + │ │ └── ModelTest #1617, #1689 + │ ├── Events/ + │ │ └── EventTest #1635 + │ ├── Filters/ + │ │ ├── CSRFTest #1686 + │ │ ├── DebugToolbarTest #1686 + │ │ ├── FiltersTest #1635, #6dab8f, #1686 + │ │ └── HoneypotTest #1686 + │ ├── Helpers/ + │ │ ├── FormHelperTest #1633 + │ │ └── XMLHelperTest #1641 + │ ├── Honeypot/ + │ │ └── HoneypotTest #1686 + │ ├── HTTP/ + │ │ ├── ContentSecurityPolicyTest #1641 + │ │ └── IncomingRequestTest #1641 + │ ├── Language/ + │ │ └── LanguageTest #1643 + │ ├── Router/ + │ │ ├── RouteCollectionTest #5951c3 + │ │ └── RouterTest #9e435c + │ ├── Validation/ + │ │ └── RulesTest #1689 + │ └── View/ + │ ├── ParserPluginTest #1669 + │ └── ParserTest #1669 + ├── user_guide_src/ + │ ├── concepts/ + │ │ ├── autoloader #1665 + │ │ └── structure #1648 + │ ├── database/ + │ │ ├── connecting #1660 + │ │ └── transactions #1645 + │ ├── general/ + │ │ ├── configuration #1643 + │ │ ├── managing_apps #5f305a, #1648 + │ │ └── modules #1613, #1665 + │ ├── helpers/ + │ │ └── form_helper #1633 + │ ├── incoming/ + │ │ ├── filters #1686 + │ │ ├── index #4a1886 + │ │ └── methodspoofing #4a1886 + │ ├── installation/ + │ │ ├── index #1690, #1693 + │ │ ├── installing_composer #1673, #1690 + │ │ ├── installing_git #1673, #1690 + │ │ ├── installing_manual #1673, #1690 + │ │ ├── repositories #1673, #1690 + │ │ ├── running #1690, #1691 + │ │ └── troubleshooting #1690, #1693 + │ ├── libraries/ + │ │ ├── honeypot #1686 + │ │ ├── index #1643, #1690 + │ │ └── throttler #1686 + │ └── tutorial/ + │ ├── create_news_item #1693 + │ ├── index #1693 + │ ├── news_section #1693 + │ └── static_pages #1693 + ├── composer.json #1670 + ├── contributing.md #1670 + ├── README.md #1670 + ├── spark #1648 + └── .travis.yml #1649, #1670 PRs merged ---------- @@ -222,7 +217,7 @@ PRs merged - #1685 Fix admin - app starter creation - #1684 Updating session id cleanup for filehandler - #1683 Fix migrate:refresh bug -- #d2b377 Fix Postgres replace command to work new way of storing binds +- #d2b377 Fix Postgres replace command to work with the new way of storing binds - #4a1886 Document method spoofing - #2e698a urldecode URI keys as well as values. - #1679 save_path - for memcached @@ -239,11 +234,11 @@ PRs merged - #6dab8f Filters match case-insensitively - #1663 Fix bind issue that occurred when using whereIn - #1660 Migrations Tests and database tweaks -- #1656 DBGroup in __get(), allows to validate "database" data outside the model +- #1656 DBGroup in __get() allows validating "database" data outside the model - #1654 Toolbar - Return Logger::$logCache items - #1649 remove php 7.3 from "allow_failures" in travis config - #1648 Update "managing apps" docs -- #1645 Fix transaction enabling confusing (docu) +- #1645 Fix confusion about enabling transactions (docu) - #1643 Remove email module - #1642 CSP nonce attribute value in "" - #81d371 Safety checks for config files during autoload and migrations @@ -263,7 +258,7 @@ PRs merged - #9e435c TranslateURIDashes fix - #1626 clean up Paths::$viewDirectory property - #1625 After matches is not set empty -- #1623 Property was not cast if was defined as nullable +- #1623 Property was not cast if it was defined as nullable - #1622 Nullable support for __set - #1617 countAllResults() should respect soft deletes - #1616 Fix View config merge order diff --git a/user_guide_src/source/changelogs/v4.0.0-beta.1.rst b/user_guide_src/source/changelogs/v4.0.0-beta.1.rst index b6e8a2af89ca..b31131bd885b 100644 --- a/user_guide_src/source/changelogs/v4.0.0-beta.1.rst +++ b/user_guide_src/source/changelogs/v4.0.0-beta.1.rst @@ -10,7 +10,7 @@ Release Date: Mar 1, 2019 Highlights ---------- -- New View Layouts provide simple way to create site site view templates. +- New View Layouts provide a simple way to create site view templates. - Fixed user guide CSS for proper wide table display - Converted UploadedFile to use system messages - Numerous database, migration & model bugs fixed @@ -19,130 +19,129 @@ Highlights New Messages ------------ -- Database.tableNotFound -- HTTP.uploadErr... +- ``Database.tableNotFound`` +- ``HTTP.uploadErr...`` App Changes ----------- -- app/Config/Cache has new setting: database -- app/Views/welcome_message has logo tinted -- composer.json has a case correction -- env adds CI_ENVIRONMENT suggestion +- **app/Config/Cache** has a new setting: database +- **app/Views/welcome_message** has logo tinted +- **composer.json** has a case correction +- **.env** adds ``CI_ENVIRONMENT`` suggestion Changed Files ------------- The list of changed files follows, with PR numbers shown. -- app/ - - Config/ - - Cache #1719 - - Views/ - - welome_message #1774 - -- system/ - - Cache/Handlers/ - - RedisHandler #1719, #1723 - - Config/ - - Config #37dbc1 - - Services #1704, #37dbc1 - - Database/ - - Exceptions/DatabaseException #1739 - - Postgre/ - - Builder #1733 - - SQLite3/ - - Connection #1739 - - Forge #1739 - - Table #1739 - - BaseBuilder #36fbb8, #549d7d - - BaseConnection #549d7d, #1739 - - Forge #1739 - - MigrationRunner #1743 - - Query #36fbb8 - - Seeder #1722 - - Debug/ - - Exceptions #1704 - - Files/ - - UploadedFile #1708 - - Helpers/ - - date_helper #1768 - - number_helper #1768 - - security_helper #1768 - - text_helper #1768 - - url_helper #1768 - - HTTP/ - - Request #1725 - - Language/en/ - - Database #1739 - - HTTP #1708 - - View #1757 - - Router/ - - RouteCollection #1709, #1732 - - Router #1764 - - Test/ - - ControllerResponse #1740 - - ControllerTester #1740 - - DOMParser #1740 - - FeatureResponse #1740 - - Validation/ - - Rules #1738, #1743 - - Validation #37dbc1, #1763 - - View/ - - View #1729 - - Common #1741 - - Entity #6e549a, #1739 - - Model #4f4a37, #6e549a, #37dbc1, #1712, #1763 - -- tests/system/ - - Database/ - - BaseQueryTest #36fbb8 - - Live/ - - SQLite3/AlterTableTest #1739, #1740 - - ForgeTest #1739, #1745 - - ModelTest #37dbc1, #4ff1f5, #1763 - - Migrations/MigrationRunnerTest #1743 - - Helpers/ - - FilesystemHelperTest #1740 - - I18n/ - - TimeTest # 1736 - - Test/ - - DOMParserTest #1740 - - Validation/ - - ValidationTest #1763 - - View/ - - ViewTest #1729 - - EntityTest #6e549a, #1736 - -- user_guide_src/ - - _themes/.../ - - citheme.css #1696 - - changelogs/ - - v4.0.0-alpha.5 #1699 - - database/ - - migrate #1696 - - dbmgmt/ - - forge #1751 - - installation/ - - install_manual #1699 - - running #1750 - - intro/ - - psr #1752 - - libraries/ - - caching #1719 - - validation #1742 - - models/ - - entities #1744 - - outgoing/ - - index #1729 - - view_layouts #1729 - - testing/ - - controllers #1740 - - tutorial/ - - static_pages #1763 - -- composer.json #1755 -- .env #1749 +.. code-block:: text + + . + ├── app/ + │ ├── Config/ + │ │ └── Cache #1719 + │ └── Views/ + │ └── welcome_message #1774 + ├── system/ + │ ├── Cache/Handlers/ + │ │ └── RedisHandler #1719, #1723 + │ ├── Config/ + │ │ ├── Config #37dbc1 + │ │ └── Services #1704, #37dbc1 + │ ├── Database/ + │ │ ├── Exceptions/DatabaseException #1739 + │ │ ├── Postgre/ + │ │ │ └── Builder #1733 + │ │ ├── SQLite3/ + │ │ │ ├── Connection #1739 + │ │ │ ├── Forge #1739 + │ │ │ └── Table #1739 + │ │ ├── BaseBuilder #36fbb8, #549d7d + │ │ ├── BaseConnection #549d7d, #1739 + │ │ ├── Forge #1739 + │ │ ├── MigrationRunner #1743 + │ │ ├── Query #36fbb8 + │ │ └── Seeder #1722 + │ ├── Debug/ + │ │ └── Exceptions #1704 + │ ├── Files/ + │ │ └── UploadedFile #1708 + │ ├── Helpers/ + │ │ ├── date_helper #1768 + │ │ ├── number_helper #1768 + │ │ ├── security_helper #1768 + │ │ ├── text_helper #1768 + │ │ └── url_helper #1768 + │ ├── HTTP/ + │ │ └── Request #1725 + │ ├── Language/en/ + │ │ ├── Database #1739 + │ │ ├── HTTP #1708 + │ │ └── View #1757 + │ ├── Router/ + │ │ ├── RouteCollection #1709, #1732 + │ │ └── Router #1764 + │ ├── Test/ + │ │ ├── ControllerResponse #1740 + │ │ ├── ControllerTester #1740 + │ │ ├── DOMParser #1740 + │ │ └── FeatureResponse #1740 + │ ├── Validation/ + │ │ ├── Rules #1738, #1743 + │ │ └── Validation #37dbc1, #1763 + │ ├── View/ + │ │ └── View #1729 + │ ├── Common #1741 + │ ├── Entity #6e549a, #1739 + │ └── Model #4f4a37, #6e549a, #37dbc1, #1712, #1763 + ├── tests/system/ + │ ├── Database/ + │ │ ├── BaseQueryTest #36fbb8 + │ │ ├── Live/ + │ │ │ ├── SQLite3/AlterTableTest #1739, #1740 + │ │ │ ├── ForgeTest #1739, #1745 + │ │ │ └── ModelTest #37dbc1, #4ff1f5, #1763 + │ │ └── Migrations/MigrationRunnerTest #1743 + │ ├── Helpers/ + │ │ └── FilesystemHelperTest #1740 + │ ├── I18n/ + │ │ └── TimeTest # 1736 + │ ├── Test/ + │ │ └── DOMParserTest #1740 + │ ├── Validation/ + │ │ └── ValidationTest #1763 + │ ├── View/ + │ │ └── ViewTest #1729 + │ └── EntityTest #6e549a, #1736 + ├── user_guide_src/ + │ ├── _themes/.../ + │ │ └── citheme.css #1696 + │ ├── changelogs/ + │ │ └── v4.0.0-alpha.5 #1699 + │ ├── database/ + │ │ └── migrate #1696 + │ ├── dbmgmt/ + │ │ └── forge #1751 + │ ├── installation/ + │ │ ├── install_manual #1699 + │ │ └── running #1750 + │ ├── intro/ + │ │ └── psr #1752 + │ ├── libraries/ + │ │ ├── caching #1719 + │ │ └── validation #1742 + │ ├── models/ + │ │ └── entities #1744 + │ ├── outgoing/ + │ │ ├── index #1729 + │ │ └── view_layouts #1729 + │ ├── testing/ + │ │ └── controllers #1740 + │ └── tutorial/ + │ └── static_pages #1763 + ├── composer.json #1755 + └── .env #1749 PRs merged ---------- @@ -171,9 +170,9 @@ PRs merged - #1732 Don't check from CLI in Routes. Fixes #1724 - #1729 New View Layout functionality for simple template - #1725 Update Request.php -- #1723 Log an error if redis authentication is failed +- #1723 Log an error if redis authentication fails - #1722 Seeder adds default namespace to seeds -- #1719 Update Cache RedisHandler to support select database +- #1719 Update Cache RedisHandler to support selecting a database - #4ff1f5 Additional tests for inserts and required validation failing (#1717) - #549d7d Another try at getting escaping working correctly both when in and out of models - #1712 Minor readability changes diff --git a/user_guide_src/source/changelogs/v4.0.0-beta.2.rst b/user_guide_src/source/changelogs/v4.0.0-beta.2.rst index 37542ee0761b..fb6b7a31a278 100644 --- a/user_guide_src/source/changelogs/v4.0.0-beta.2.rst +++ b/user_guide_src/source/changelogs/v4.0.0-beta.2.rst @@ -10,192 +10,190 @@ Release Date: April 4, 2019 Highlights ---------- -- A number of fixes & improvements, importantly for the Model and testing classes +- A number of fixes & improvements, importantly for the ``Model`` and testing classes - Models now require a primary key - Generated API docs accessible at https://codeigniter4.github.io/api/ - Validation rules have been enhanced -- .htaccess beefed up +- **.htaccess** beefed up New messages ------------ -- Database.noPrimaryKey, forFindColumnHaveMultipleColumns, Database.forEmptyInputGiven +- ``Database.noPrimaryKey`` +- ``Database.forFindColumnHaveMultipleColumns`` +- ``Database.forEmptyInputGiven`` App Changes ----------- -- updated app/Config/Events -- added app/Controllers/BaseController -- added tests/ folder for unit testing -- added phpunit.xml.dist for unit testing configuration +- Updated **app/Config/Events** +- Added **app/Controllers/BaseController** +- Added **tests/** folder for unit testing +- Added **phpunit.xml.dist** for unit testing configuration Changed Files ------------- The list of changed files follows, with PR numbers shown. -- .htaccess #1900 +.. code-block:: text -- app/ - - Config/ - - Events #1856 - - Controllers/ - - BaseController #1847 - - Home #1847 - -- contributing/ - - README.rst #1846 - - styleguide #1872 - -- contributing.md #1846 - -- phpdoc.dist.xml #1872 - -- system/ - - Autoloader/ - - FileLocator #1860 - - Cache/Handlers/ - - FileHandler #1895 - - MemcachedHandler #1895 - - PredisHandler #1895 - - RedisHandler #1863, #1895 - - WincacheHandler #1895 - - CLI/ - - CLI #1891, #1910 - - Commands/ - - Server/Serve #1893 - - Utilities/Routes #1859 - - Config/ - - BaseConfig #1811 - - Routes #1847, #1850 - - Database/ - - BaseBuilder $1776, #1902 - - BaseConnection #1899 - - Forge #1844, #1899 - - MigrationRunner #1860, #1865 - - MySQLi/Connection #1896 - - MySQLi/Forge #1899 - - Postgre/Builder #1902 - - Postgre/Forge #1899 - - Query #1805, #1771 - - SQLite3/Builder #1902 - - SQLite3/Forge #1899 - - Debug/ - - Toolbar/Collectors/History #1869 - - Toolbar #1897 - - Events/ - - Events #1867 - - Exceptions/ - - ModelException #1829 - - PageNotFoundException #1844 - - Files/ - - File #1809, #1854 - - Helpers/ - - date_helper #d08b68 - - form_helper #1803 - - html_helper #1803 - - number_helper #d08b68, #1803 - - security_helper #d08b68 - - text_helper #d08b68, #1803 - - url_helper #d08b68, #1803 - - xml_helper #1803 - - Honeypot/ - - Honeypot #1894 - - HTTP/ - - Header #1769 - - IncomingRequest #1831 - - Language/en/ - - Database #1829, #1861, #1902 - - Router/ - - RouteCollection #1769 - - Router #1839, #1882 - - Session/ - - Session #1769 - - Test/ - - ControllerTester #1769, #1848, #1855 - - DOMParser #1848 - - Validation/ - - FormatRules #1762, #1863 - - Rules #1791, #1814, #1818, #1862 - - Validation #1769 - - Views/list #1828 - - View/ - - Filters #1769 - - Parser #1769 - - View #1769, #1827 - - CodeIgniter #1769, #1804, #1590 - - Common #1802, #895ae0 - - ComposerScripts #1804 - - Controller #1769, #1850 - - Entity #1769, #1804 - - Model #1793, #1769, #1804, #1808, #1812, #1813, #1817, #1829, #1746, #1861 - -- tests/system/ - - Cache/ - - Handlers/ - - FileHandlerTest #1796, #1895 - - MemcachedHandlerTest #1895 - - RedisHandlerTest #1895 - - CacheFactoryTest #1796 - - CLI/ - - CLITest #1910 - - Config/ - - BaseConfigTest #1811 - - ConfigTest #1811 - - Database/ - - Builder/EmptyTest #1902 - - Builder/SelectTest #1902 - - Live/ModelTest #1817, #1829, #1861 - - Live/WhereTest #1906 - - Events/ - - EventsTest #1867 - - HTTP/ - - ContentSecurityPolicyTest #1848 - - Router/ - - RouteCollectionTest #1822, #1912, #1913 - - Test/ - - ControllerTesterTest #1848, #1855 - - DOMParserTest #1848 - - Validation/ - - FormatRulesTest #1762 - - RulesTest #1791 - - View/ - - ViewTest #1827, #1836 - - ControllerTest #1850 - -- user_guide_src/ - - cli/ - - cli_commands #1777 - - cli_library #1892, #1910 - - concepts/ - - services #1811 - - database/ - - examples #1794 - - dbmgmt/ - - forge #1844, #1899 - - migration #1860, #1865 - - extending/ - - basecontroller #1847 - - core_classes #1847 - - general/ - - common_functions #1802, #1895 - - helpers/ - - number_helper #d08b68 - - url_helper #1803 - - incoming/ - - routing #1908 - - libraries/ - - caching #1895 - - files #1790, #1854 - - pagination #1823 - - sessions #1843 - - validation #1814, #1828, #1862 - - models/ - - models #1817, #1820, #1829, #1746, #1861 - - outgoing/ - - view_layouts #1827 - - testing/ - - controllers #1848 + . + ├── .htaccess #1900 + ├── app/ + │ ├── Config/ + │ │ └── Events #1856 + │ └── Controllers/ + │ ├── BaseController #1847 + │ └── Home #1847 + ├── contributing/ + │ ├── README.rst #1846 + │ └── styleguide #1872 + ├── contributing.md #1846 + ├── phpdoc.dist.xml #1872 + ├── system/ + │ ├── Autoloader/ + │ │ └── FileLocator #1860 + │ ├── Cache/Handlers/ + │ │ ├── FileHandler #1895 + │ │ ├── MemcachedHandler #1895 + │ │ ├── PredisHandler #1895 + │ │ ├── RedisHandler #1863, #1895 + │ │ └── WincacheHandler #1895 + │ ├── CLI/ + │ │ └── CLI #1891, #1910 + │ ├── Commands/ + │ │ ├── Server/Serve #1893 + │ │ └── Utilities/Routes #1859 + │ ├── Config/ + │ │ ├── BaseConfig #1811 + │ │ └── Routes #1847, #1850 + │ ├── Database/ + │ │ ├── BaseBuilder $1776, #1902 + │ │ ├── BaseConnection #1899 + │ │ ├── Forge #1844, #1899 + │ │ ├── MigrationRunner #1860, #1865 + │ │ ├── MySQLi/Connection #1896 + │ │ ├── MySQLi/Forge #1899 + │ │ ├── Postgre/Builder #1902 + │ │ ├── Postgre/Forge #1899 + │ │ ├── Query #1805, #1771 + │ │ ├── SQLite3/Builder #1902 + │ │ └── SQLite3/Forge #1899 + │ ├── Debug/ + │ │ ├── Toolbar/Collectors/History #1869 + │ │ └── Toolbar #1897 + │ ├── Events/ + │ │ └── Events #1867 + │ ├── Exceptions/ + │ │ ├── ModelException #1829 + │ │ └── PageNotFoundException #1844 + │ ├── Files/ + │ │ └── File #1809, #1854 + │ ├── Helpers/ + │ │ ├── date_helper #d08b68 + │ │ ├── form_helper #1803 + │ │ ├── html_helper #1803 + │ │ ├── number_helper #d08b68, #1803 + │ │ ├── security_helper #d08b68 + │ │ ├── text_helper #d08b68, #1803 + │ │ ├── url_helper #d08b68, #1803 + │ │ └── xml_helper #1803 + │ ├── Honeypot/ + │ │ └── Honeypot #1894 + │ ├── HTTP/ + │ │ ├── Header #1769 + │ │ └── IncomingRequest #1831 + │ ├── Language/en/ + │ │ └── Database #1829, #1861, #1902 + │ ├── Router/ + │ │ ├── RouteCollection #1769 + │ │ └── Router #1839, #1882 + │ ├── Session/ + │ │ └── Session #1769 + │ ├── Test/ + │ │ ├── ControllerTester #1769, #1848, #1855 + │ │ └── DOMParser #1848 + │ ├── Validation/ + │ │ ├── FormatRules #1762, #1863 + │ │ ├── Rules #1791, #1814, #1818, #1862 + │ │ ├── Validation #1769 + │ │ └── Views/list #1828 + │ ├── View/ + │ │ ├── Filters #1769 + │ │ ├── Parser #1769 + │ │ └── View #1769, #1827 + │ ├── CodeIgniter #1769, #1804, #1590 + │ ├── Common #1802, #895ae0 + │ ├── ComposerScripts #1804 + │ ├── Controller #1769, #1850 + │ ├── Entity #1769, #1804 + │ └── Model #1793, #1769, #1804, #1808, #1812, #1813, #1817, #1829, #1746, #1861 + ├── tests/system/ + │ ├── Cache/ + │ │ ├── Handlers/ + │ │ │ ├── FileHandlerTest #1796, #1895 + │ │ │ ├── MemcachedHandlerTest #1895 + │ │ │ └── RedisHandlerTest #1895 + │ │ └── CacheFactoryTest #1796 + │ ├── CLI/ + │ │ └── CLITest #1910 + │ ├── Config/ + │ │ ├── BaseConfigTest #1811 + │ │ └── ConfigTest #1811 + │ ├── Database/ + │ │ ├── Builder/EmptyTest #1902 + │ │ ├── Builder/SelectTest #1902 + │ │ ├── Live/ModelTest #1817, #1829, #1861 + │ │ └── Live/WhereTest #1906 + │ ├── Events/ + │ │ └── EventsTest #1867 + │ ├── HTTP/ + │ │ └── ContentSecurityPolicyTest #1848 + │ ├── Router/ + │ │ └── RouteCollectionTest #1822, #1912, #1913 + │ ├── Test/ + │ │ ├── ControllerTesterTest #1848, #1855 + │ │ └── DOMParserTest #1848 + │ ├── Validation/ + │ │ ├── FormatRulesTest #1762 + │ │ └── RulesTest #1791 + │ ├── View/ + │ │ └── ViewTest #1827, #1836 + │ └── ControllerTest #1850 + └── user_guide_src/ + ├── cli/ + │ ├── cli_commands #1777 + │ └── cli_library #1892, #1910 + ├── concepts/ + │ └── services #1811 + ├── database/ + │ └── examples #1794 + ├── dbmgmt/ + │ ├── forge #1844, #1899 + │ └── migration #1860, #1865 + ├── extending/ + │ ├── basecontroller #1847 + │ └── core_classes #1847 + ├── general/ + │ └── common_functions #1802, #1895 + ├── helpers/ + │ ├── number_helper #d08b68 + │ └── url_helper #1803 + ├── incoming/ + │ └── routing #1908 + ├── libraries/ + │ ├── caching #1895 + │ ├── files #1790, #1854 + │ ├── pagination #1823 + │ ├── sessions #1843 + │ └── validation #1814, #1828, #1862 + ├── models/ + │ └── models #1817, #1820, #1829, #1746, #1861 + ├── outgoing/ + │ └── view_layouts #1827 + └── testing/ + └── controllers #1848 PRs merged ---------- @@ -210,7 +208,7 @@ PRs merged - #1899 Database Forge correction - #1897 Toolbar fix w.r.t #1779 - #1896 Mysql connection issue with SSL cert (#1219) -- #1894 Typos fixings +- #1894 Typo fixes - #1893 Fix spark serve with remove escapeshellarg() - #1892 Add CLI background color list to the user guide - #1891 Allow CLI::strlen null parameter @@ -218,7 +216,7 @@ PRs merged - #1882 Router Changes w.r.t #1541 - #1873-1889 Docs: move namespace declarations & add missing class docblocks - #1872 Docs: fix phpdoc config -- #1871 Unmatched Cache Library `get()` return null +- #1871 Unmatched Cache Library ``get()`` return null - #1869 History::SetFiles check #1778 - #1863 Module wise Typos changes - #1861 New method Find Column w.r.t. #1619 @@ -239,9 +237,9 @@ PRs merged - #1844 Model Fix - #1843 Replace CI3 $this->input reference - #1842 Exception 'forPageNotFound' missing default value -- #1839 Dont replace slashes with backslashes in the to route +- #1839 Don't replace slashes with backslashes in the to route - #1836 Test: Improve View\View coverage -- #1831 Fix some PHPDoc comments error +- #1831 Fix some PHPDoc comment errors - #1829 Improve: Models now require a primary key. This is partially to keep the code ... - #1828 Fix: Remove bootstrap styles from validation views. - #1827 Fix: Adding include method to View library to render view partials... views. @@ -251,12 +249,12 @@ PRs merged - #1819 Improve: Add apibot for API docs using phpDocumentor - #1818 Improve: Code improvement in exact_length Rule - #1817 Improve: Model setValidationMessage functions introduced -- #895ae0 Fix: Start session whenver using the old command +- #895ae0 Fix: Start session whenever using the old command - #1814 Enhance: extended exact_length[1,3,5] - #1813 Fix: Model::save fix for earlier PRs - #1812 Test: Improve Filters coverage - #1811 Test: Config module coverage improved -- #1809 Fix file move failed. Fixex #1785 +- #1809 Fix failed file move. Fixes #1785 - #1808 Fix: Fix save method return value - #1805 Docs: Query Class Changes - #1804 Docs: Some Base Functional Changes diff --git a/user_guide_src/source/changelogs/v4.0.0-beta.3.rst b/user_guide_src/source/changelogs/v4.0.0-beta.3.rst index f2f80b6d34c7..d26beae6beb7 100644 --- a/user_guide_src/source/changelogs/v4.0.0-beta.3.rst +++ b/user_guide_src/source/changelogs/v4.0.0-beta.3.rst @@ -16,135 +16,133 @@ Highlights New Messages ------------ -- Database.FieldNotExists -- Validation.equals, not_equals +- ``Database.fieldNotExists`` +- ``Validation.equals`` +- ``Validation.not_equals`` App Changes ----------- -- Removed $salt config item in app/Config/App -- Enabled migrations by default in app/Config/Migrations -- Simplified public/.htaccess +- Removed ``$salt`` config item in **app/Config/App** +- Enabled migrations by default in **app/Config/Migrations** +- Simplified **public/.htaccess** Changed Files ------------- The list of changed files follows, with PR numbers shown. -- admin/ - - framework/composer.json #1935 - - starter/composer.json #1935 - -- app/ - - Config/ - - App #1973 - - Migrations #1973 - -- public/ - - .htaccess #1973 - -- system/ - - API/ - - ResponseTrait #1962 - - Commands/ - - Server/rewrite #1925 - - Config/ - - AutoloadConfig #1974 - - BaseConfig #1947 - - Database/ #1938 - - BaseBuilder #1923, #1933, #1950 - - BaseConnection #1950 - - BaseResult #1917 - - BaseUtils #1917 - - Forge #1917 - - SQLite3/ - - Connection #1917 - - Result #1917 - - Debug/ - - Toolbar #1916 - - Toolbar/Collectors/ - - BaseCollector #1972 - - Config #1973 - - History #1945 - - Routes #1949 - - Toolbar/Views/ - - _config.tpl.php #1973 - - toolbar.tpl.php #1972 - - toolbarloader.js #1931, #1961 - - Exceptions/ - - EntityException #1927 - - Filters/ - Filters #1970, #1985 - - Format/ - - FormatterInterface #1918 - - JSONFormatter #1918 - - XMLFormatter #1918 - - HTTP/ - - CLIRequest #1956 - - CURLRequest #1915 - - Images/Handlers/ - - BaseHandler #1956 - - Language/en/ - - Database #1917 - - Validation #1952 - - Router/ - - Router #1968 - - RouteCollection #1977 - - Session/Handlers/ - - RedisHandler #1980 - - Test/ - - FeatureResponse #1977 - - FeatureTestCase #1977 - - Validation/ - - FormatRules #1957 - - Rules #1952 - - View/ - - Table #1984 - - Entity #1911, #1927, #1943, #1950, #1955 - - Model #1930, #1943, #1963, #1981 - -- tests/system/ - - Config/ - - BaseConfigTest #1947 - - Database/ - - BaseQueryTest #1917 - - Live/ - - DbUtilsTest #1917, #1943 - - ForgeTest #1917 - - GetTest #1917, #1943 - - ModelTest #1930, #1943, #1981 - - Migrations/ - - MigrationRunnerTest #1917 - - MigrationTest #1943 - - Filters/ - - FilterTest #1985 - - Test/ - - FeatureTestCaseTest #1977 - - Validation/ - - FormatRulesTest #1957 - - RulesTest #1952, #cbe4b1d - - View/ - - TableTest #1978, #1984 - - EntityTest #1911 - -- user_guide_src/ - - dbmgmt/ - - migrations #1973 - - installation/ - - installing_composer #1926 - - running #1935 - - libraries/ - - validation #1952, #1954, #1957 - - outgoing/ - - index #1978 - - table #1978, #1984 - - testing/ - - feature #1977 - - overview #1936 - -- .htaccess #1939 -- composer.json #1935 -- phpdoc.dist.xml #1987 +.. code-block:: text + + . + ├── admin/ + │ ├── framework/composer.json #1935 + │ └── starter/composer.json #1935 + ├── app/ + │ └── Config/ + │ ├── App #1973 + │ └── Migrations #1973 + ├── public/ + │ └── .htaccess #1973 + ├── system/ + │ ├── API/ + │ │ └── ResponseTrait #1962 + │ ├── Commands/ + │ │ └── Server/rewrite #1925 + │ ├── Config/ + │ │ ├── AutoloadConfig #1974 + │ │ └── BaseConfig #1947 + │ ├── Database/ #1938 + │ │ ├── BaseBuilder #1923, #1933, #1950 + │ │ ├── BaseConnection #1950 + │ │ ├── BaseResult #1917 + │ │ ├── BaseUtils #1917 + │ │ ├── Forge #1917 + │ │ └── SQLite3/ + │ │ ├── Connection #1917 + │ │ └── Result #1917 + │ ├── Debug/ + │ │ ├── Toolbar #1916 + │ │ ├── Toolbar/Collectors/ + │ │ │ ├── BaseCollector #1972 + │ │ │ ├── Config #1973 + │ │ │ ├── History #1945 + │ │ │ └── Routes #1949 + │ │ └── Toolbar/Views/ + │ │ ├── _config.tpl.php #1973 + │ │ ├── toolbar.tpl.php #1972 + │ │ └── toolbarloader.js #1931, #1961 + │ ├── Exceptions/ + │ │ └── EntityException #1927 + │ ├── Filters/ + │ │ └── Filters #1970, #1985 + │ ├── Format/ + │ │ ├── FormatterInterface #1918 + │ │ ├── JSONFormatter #1918 + │ │ └── XMLFormatter #1918 + │ ├── HTTP/ + │ │ ├── CLIRequest #1956 + │ │ └── CURLRequest #1915 + │ ├── Images/Handlers/ + │ │ └── BaseHandler #1956 + │ ├── Language/en/ + │ │ ├── Database #1917 + │ │ └── Validation #1952 + │ ├── Router/ + │ │ ├── Router #1968 + │ │ └── RouteCollection #1977 + │ ├── Session/Handlers/ + │ │ └── RedisHandler #1980 + │ ├── Test/ + │ │ ├── FeatureResponse #1977 + │ │ └── FeatureTestCase #1977 + │ ├── Validation/ + │ │ ├── FormatRules #1957 + │ │ └── Rules #1952 + │ ├── View/ + │ │ └── Table #1984 + │ ├── Entity #1911, #1927, #1943, #1950, #1955 + │ └── Model #1930, #1943, #1963, #1981 + ├── tests/system/ + │ ├── Config/ + │ │ └── BaseConfigTest #1947 + │ ├── Database/ + │ │ ├── BaseQueryTest #1917 + │ │ ├── Live/ + │ │ │ ├── DbUtilsTest #1917, #1943 + │ │ │ ├── ForgeTest #1917 + │ │ │ ├── GetTest #1917, #1943 + │ │ │ └── ModelTest #1930, #1943, #1981 + │ │ └── Migrations/ + │ │ ├── MigrationRunnerTest #1917 + │ │ └── MigrationTest #1943 + │ ├── Filters/ + │ │ └── FilterTest #1985 + │ ├── Test/ + │ │ └── FeatureTestCaseTest #1977 + │ ├── Validation/ + │ │ ├── FormatRulesTest #1957 + │ │ └── RulesTest #1952, #cbe4b1d + │ ├── View/ + │ │ └── TableTest #1978, #1984 + │ └── EntityTest #1911 + ├── user_guide_src/ + │ ├── dbmgmt/ + │ │ └── migrations #1973 + │ ├── installation/ + │ │ ├── installing_composer #1926 + │ │ └── running #1935 + │ ├── libraries/ + │ │ └── validation #1952, #1954, #1957 + │ ├── outgoing/ + │ │ ├── index #1978 + │ │ └── table #1978, #1984 + │ └── testing/ + │ ├── feature #1977 + │ └── overview #1936 + ├── .htaccess #1939 + ├── composer.json #1935 + └── phpdoc.dist.xml #1987 PRs merged ---------- @@ -170,10 +168,10 @@ PRs merged - #1956 Use Null Coalesce Operator - #1955 Travis-CI build failed fix - #1954 Fix validation table format -- #1952 Add Validations for `equals()` and `not_equals()` +- #1952 Add Validations for ``equals()`` and ``not_equals()`` - #1951 System typos changes & code cleanup -- #1950 Fix some side issue -- #1949 Toobar/Routes correction +- #1950 Fix some side issues +- #1949 Toolbar/Routes correction - #1947 Fix BaseConfig didn't load Registrar files properly - #1945 Fix datetime extraction from debugbar file - #1943 Model, Entity, Exception & Migration test cases @@ -184,12 +182,12 @@ PRs merged - #1933 having (Is NULL deletion) - #1931 Toolbar IE11 fix - #1930 Model Changes w.r.t. #1773 -- #1927 Entity exception for non existed props +- #1927 Entity exception for nonexistent props - #1926 Docs: update installation guide - #1925 removed $_SERVER['CI_ENVIRONMENT'] - #1923 missing return - #1918 JSONFormatter - #1917 Database Test Cases -- #1916 Check if the value is string +- #1916 Check if the value is a string - #1915 Fix for POST + JSON (Content-Length added) - #1911 JSON Cast exception test cases diff --git a/user_guide_src/source/changelogs/v4.0.0-beta.4.rst b/user_guide_src/source/changelogs/v4.0.0-beta.4.rst index fc0251b95474..cc6b3e031911 100644 --- a/user_guide_src/source/changelogs/v4.0.0-beta.4.rst +++ b/user_guide_src/source/changelogs/v4.0.0-beta.4.rst @@ -12,155 +12,150 @@ Highlights There are some breaking changes... -- The Entity class has been refactored; -- The Model class changing has been updated to better handle soft deletes +- The Entity class has been refactored +- The Model class has been updated to better handle soft deletes - The routing has been beefed up New Messages ------------ -- new translation key: Database/noDateFormat - -App Changes ------------ +- New translation key: ``Database.noDateFormat`` Testing Changes --------------- -- enhanced database & migration testing in tests/_support +- Enhanced database & migration testing in **tests/_support/** Changed Files ------------- The list of changed files follows, with PR numbers shown. -- admin/ - -- app/ - - Controllers/ - - Home #1999 - -- public/ - -- system/ - - Autoloader/ - - FileLocator #2059, #2064 - - Cache/ - - CacheFactory #2060 - - Handlers/ - - MemcachedHandler #2060 - - PredisHandler #2060 - - RedisHandler #2060 - - Commands/ - - Utilities/Routes #2008 - - Config/ - - Config #2079 - - Services #2024 - - Database/ - - MySQLi/ - - Connection #2042 - - Result #2011 - - Postgre/ - - Connection #2042 - - Result #2011 - - SQLite3/ - - Connection #2042 - - Forge #2042 - - Result #2011 - - Table #2042 - - BaseBuilder #1989 - - BaseConnection #2042 - - BaseResult #2002 - - Forge #2042 - - MigratiopnRollback #2035 - - MigrationRunner #2019 - - Debug/ - - Toolbar/Collectors/Routes #2030 - - Exceptions. - - ModelException #2054 - - Files/ - - File #2104 - - Filters/ - - Filters #2039 - - helpers/ - - date_helper #2091 - - HTTP/ - - CLIRequest #2024 - - CURLRequest #1996, #2050 - - IncomingRequest #2063 - - Request #2024 - - Language/en/ - - Database #2054 - - Pager/ - - Pager #2026 - - Router/ - - RouteCollection #1959, #2012, #2024 - - Router #2024, #2031, #2043 - - RouterInterface #2024 - - Session/ - - Handlers/ArrayHandler #2014 - - Test/ - - CIUnitTestCase #2002 - - FeatureTestCase #2043 - - Throttle/ - - Throttler #2074 - - CodeIgniter #2012, #2024 - - Common #2036 - - Entity #2002, #2004, #2011, #2081 - - Model #2050, #2051, #2053, #2054 - -- tests/system/ - - CLI/ - - ConsoleTest #2024 - - Database/ - - Live/ - - DbUtilsTest #2051, #2053 - - ForgeTest #2019, #2042 - - ModelTest #2002, #2051, #2053, #2054 - - SQLite/AlterTablesTest #2042 - - WhereTest #2052 - - Migrations/MigrationRunnerTest #2019 - - HTTP/ - - CLIRequest #2024 - - CURLRequestTest #1996 - - Router/ - - RouteCollectionTest #1959, #2012, #2024 - - RouterTest #2024, #2043 - - Test/ - - FeatureTestCaseTest #2043 - - Throttle/ - - ThrottleTest #2074 - - View/ - - ParserTest #2005 - - CodeIgniterTest #2024 - - EntityTest #2002, #2004 - -- user_guide_src/ - - concepts/ - - autoloader #2035, #2071 - - database/ - - query_builder #2035 - - dbmgmt/ - - forge #2042 - - migration #2042 - - helpers/ - - date_helper #2091 - - incoming/ - - routing #2035 - - installation/ - - installing_composer #2015, #2035 - - libraries/ - - pagination #2026 - - sessions #2014, #2035 - - validaiton #2069 - - uploaded_files #2104 - - models/ - - entitites #2002, #2004, #2035 - - model #2051, #2053, #2054 - - outgoing/ - - view_parser #e21823, 32005 - - testing/ - - database #2051, #2053 +.. code-block:: text + + . + ├── admin/ + ├── app/ + │ └── Controllers/ + │ └── Home #1999 + ├── public/ + ├── system/ + │ ├── Autoloader/ + │ │ └── FileLocator #2059, #2064 + │ ├── Cache/ + │ │ ├── CacheFactory #2060 + │ │ └── Handlers/ + │ │ ├── MemcachedHandler #2060 + │ │ ├── PredisHandler #2060 + │ │ └── RedisHandler #2060 + │ ├── Commands/ + │ │ └── Utilities/Routes #2008 + │ ├── Config/ + │ │ ├── Config #2079 + │ │ └── Services #2024 + │ ├── Database/ + │ │ ├── MySQLi/ + │ │ │ ├── Connection #2042 + │ │ │ └── Result #2011 + │ │ ├── Postgre/ + │ │ │ ├── Connection #2042 + │ │ │ └── Result #2011 + │ │ ├── SQLite3/ + │ │ │ ├── Connection #2042 + │ │ │ ├── Forge #2042 + │ │ │ ├── Result #2011 + │ │ │ └── Table #2042 + │ │ ├── BaseBuilder #1989 + │ │ ├── BaseConnection #2042 + │ │ ├── BaseResult #2002 + │ │ ├── Forge #2042 + │ │ ├── MigrateRollback #2035 + │ │ └── MigrationRunner #2019 + │ ├── Debug/ + │ │ └── Toolbar/Collectors/Routes #2030 + │ ├── Exceptions. + │ │ └── ModelException #2054 + │ ├── Files/ + │ │ └── File #2104 + │ ├── Filters/ + │ │ └── Filters #2039 + │ ├── helpers/ + │ │ └── date_helper #2091 + │ ├── HTTP/ + │ │ ├── CLIRequest #2024 + │ │ ├── CURLRequest #1996, #2050 + │ │ ├── IncomingRequest #2063 + │ │ └── Request #2024 + │ ├── Language/en/ + │ │ └── Database #2054 + │ ├── Pager/ + │ │ └── Pager #2026 + │ ├── Router/ + │ │ ├── RouteCollection #1959, #2012, #2024 + │ │ ├── Router #2024, #2031, #2043 + │ │ └── RouterInterface #2024 + │ ├── Session/ + │ │ └── Handlers/ArrayHandler #2014 + │ ├── Test/ + │ │ ├── CIUnitTestCase #2002 + │ │ └── FeatureTestCase #2043 + │ ├── Throttle/ + │ │ └── Throttler #2074 + │ ├── CodeIgniter #2012, #2024 + │ ├── Common #2036 + │ ├── Entity #2002, #2004, #2011, #2081 + │ └── Model #2050, #2051, #2053, #2054 + ├── tests/system/ + │ ├── CLI/ + │ │ └── ConsoleTest #2024 + │ ├── Database/ + │ │ ├── Live/ + │ │ │ ├── DbUtilsTest #2051, #2053 + │ │ │ ├── ForgeTest #2019, #2042 + │ │ │ ├── ModelTest #2002, #2051, #2053, #2054 + │ │ │ ├── SQLite/AlterTablesTest #2042 + │ │ │ └── WhereTest #2052 + │ │ └── Migrations/MigrationRunnerTest #2019 + │ ├── HTTP/ + │ │ ├── CLIRequest #2024 + │ │ └── CURLRequestTest #1996 + │ ├── Router/ + │ │ ├── RouteCollectionTest #1959, #2012, #2024 + │ │ └── RouterTest #2024, #2043 + │ ├── Test/ + │ │ └── FeatureTestCaseTest #2043 + │ ├── Throttle/ + │ │ └── ThrottleTest #2074 + │ ├── View/ + │ │ └── ParserTest #2005 + │ ├── CodeIgniterTest #2024 + │ └── EntityTest #2002, #2004 + └── user_guide_src/ + ├── concepts/ + │ └── autoloader #2035, #2071 + ├── database/ + │ └── query_builder #2035 + ├── dbmgmt/ + │ ├── forge #2042 + │ └── migration #2042 + ├── helpers/ + │ └── date_helper #2091 + ├── incoming/ + │ └── routing #2035 + ├── installation/ + │ └── installing_composer #2015, #2035 + ├── libraries/ + │ ├── pagination #2026 + │ ├── sessions #2014, #2035 + │ ├── validation #2069 + │ └── uploaded_files #2104 + ├── models/ + │ ├── entities #2002, #2004, #2035 + │ └── model #2051, #2053, #2054 + ├── outgoing/ + │ └── view_parser #e21823, 32005 + └── testing/ + └── database #2051, #2053 PRs merged ---------- @@ -175,7 +170,7 @@ PRs merged - #2064 Bugfix file locator slash error - #2063 Ensure query vars are part of request->uri. Fixes #2062 - #2060 Cache Drive Backups -- #2059 Add multi-path support to `locateFile()` +- #2059 Add multi-path support to ``locateFile()`` - #2054 Add model exceptions for missing/invalid dateFormat - #2053 Change Model's deleted flag to a deleted_at datetime/timestamp. Fixes #2041 - #2052 Add various tests for (not) null @@ -185,23 +180,23 @@ PRs merged - #2042 SQLite3 now supports dropping foreign keys. Fixes #1982 - #2040 Update CURLRequest.php - #2039 Restrict filter matching of uris so they require an exact match. Fixes #2038 -- #2036 Make `force_https()` send headers before exit +- #2036 Make ``force_https()`` send headers before exit - #2035 Various typos and Guide corrections - #2031 Fallback to server request for default method -- #2030 Support the new `router` service in Debug Toolbar -- #2026 Extension Pager::makeLinks (optional grup name) +- #2030 Support the new ``router`` service in Debug Toolbar +- #2026 Extension Pager::makeLinks (optional group name) - #2024 Refactor the way the router and route collection determine the current HTTP verb - #2019 SQLite and Mysql driver additional tests and migration runner test fixes - #2015 Direct user to follow the upgrade steps after installation - #2014 Added a new Session/ArrayHandler that can be used during testing - #2012 Use request->method for HTTP verb - #2011 Set the raw data array without any mutations for the Entity -- #2008 Add `patch` method to command "routes" +- #2008 Add ``patch`` method to command "routes" - #2005 Plugin closures docs update and test - #2004 Allow hasChanged() without parameter - #2002 Entity Refactor - #1999 use CodeIgniter\Controller; not needed since Home Controller extends ... - #1996 Attempting to fix CURLRequest debug issue. #1994 - #e21823 Corrected docs for parser plugins. Closes #1995 -- #1989 argument set() must by type of string - cannot agree +- #1989 argument set() must be of type string - cannot agree - #1959 Prevent reverseRoute from searching closures diff --git a/user_guide_src/source/changelogs/v4.0.0-rc.1.rst b/user_guide_src/source/changelogs/v4.0.0-rc.1.rst index 072daca3f896..f36826c10c60 100644 --- a/user_guide_src/source/changelogs/v4.0.0-rc.1.rst +++ b/user_guide_src/source/changelogs/v4.0.0-rc.1.rst @@ -14,189 +14,182 @@ Enhancements - CI3 Email ported to CI4 - Encryption (basic) added -- Migrations refactored and streamlined for more wholistic functionality (BC) -- added convert() to ImageHandlerInterface -- disabled debug toolbar for downloads -- CLI commands returns an error code now ("spark" changed) +- Migrations refactored and streamlined for more holistic functionality (BC) +- Added ``convert()`` to ``ImageHandlerInterface`` +- Disabled debug toolbar for downloads +- CLI commands return an error code now ("spark" changed) - RESTful controllers added to shorten dev time for RESTful APIs -- added RouteCollection::presenter() as part of the RESTful support +- Added ``RouteCollection::presenter()`` as part of the RESTful support App Changes ----------- -- added app/Common to make it easier to override common functions -- Config/Email and Encryption added -- Config/Migration modified, and has different settings -- Controllers/Home fixed, removing unnecessary model reference +- Added **app/Common.php** to make it easier to override common functions +- ``Config/Email`` and ``Config/Encryption`` added +- ``Config/Migration`` modified, and has different settings +- **app/Controllers/Home.php** fixed, removing unnecessary model reference Message Changes --------------- - Migration has new & modified messages -- Messages now has RESTful set +- Messages now have a RESTful set Changed Files ------------- The list of changed files follows, with PR numbers shown. -- admin/ - - release-appstarter #2155 - - release-framework #2155 - -- app/ - - Config/ - - Email #2092 - - Encryption #2135 - - Migrations #2065 - - Controllers/ - - BaseController #2046 - - Home #2145 - - - Common #2110 - -- public/ - -- system/ - - API/ - - ResponseTrait #2131 - - Autoloader/ - - Autoloader #2149 - - FileLocator #2149 - - Cache/Handlders/ - - RedisHandler #2144 - - CLI/ - - CommandRunner #2164 - - Commands/Database/ - - CreateMigration #2065 - - Migrate #2065, 2137 - - MigrateRefresh #2065, 2137 - - MigrateRollback #2065, 2137 - - MigrateStatus #2137 - - MigrateVersion #2137 - - Config/ - - BaseConfig #2082 - - Services #2135, 2092 - - Database/ - - BaseBuilder #2127, 2090, 2142, 2153, 2160, 2023, 2001 - - MigrationRunner #2065, 2137 - - Debug/ - - Toolbar #2118 - - Email/ - - Email #2092 - - Encryption/ - - EncrypterInterface #2135 - - Encryption #2135 - - Exceptions/EncryptionException #2135 - - Handlers/ - - BaseHandler #2135 - - OpenSSLHandler #2135 - - Exceptions/ - - ConfigException #2065 - - Files/ - - File #2178 - - Filters/ - - DebugToolbar #2118 - - Helpers/ - - inflector_helper #2065 - - Honeypot/ - - Honeypot #2177 - - HTTP/ - - DownloadResponse #2129 - - Files/UploadedFile #2128 - - Message @2171 - - Response #2166 - - Images/ - - Handlers/ - -BaseHandler #2113, 2150 - - ImageMagickHandler #2151 - - BImageHandlerInterface #2113 - - Language/en/ - - Email #2092 - - Encryption #2135 - - Migrations #2065, 2137 - - RESTful #2165 - - RESTful/ - - ResourceController #2165 - - ResourcePresenter #2165 - - Router/ - - RouteCollection #2165 - - Security/ - - Security #2027 - - Session/Handlers/ - - RedisHandler #2125 - - Test/ - - CIDatabaseTestCase #2137 - - - bootstrap #2110 - - CodeIgniter #2126, 2164 - - Common #2109 - - Entity #2112 - - Model #2090 - -- tests/_support/ - - RESTful/... #2165 - -- tests/system/ - - API/ - - ResponseTraitTest #2131 - - Database/ - - Builder/ - - GetTest #2142 - - SelectTest #2160 - - WhereTest #2001 - - Live/ - - GroupTest #2160 - - ModelTest #2090 - - SelectTest #2160 - - Migrations/MigrationRunnerTest #2065, 2137 - - Encryption/ - - EncryptionTest #2135 - - OpenSSLHandlerTest #2135 - - Helpers/ - - InflectorHelperTest #2065 - - HTTP/ - - DownloadResponseTest #2129 - - MessageTest #2171 - - Images/ - - GDHandlerTest #2113 - - RESTful/ - - ResourceControllerTest #2165 - - ResourcePresenterTest #2165 - - Router/ - - RouteCollectionTest #2165 - - - ControllerTest #2165 - - EntityTest #2112 - -- user_guide_src/ - - changelogs/ - - next #2154 - - database/ - - query_builder #2160, 2001 - - dbmgmt/ - - migrations #2065, 2132, 2136, 2154, 2137 - - extending/ - - common #2162 - - helpers/ - - inflector_helper #2065 - - incoming/ - - restful #2165 - - routing #2165 - - libraries/ - - email #2092, 2154 - - encryption #2135 - - images #2113, 2169 - - outgoing/ - - api_responses #2131 - - localization #2134 - - response #2129 - - testing/ - - database #2137 - -- CONTRIBUTING.md #2010 -- README.md #2010 -- spark +.. code-block:: text + + . + ├── admin/ + │ ├── release-appstarter #2155 + │ └── release-framework #2155 + ├── app/ + │ ├── Config/ + │ │ ├── Email #2092 + │ │ ├── Encryption #2135 + │ │ └── Migrations #2065 + │ ├── Controllers/ + │ │ ├── BaseController #2046 + │ │ └── Home #2145 + │ └── Common #2110 + ├── public/ + ├── system/ + │ ├── API/ + │ │ └── ResponseTrait #2131 + │ ├── Autoloader/ + │ │ ├── Autoloader #2149 + │ │ └── FileLocator #2149 + │ ├── Cache/Handlers/ + │ │ └── RedisHandler #2144 + │ ├── CLI/ + │ │ └── CommandRunner #2164 + │ ├── Commands/Database/ + │ │ ├── CreateMigration #2065 + │ │ ├── Migrate #2065, 2137 + │ │ ├── MigrateRefresh #2065, 2137 + │ │ ├── MigrateRollback #2065, 2137 + │ │ ├── MigrateStatus #2137 + │ │ └── MigrateVersion #2137 + │ ├── Config/ + │ │ ├── BaseConfig #2082 + │ │ └── Services #2135, 2092 + │ ├── Database/ + │ │ ├── BaseBuilder #2127, 2090, 2142, 2153, 2160, 2023, 2001 + │ │ └── MigrationRunner #2065, 2137 + │ ├── Debug/ + │ │ └── Toolbar #2118 + │ ├── Email/ + │ │ └── Email #2092 + │ ├── Encryption/ + │ │ ├── EncrypterInterface #2135 + │ │ ├── Encryption #2135 + │ │ ├── Exceptions/EncryptionException #2135 + │ │ └── Handlers/ + │ │ ├── BaseHandler #2135 + │ │ └── OpenSSLHandler #2135 + │ ├── Exceptions/ + │ │ └── ConfigException #2065 + │ ├── Files/ + │ │ └── File #2178 + │ ├── Filters/ + │ │ └── DebugToolbar #2118 + │ ├── Helpers/ + │ │ └── inflector_helper #2065 + │ ├── Honeypot/ + │ │ └── Honeypot #2177 + │ ├── HTTP/ + │ │ ├── DownloadResponse #2129 + │ │ ├── Files/UploadedFile #2128 + │ │ ├── Message @2171 + │ │ └── Response #2166 + │ ├── Images/ + │ │ ├── Handlers/ + │ │ │ ├── BaseHandler #2113, 2150 + │ │ │ └── ImageMagickHandler #2151 + │ │ └── ImageHandlerInterface #2113 + │ ├── Language/en/ + │ │ ├── Email #2092 + │ │ ├── Encryption #2135 + │ │ ├── Migrations #2065, 2137 + │ │ └── RESTful #2165 + │ ├── RESTful/ + │ │ ├── ResourceController #2165 + │ │ └── ResourcePresenter #2165 + │ ├── Router/ + │ │ └── RouteCollection #2165 + │ ├── Security/ + │ │ └── Security #2027 + │ ├── Session/Handlers/ + │ │ └── RedisHandler #2125 + │ ├── Test/ + │ │ └── CIDatabaseTestCase #2137 + │ ├── bootstrap #2110 + │ ├── CodeIgniter #2126, 2164 + │ ├── Common #2109 + │ ├── Entity #2112 + │ └── Model #2090 + ├── tests/_support/ + │ └── RESTful/... #2165 + ├── tests/system/ + │ ├── API/ + │ │ └── ResponseTraitTest #2131 + │ ├── Database/ + │ │ ├── Builder/ + │ │ │ ├── GetTest #2142 + │ │ │ ├── SelectTest #2160 + │ │ │ └── WhereTest #2001 + │ │ ├── Live/ + │ │ │ ├── GroupTest #2160 + │ │ │ ├── ModelTest #2090 + │ │ │ └── SelectTest #2160 + │ │ └── Migrations/MigrationRunnerTest #2065, 2137 + │ ├── Encryption/ + │ │ ├── EncryptionTest #2135 + │ │ └── OpenSSLHandlerTest #2135 + │ ├── Helpers/ + │ │ └── InflectorHelperTest #2065 + │ ├── HTTP/ + │ │ ├── DownloadResponseTest #2129 + │ │ └── MessageTest #2171 + │ ├── Images/ + │ │ └── GDHandlerTest #2113 + │ ├── RESTful/ + │ │ ├── ResourceControllerTest #2165 + │ │ └── ResourcePresenterTest #2165 + │ ├── Router/ + │ │ └── RouteCollectionTest #2165 + │ ├── ControllerTest #2165 + │ └── EntityTest #2112 + ├── user_guide_src/ + │ ├── changelogs/ + │ │ └── next #2154 + │ ├── database/ + │ │ └── query_builder #2160, 2001 + │ ├── dbmgmt/ + │ │ └── migrations #2065, 2132, 2136, 2154, 2137 + │ ├── extending/ + │ │ └── common #2162 + │ ├── helpers/ + │ │ └── inflector_helper #2065 + │ ├── incoming/ + │ │ ├── restful #2165 + │ │ └── routing #2165 + │ ├── libraries/ + │ │ ├── email #2092, 2154 + │ │ ├── encryption #2135 + │ │ └── images #2113, 2169 + │ ├── outgoing/ + │ │ ├── api_responses #2131 + │ │ ├── localization #2134 + │ │ └── response #2129 + │ └── testing/ + │ └── database #2137 + ├── CONTRIBUTING.md #2010 + ├── README.md #2010 + └── spark PRs merged ---------- @@ -232,15 +225,15 @@ PRs merged - #2125 Updated redis session handler to support redis 5.0.x - #2118 Disabled Toolbar on downloads - #2113 Add Image->convert() -- #2112 Update `Entity.php` `__isset` method +- #2112 Update ``Entity.php`` ``__isset`` method - #2110 Added app/Common.php - #2109 Fix typo in checking if exists db_connect() - #2092 Original email port - #2090 Fix prevent soft delete all without conditions set - #2082 Update BaseConfig.php -- #2065 Migration updates for more wholistic functionality +- #2065 Migration updates for more holistic functionality - #2046 clean base controller code - #2027 Fix CSRF hash regeneration -- #2023 whereIn $value do not have to be an array -- #2010 Fix CSRF hash regenerationerbiage revisions +- #2023 whereIn $value does not have to be an array +- #2010 WIP Verbiage revisions - #2001 Subqueries in BaseBuilder diff --git a/user_guide_src/source/changelogs/v4.0.0-rc.2.rst b/user_guide_src/source/changelogs/v4.0.0-rc.2.rst index 1a68321d2b2c..c98a476b3a31 100644 --- a/user_guide_src/source/changelogs/v4.0.0-rc.2.rst +++ b/user_guide_src/source/changelogs/v4.0.0-rc.2.rst @@ -12,165 +12,157 @@ Release Date: Sept 27, 2019 Enhancements ------------ -- query builder testability simplified with new property, but dropped - method parameters (breaking change) -- database, migrations and sessions beefed up -- numerous smaller bugs corrected +- Query builder testability simplified with new property, but dropped + method parameters (breaking change) +- Database, migrations and sessions beefed up +- Numerous smaller bugs corrected App Changes ----------- -- Config/Constants, Paths & some config settings have had changes - -Message Changes ---------------- - -- N/A +- **app/Config/Constants.php**, **app/Config/Paths.php** & some config settings have had changes Changed Files ------------- The list of changed files follows, with PR numbers shown. -- admin/ - -- app/ - - Config/ - - Boot/* #2241 - - Constants #2183 - - Paths #2181 -- public/ - -- system/ - - CLI/ - - BaseCommand #2231 - - Database/ - - MySQLi/Connection #2201, 2229 - - Postgre/ - - BaseBuilder #2269 - - Connection #2201 - - SQLite3/Connection #2201, 2228, 2230 - - BaseBuilder #2257, 2232, 2269, 2270 - - BaseConnection #2208, 2213, 2231 - - Config #2224 - - Forge #2205 - - MigrationRunner #2191 - - Debug/ - - Exceptions #2262 - - Encryption/ - - Encryption #2231 - - Handlers/BaseHandler #2231 - - Files/ - - FileCollection #2265 - - HTTP/ - - CURLRequest #2168 - - IncomingRequest #2265 - - Request #2253 - - Response #2253 - - I18n/ - - Time #2231 - - TimeDifference #2231 - - Images/ - - Handlers/BaseHandler #2246 - - RESTful/ - - ResourcePresenter #2271 - - Security/ - - Security #2240 - - Session/ - - Session #2197, 2231 - - Test/ - - CIDatabaseTestCase #2205 - - CIDatabaseUnitTestCase #2184 - - Validation/ - - FileRules #2265 - - Validation #2268 - - View/ - - Parser #2264 - - - Common #2200, 2209, 2261 - - Model #2231 - -- tests/_support/ - -- tests/system/ - - Commands/ - - CommandClassTest #2231 - - Database/ - - Builder/ - - GetTest #2232 - - CountTest #2269 - - DeleteTest #2269 - - EmptyTest #2269 - - GetTest #2269 - - GroupTest #2257 - - InsertTest #2269 - - ReplaceTest #2269 - - TruncateTest #2269 - - UpdateTest #2269 - - Live/ - - EscapeTest #2229 - - ForgeTest #2201, 2211 - - GroupTest #2257 - - MetadataTest #2211 - - ModelTest #2231 - - BaseConnectionTest #2229, 2231 - - Encryption/ - - EncryptionTest #2231 - - Helpers/ - - URLHelperTest #2259 - - HTTP/ - - CURLRequestTest #2168 - - FileCOllectionTest #2265 - - URITest #2259 - - I18n/ - - TimeDifferenceTest #2231 - - TimeTest #2231 - - Pager/ - - pagerTest #2259 - - RESTful/ - - ResourcePresenterTest #2271 - - Session/ - - SessionTest #2231 - - View/ - - ParserTest #2264 - -- user_guide_src/ - - concepts/ - - structure #2221 - - database/ - - metadata #2199, 2201, 2208 - - queries #2208 - - query_builder #2257, 2232, 2269 - - dbmgmt/ - - migration #2190, 2191 - - extending/ - - contributing #2221 - - general/ - - errors #2221 - - helpera/ - - url_helper #2259 - - incoming/ - - restful #2189 - - routing #2221 - - installation/ - - troubleshooting #2260 - - libraries/ - - encryption #2221 - - pagination #2216 - - time #2221 - - uti #2216 - - outgoing/ - - api_responses #2245 - - view_layouts #2218 - - view_parser #2218, 2264 - - testing/ - - controllers #2221 - - debugging #2221, 2209 - - feature #2218, 2221 - - overview #2221 - - tutorial/ - - news_section #2221 - - static_pages #2221 +.. code-block:: text + + . + ├── admin/ + ├── app/ + │ └── Config/ + │ ├── Boot/* #2241 + │ ├── Constants #2183 + │ └── Paths #2181 + ├── public/ + ├── system/ + │ ├── CLI/ + │ │ └── BaseCommand #2231 + │ ├── Database/ + │ │ ├── MySQLi/Connection #2201, 2229 + │ │ ├── Postgre/ + │ │ │ ├── BaseBuilder #2269 + │ │ │ └── Connection #2201 + │ │ ├── SQLite3/Connection #2201, 2228, 2230 + │ │ ├── BaseBuilder #2257, 2232, 2269, 2270 + │ │ ├── BaseConnection #2208, 2213, 2231 + │ │ ├── Config #2224 + │ │ ├── Forge #2205 + │ │ └── MigrationRunner #2191 + │ ├── Debug/ + │ │ └── Exceptions #2262 + │ ├── Encryption/ + │ │ ├── Encryption #2231 + │ │ └── Handlers/BaseHandler #2231 + │ ├── Files/ + │ │ └── FileCollection #2265 + │ ├── HTTP/ + │ │ ├── CURLRequest #2168 + │ │ ├── IncomingRequest #2265 + │ │ ├── Request #2253 + │ │ └── Response #2253 + │ ├── I18n/ + │ │ ├── Time #2231 + │ │ └── TimeDifference #2231 + │ ├── Images/ + │ │ └── Handlers/BaseHandler #2246 + │ ├── RESTful/ + │ │ └── ResourcePresenter #2271 + │ ├── Security/ + │ │ └── Security #2240 + │ ├── Session/ + │ │ └── Session #2197, 2231 + │ ├── Test/ + │ │ ├── CIDatabaseTestCase #2205 + │ │ └── CIDatabaseUnitTestCase #2184 + │ ├── Validation/ + │ │ ├── FileRules #2265 + │ │ └── Validation #2268 + │ ├── View/ + │ │ └── Parser #2264 + │ ├── Common #2200, 2209, 2261 + │ └── Model #2231 + ├── tests/_support/ + ├── tests/system/ + │ ├── Commands/ + │ │ └── CommandClassTest #2231 + │ ├── Database/ + │ │ ├── Builder/ + │ │ │ ├── GetTest #2232 + │ │ │ ├── CountTest #2269 + │ │ │ ├── DeleteTest #2269 + │ │ │ ├── EmptyTest #2269 + │ │ │ ├── GetTest #2269 + │ │ │ ├── GroupTest #2257 + │ │ │ ├── InsertTest #2269 + │ │ │ ├── ReplaceTest #2269 + │ │ │ ├── TruncateTest #2269 + │ │ │ └── UpdateTest #2269 + │ │ ├── Live/ + │ │ │ ├── EscapeTest #2229 + │ │ │ ├── ForgeTest #2201, 2211 + │ │ │ ├── GroupTest #2257 + │ │ │ ├── MetadataTest #2211 + │ │ │ └── ModelTest #2231 + │ │ └── BaseConnectionTest #2229, 2231 + │ ├── Encryption/ + │ │ └── EncryptionTest #2231 + │ ├── Helpers/ + │ │ └── URLHelperTest #2259 + │ ├── HTTP/ + │ │ ├── CURLRequestTest #2168 + │ │ ├── FileCollectionTest #2265 + │ │ └── URITest #2259 + │ ├── I18n/ + │ │ ├── TimeDifferenceTest #2231 + │ │ └── TimeTest #2231 + │ ├── Pager/ + │ │ └── pagerTest #2259 + │ ├── RESTful/ + │ │ └── ResourcePresenterTest #2271 + │ ├── Session/ + │ │ └── SessionTest #2231 + │ └── View/ + │ └── ParserTest #2264 + └── user_guide_src/ + ├── concepts/ + │ └── structure #2221 + ├── database/ + │ ├── metadata #2199, 2201, 2208 + │ ├── queries #2208 + │ └── query_builder #2257, 2232, 2269 + ├── dbmgmt/ + │ └── migration #2190, 2191 + ├── extending/ + │ └── contributing #2221 + ├── general/ + │ └── errors #2221 + ├── helpera/ + │ └── url_helper #2259 + ├── incoming/ + │ ├── restful #2189 + │ └── routing #2221 + ├── installation/ + │ └── troubleshooting #2260 + ├── libraries/ + │ ├── encryption #2221 + │ ├── pagination #2216 + │ ├── time #2221 + │ └── uti #2216 + ├── outgoing/ + │ ├── api_responses #2245 + │ ├── view_layouts #2218 + │ └── view_parser #2218, 2264 + ├── testing/ + │ ├── controllers #2221 + │ ├── debugging #2221, 2209 + │ ├── feature #2218, 2221 + │ └── overview #2221 + └── tutorial/ + ├── news_section #2221 + └── static_pages #2221 PRs merged ---------- @@ -196,7 +188,7 @@ PRs merged - #2231 Add magic __isset to classes with __get - #2230 Add escape to SQLite _listTables() - #2229 MySQLi escapeLikeStringDirect() -- #2228 Exclude `sqlite_%` from listTables() +- #2228 Exclude ``sqlite_%`` from listTables() - #2224 change new \Config\Database() to config('Database') - #2221 Documentation fixes - #2218 Typo corrected @@ -214,6 +206,6 @@ PRs merged - #2190 Fix name of ForeignKeyChecks - #2189 missing return - #2184 Fix case on "Seeds/" directory -- #2183 Check `defined` for constants +- #2183 Check ``defined`` for constants - #2181 Remove copy-paste extraneous text - #2168 Fix for CURL for 'debug' option diff --git a/user_guide_src/source/changelogs/v4.0.0-rc.3.rst b/user_guide_src/source/changelogs/v4.0.0-rc.3.rst index 928fee6e6d1c..dc01d78eb5e5 100644 --- a/user_guide_src/source/changelogs/v4.0.0-rc.3.rst +++ b/user_guide_src/source/changelogs/v4.0.0-rc.3.rst @@ -18,123 +18,116 @@ Enhancements App Changes ----------- -- New $CSRFHeaderName property in App/Config/App - -Message Changes ---------------- +- New ``$CSRFHeaderName`` property in **app/Config/App.php** Changed Files ------------- The list of changed files follows, with PR numbers shown. -- admin/ - -- app/ - - Config/ - - App #2272 - -- public/ - -- system/ - - Autoloader/ - - FileLocator #2336 - - Database/ - - MySQLi/Forge #2100 - - Postgre/Forge #2100 - - SQLite3/Forge #2100 - - BaseBuilder #2252, 2312 - - Forge $2100 - - Migration #2303 - - MigrationRunner #2303 - - Debug/ - - Exceptions #2288 - - Toolbar/Collectors/ - - Route #2300 - - Toolbar #2315 - - Views/ #2283 - - Helpers/ - - inflector_helper #2296 - - url_helper #2325 - - HTTP/ - - CURLRequest #2285, 2305 - - Files/UploadedFile #2123 - - Language/en/ - - Encryption #2311 - - RESTful #2311 - - Session #2311 - - Router/ - - Exceptions/RedirectException #2338 - - Router #2308, 2338 - - Security/ - - Security #2272, 2279 - - Session/ - - Handlers/ - - DatabaseHandler #2298 - - FileHandler #2298, 2307 - - MemcachedHandler #2298 - - RedisHandler #2298 - - Session #2339 - - Validation/ - - Validation #2284, 2341 - - View/ - - View #2324 - - CodeIgniter #2338 - - Common #2279 - - Model #2289, 2332 - -- tests/README.md #2345 - -- tests/_support/ - - Config/ - - MockAppConfig #2272 - -- tests/system/ - - Database/ - - Builder/ - - UpdateTest #2295 - - Live/ - - ForgeTest #2100 - - Helpers/ - - InflectorHelperTest #2296 - - URLHelperTest #2325 - - HTTP/ - - CURLRequestTest #2285 - - Log/ - - FileHandlerTest #2346 - - Security/ - - SecurityTest #2279 - - Session/ - - SessionTest #2339 - - CommonFunctionsTest #2279 - -- user_guide_src/ - - dbmgmt/ - - forge #2100 - - migration #2337 - - general/ - - common_functions #2279 - - errors #2338 - - modules #2290 - - helpers/ - - inflector_helper #2296 - - incoming/ - - message #2282 - - restful #2313, 2321, 2333 - - routing #2327 - - libraries/ - - curlrequest #2305 - - security #2279 - - models/ - - model #2316, 2332 - - outgoing/ - - table #2337 +.. code-block:: text + + . + ├── admin/ + ├── app/ + │ └── Config/ + │ └── App #2272 + ├── public/ + ├── system/ + │ ├── Autoloader/ + │ │ └── FileLocator #2336 + │ ├── Database/ + │ │ ├── MySQLi/Forge #2100 + │ │ ├── Postgre/Forge #2100 + │ │ ├── SQLite3/Forge #2100 + │ │ ├── BaseBuilder #2252, 2312 + │ │ ├── Forge $2100 + │ │ ├── Migration #2303 + │ │ └── MigrationRunner #2303 + │ ├── Debug/ + │ │ ├── Exceptions #2288 + │ │ ├── Toolbar/Collectors/ + │ │ │ └── Route #2300 + │ │ ├── Toolbar #2315 + │ │ └── Views/ #2283 + │ ├── Helpers/ + │ │ ├── inflector_helper #2296 + │ │ └── url_helper #2325 + │ ├── HTTP/ + │ │ ├── CURLRequest #2285, 2305 + │ │ └── Files/UploadedFile #2123 + │ ├── Language/en/ + │ │ ├── Encryption #2311 + │ │ ├── RESTful #2311 + │ │ └── Session #2311 + │ ├── Router/ + │ │ ├── Exceptions/RedirectException #2338 + │ │ └── Router #2308, 2338 + │ ├── Security/ + │ │ └── Security #2272, 2279 + │ ├── Session/ + │ │ ├── Handlers/ + │ │ │ ├── DatabaseHandler #2298 + │ │ │ ├── FileHandler #2298, 2307 + │ │ │ ├── MemcachedHandler #2298 + │ │ │ └── RedisHandler #2298 + │ │ └── Session #2339 + │ ├── Validation/ + │ │ └── Validation #2284, 2341 + │ ├── View/ + │ │ └── View #2324 + │ ├── CodeIgniter #2338 + │ ├── Common #2279 + │ └── Model #2289, 2332 + ├── tests/README.md #2345 + ├── tests/_support/ + │ └── Config/ + │ └── MockAppConfig #2272 + ├── tests/system/ + │ ├── Database/ + │ │ ├── Builder/ + │ │ │ └── UpdateTest #2295 + │ │ └── Live/ + │ │ └── ForgeTest #2100 + │ ├── Helpers/ + │ │ ├── InflectorHelperTest #2296 + │ │ └── URLHelperTest #2325 + │ ├── HTTP/ + │ │ └── CURLRequestTest #2285 + │ ├── Log/ + │ │ └── FileHandlerTest #2346 + │ ├── Security/ + │ │ └── SecurityTest #2279 + │ ├── Session/ + │ │ └── SessionTest #2339 + │ └── CommonFunctionsTest #2279 + └── user_guide_src/ + ├── dbmgmt/ + │ ├── forge #2100 + │ └── migration #2337 + ├── general/ + │ ├── common_functions #2279 + │ ├── errors #2338 + │ └── modules #2290 + ├── helpers/ + │ └── inflector_helper #2296 + ├── incoming/ + │ ├── message #2282 + │ ├── restful #2313, 2321, 2333 + │ └── routing #2327 + ├── libraries/ + │ ├── curlrequest #2305 + │ └── security #2279 + ├── models/ + │ └── model #2316, 2332 + └── outgoing/ + └── table #2337 PRs merged ---------- - #2348 CodeIgniter Foundation gets copyright -- #2346 Fix FilerHandlerTest.php wierdness +- #2346 Fix FilerHandlerTest.php weirdness - #2345 Tests readme polish - #2344 Setup vs Set Up - #2343 User guide minor fixes. Fix class names and code area @@ -146,7 +139,7 @@ PRs merged - #2333 Guide: RESTful table formatting - #2332 Change after methods to use actual data - #2328 Update Application structure -- #2327 Correct the tourint UG page +- #2327 Correct the routing UG page - #2325 Fix bug in url_title() function with diacritics - #2324 Renderer Toolbar Debug Toggle - #2321 Update RESTful User Guide @@ -174,4 +167,4 @@ PRs merged - #2272 Handle X-CSRF-TOKEN - CSRF - #2252 Batch Update Where Reset - #2123 WIP fix store() default value bug -- #2100 Added validation on exists database before created for MySQLi +- #2100 Added validation to check whether a database exists before creating it for MySQLi diff --git a/user_guide_src/source/changelogs/v4.0.0-rc.4.rst b/user_guide_src/source/changelogs/v4.0.0-rc.4.rst index 984e7528846c..baf162d8b8ef 100644 --- a/user_guide_src/source/changelogs/v4.0.0-rc.4.rst +++ b/user_guide_src/source/changelogs/v4.0.0-rc.4.rst @@ -12,9 +12,9 @@ Release Date: February 6, 2020 Enhancements ------------ -- Fixed url systems so that it would work when system is served out of subfolders. -- Added required insert ignore support for sqlite3 and mysql. -- Add validation function `is_not_unique` +- Fixed URL systems so that they would work when the system is served out of subfolders. +- Added required insert ignore support for SQLite3 and MySQL. +- Add validation function ``is_not_unique`` - Various improvements and cleanup to the Email class PRs merged @@ -33,9 +33,9 @@ PRs merged - #2511 Database add highlight - #2509 Revert Renderer section reset - #2507 Update ordering of search locations for better prioritization. -- #2506 HTTP Response - Fix crash on CSP methods CSP is disabled +- #2506 HTTP Response - Fix crash on CSP methods when CSP is disabled - #2504 BaseConnection - Nullable return type in getConnectStart() -- #2502 View Renderer - Reset sections after generating the ouput +- #2502 View Renderer - Reset sections after generating the output - #2501 view_cell call controller on initController method. - #2499 View Parser - Fix ParsePair() with filter - #2497 Fix splitQueryPart() @@ -52,7 +52,7 @@ PRs merged - #2472 ControllerTest should work without URI specified. Fixes #2470 - #2471 Transition from Zend Escaper to Laminas Escaper - #2462 Fix impossible length for migration table id. -- #2458 Replace `composer install` by `composer require` +- #2458 Replace ``composer install`` by ``composer require`` - #2450 CRITICAL when $_SESSION is null / Argument 2 passed to dot_array_search() must be [] - #2449 User Guide: Query Builder selectCount - error correction in example - #2447 Existing File checks (Nowackipawel/patch-69) @@ -64,8 +64,8 @@ PRs merged - #2429 fix. safe_mailto multi-byte safe - #2427 Add $recipients property to Config\Email - #2426 Add hex validation rule, test, Guide -- #2425 fix: Router setDefaultNameSpace can't worker -- #2422 Don't show duplicate Date headers when running under PHPs server. +- #2425 fix: Router setDefaultNameSpace doesn't work +- #2422 Don't show duplicate Date headers when running under PHP's server. - #2420 Change current_url() to use cloned URI - #2417 Revise Encryption Service Documentation - #2416 Add missing closing braces of condition 'hasError()' @@ -73,14 +73,14 @@ PRs merged - #2413 fix. toolbar file 301 - #2411 fix parse params of plugin - #2408 Ensure previous_url() gets accurate URI. -- #2407 Fix url helper functions to work when site hosted in subfolders. +- #2407 Fix url helper functions to work when the site is hosted in subfolders. - #2406 Fix issue #2391 CodeIgniter::display404errors() - #2402 Removed pointless isset() check - #2401 Remove pointless check from conditional - #2400 Remove redundant check in conditionals - #2399 Revise Controllers Documentation - #2398 Edit .htaccess -- #2392 Add validation function `is_not_unique` +- #2392 Add validation function ``is_not_unique`` - #2389 Confer silent status to nested seeders - #2388 Fix copypaste command comment - #2387 Use only digits for migrations order diff --git a/user_guide_src/source/changelogs/v4.0.0.rst b/user_guide_src/source/changelogs/v4.0.0.rst index 756eee412261..1e8e63848ba6 100644 --- a/user_guide_src/source/changelogs/v4.0.0.rst +++ b/user_guide_src/source/changelogs/v4.0.0.rst @@ -14,17 +14,17 @@ Enhancements - Updated welcome view file - Debug Toolbar now supports dark mode -- New alpha_numeric_punct validation rule -- Kint was updated from the 2.x branch to the latest 3.x branch, with new config file to specify options +- New ``alpha_numeric_punct`` validation rule +- Kint was updated from the 2.x branch to the latest 3.x branch, with a new config file to specify options - Additional docs for getting started - CLI fixed to better handle complex arguments - Improvements to File class -- New :php:func:`model()` helper method for easy singleton Models. +- New :php:func:`model()` helper method for easy singleton ``Models``. - Tests completely reorganized to make app-level tests simpler out of the box. Repo Changes ------------ -The devstarter repo has been deprecated. +The ``devstarter`` repo has been deprecated. We now have an automated changelog generated in the `CHANGELOG.md `_ file in the main repo. See it for more details. diff --git a/user_guide_src/source/changelogs/v4.0.3.rst b/user_guide_src/source/changelogs/v4.0.3.rst index 126f01cc06e0..fd6d10b80845 100644 --- a/user_guide_src/source/changelogs/v4.0.3.rst +++ b/user_guide_src/source/changelogs/v4.0.3.rst @@ -16,21 +16,21 @@ representation of some of the bigger changes you should know about. Enhancements ------------ -- The API Response Trait now only determines the final formatting (json/xml) through content negotiation when the controller's ``$format`` variable is ``null``. If it contains either ``json`` or ``xml``, then that format will always be returned. +- The ``API\ResponseTrait`` now only determines the final formatting (json/xml) through content negotiation when the controller's ``$format`` variable is ``null``. If it contains either ``json`` or ``xml``, then that format will always be returned. - Pagination now can actually create next page and previous page links, instead of next/previous groups of links. - Windows users wanting to build their own copy of the user guide locally can now use the included ``make.bat`` file. - Locale matching in the IncomingRequest class now works to match broad groups, like ``fr`` even when the browser only supplies a more specific locale code, like ``fr-FR``. -- Added the ability to have nested language defintions. -- add ability to replace {locale} to request->getLocale() in form_open('action') -- tables generated by CLI commands can now be colored. +- Added the ability to have nested language definitions. +- Added the ability to replace {locale} with ``request->getLocale()`` in form_open('action'). +- Tables generated by CLI commands can now be colored. Bugs Fixed ---------- -- Deleting through the Model on a table with string primary key now works. +- Deleting through the Model on a table with a string primary key now works. - Default pagination templates fixed to use the correct locale. - Lots of tweaks and corrections in the user guide. -- Fixed locating files in custom namespaces that were occassionally not found. Primarily affected console commands. +- Fixed locating files in custom namespaces that were occasionally not found. Primarily affected console commands. See the repo's `CHANGELOG_4.0.md `_ diff --git a/user_guide_src/source/changelogs/v4.0.4.rst b/user_guide_src/source/changelogs/v4.0.4.rst index 1e8a85c50277..ffad74e5cf3a 100644 --- a/user_guide_src/source/changelogs/v4.0.4.rst +++ b/user_guide_src/source/changelogs/v4.0.4.rst @@ -12,12 +12,12 @@ Release Date: July 15, 2020 BREAKING -------- -- Added ``$arguments`` parameter to ``after()`` and ``before()`` in ``FilterInterface``. This is a breaking change, so all code implementing the ``FilterInterface`` must be updated. +- Added an ``$arguments`` parameter to ``after()`` and ``before()`` in ``FilterInterface``. This is a breaking change, so all code implementing the ``FilterInterface`` must be updated. Enhancements ------------ -- The location for the SQLite3 database has changed and by default will be now located in a ``writable`` folder instead of the ``public`` folder. +- The location for the SQLite3 database has changed and will now be located by default in a **writable/** folder instead of the **public/** folder. - New CLI command: ``cache:clear`` that will destroy all data within the current cache engine. - Thanks to samsonasik, we have several libraries brought up to 100% test coverage. - A few small performance increases. Every ounce matters! @@ -26,10 +26,10 @@ Enhancements - New Testing Feature: :doc:`Fabricator ` makes creating mock classes simple and repeatable in your tests. - Model class can now have the callbacks overridden at runtime. Useful for testing. - A number of improvements to :doc:`Feature Tests ` in general. -- New :doc:`command() helper function ` to programatically run your CLI commands. Useful for testing and cron jobs. +- New :doc:`command() helper function ` to programmatically run your CLI commands. Useful for testing and cron jobs. - New command, ``make:seeder`` to generate a :doc:`Database Seed class ` skeleton file. - Colors now available on the CLI within Windows, as well as other Windows-related CLI improvements. -- New helper :doc:`mb_url_title() ` that functions like ``url_title()`` but automatically escapes and extended URL characters. +- New helper :doc:`mb_url_title() ` that functions like ``url_title()`` but automatically escapes any extended URL characters. - :doc:`Image library ` now supports ``webp`` images. - Added Unicode support for regular expressions in the Router. - Added support for removing hidden folders in the :doc:`delete_files() ` helper. @@ -37,33 +37,33 @@ Enhancements - ``file`` validation now works with arrays of files. - URI class now supports a ``setSilent()`` method that will disable the throwing of Exceptions. - New argument to ``URI::getSegment()`` that allows us to change the default value returned if nothing exists. -- Implemented a ``withResource()`` in Image so that you can use method chaining instead of using the provided getResource() (used in tests). To just compress your image. +- Implemented ``withResource()`` in Image so that you can use method chaining instead of using the provided ``getResource()`` (used in tests) to just compress your image. - Cookies and headers can be copied from the global Response object when doing a redirect using the new ``withCookies()`` and ``withHeaders()`` methods. -- Support for special prefix "hex2bin:" which can be used with ``$key`` parameter in :doc:`Encryption class` or in .env file. +- Support for the special prefix "hex2bin:" which can be used with the ``$key`` parameter in the :doc:`Encryption class` or in the .env file. Bugs Fixed ---------- -- Fixed location for the SQLite3 database which by default will be now located in a ``writable`` folder instead of the ``public`` folder. +- Fixed location for the SQLite3 database, which will now be located by default in a ``writable`` folder instead of the ``public`` folder. - Fixed bug where ``force_https()`` could add ``https://`` a second time. - Fixed a bug with CurlRequest that could result in incorrect "100 Continue" headers. -- Image::save() bug fixed when ``$target`` parameter was ``null``. -- fixes for ``set_checkbox()`` and ``set_radio()`` when the $default parameter is set to ``true``. -- fix for result object handling in Model class. -- fixed escape character SQLite database. -- fix for inserts on Postgres and Entities when the primary key was null. +- ``Image::save()`` bug fixed when ``$target`` parameter was ``null``. +- Fixes for ``set_checkbox()`` and ``set_radio()`` when the ``$default`` parameter is set to ``true``. +- Fix for result object handling in the Model class. +- Fixed the escape character in the SQLite database. +- Fix for inserts on Postgres and Entities when the primary key was null. - CLI scripts can now correctly recognize dashes within arguments. - CURLRequest now properly sets content length with multipart data. - Misc. stability improvements for the ImageMagick handler. -- setting validation errors within a config file should now work. +- Setting validation errors within a config file should now work. - Unicode characters are not escaped when saving JSON from Entities. -- redirecting with a custom HTTP code should work correctly now. -- ``Time::setTimezone()`` now working correctly. -- added full outer join support for Postgres. -- some cast items in the Entity (like array, json) were not being set correctly during a ``fill()`` process. +- Redirecting with a custom HTTP code should work correctly now. +- ``Time::setTimezone()`` now works correctly. +- Added full outer join support for Postgres. +- Some cast items in the Entity (like array, json) were not being set correctly during a ``fill()`` process. - Fixed bug in Image GD handler that would try to compress images twice in certain cases. -- Ensure get translation output logic work on selected locale, dashed locale, and fallback "en". -- Fix ``is_unique``/``is_not_unique`` validation called on POST/PUT via API in PostgreSQL. +- Ensured that the translation output logic works on the selected locale, dashed locale, and fallback "en". +- Fixed ``is_unique``/``is_not_unique`` validation called on POST/PUT via API in PostgreSQL. - Fixed a bug where filter arguments were not passed to ``after()``. See the repo's diff --git a/user_guide_src/source/changelogs/v4.0.5.rst b/user_guide_src/source/changelogs/v4.0.5.rst index 777e2fd1193b..8715107d78c6 100644 --- a/user_guide_src/source/changelogs/v4.0.5.rst +++ b/user_guide_src/source/changelogs/v4.0.5.rst @@ -13,10 +13,10 @@ Enhancements ------------ - New URL helper function :php:func:`url_to()` which creates absolute URLs based on controllers. -- New Model option: ``$useAutoIncrement`` which when set to ``false`` allows you to provide your own primary key for each record in the table. Handy when we want to implement 1:1 relation or use UUIDs for our model. -- New URL helper function :php:func:`url_is()` which allows you to check the current URL to see if matches the given string. +- New Model option: ``$useAutoIncrement`` which when set to ``false`` allows you to provide your own primary key for each record in the table. Handy when we want to implement a 1:1 relation or use UUIDs for our model. +- New URL helper function :php:func:`url_is()` which allows you to check the current URL to see if it matches the given string. - Services now have their config parameters strictly typehinted. This will ensure no one will pass a different config instance. If you need to pass a new config with additional properties, you need to extend that particular config. -- Support for setting SameSite attribute on Session and CSRF cookies has been added. For security and compatibility with latest browser versions, the default setting is ``Lax``. +- Support for setting the SameSite attribute on Session and CSRF cookies has been added. For security and compatibility with the latest browser versions, the default setting is ``Lax``. - Guessing file extensions from mime type in ``Config\Mimes::guessExtensionFromType()`` now only reverse searches the ``$mimes`` array if no extension is proposed (i.e., usually not for uploaded files). - The getter functions for file extensions of uploaded files now have different fallback values (``UploadedFile::getClientExtension()`` for ``UploadedFile::getExtension()`` and ``''`` for ``UploadedFile::guessExtension()``). This is a security fix and makes the process less dependent on the client. - The Cache ``FileHandler`` now allows setting the file permissions mode via ``Config\Cache``. @@ -24,13 +24,13 @@ Enhancements Changes ------- -- System messages defined in **system/Language/en/** are now strictly for internal framework use and are not covered by backwards compatibility (BC) promise. Users may use these messages in their applications but at their own risks. +- System messages defined in **system/Language/en/** are now strictly for internal framework use and are not covered by the backwards compatibility (BC) promise. Users may use these messages in their applications but at their own risk. Deprecations ------------ - Deprecated ``BaseCommand::getPad()`` in favor of ``BaseCommand::setPad()``. -- Deprecated ``CodeIgniter\Controller::loadHelpers()`` in favor of ``helper()`` function. +- Deprecated ``CodeIgniter\Controller::loadHelpers()`` in favor of the ``helper()`` function. - Deprecated ``Config\Format::getFormatter()`` in favor of ``CodeIgniter\Format\Format::getFormatter()`` - Deprecated ``CodeIgniter\Security\Security::CSRFVerify()`` in favor of ``CodeIgniter\Security\Security::verify()`` - Deprecated ``CodeIgniter\Security\Security::getCSRFHash()`` in favor of ``CodeIgniter\Security\Security::getHash()`` @@ -42,7 +42,7 @@ Deprecations - Deprecated ``Config\App::$CSRFRegenerate`` in favor of ``Config\Security::$regenerate`` - Deprecated ``Config\App::$CSRFRedirect`` in favor of ``Config\Security::$redirect`` - Deprecated ``Config\App::$CSRFSameSite`` in favor of ``Config\Security::$samesite`` -- Deprecated ``migrate:create`` command in favor of ``make:migration`` command. +- Deprecated the ``migrate:create`` command in favor of the ``make:migration`` command. - Deprecated ``CodeIgniter\Database\ModelFactory`` in favor of ``CodeIgniter\Config\Factories::models()`` - Deprecated ``CodeIgniter\Config\Config`` in favor of ``CodeIgniter\Config\Factories::config()`` - Deprecated ``CodeIgniter\HTTP\Message::getHeader()`` in favor of ``header()`` to prepare for PSR-7 @@ -52,8 +52,8 @@ Deprecations Bugs Fixed ---------- -- Fixed a bug in ``Entity`` class where declaring class parameters was preventing data propagation to the ``attributes`` array. -- Handling for the environment variable ``encryption.key`` has changed. Previously, explicit function calls, like ``getenv('encryption.key')`` or ``env('encryption.key')`` where the value has the special prefix ``hex2bin:`` returns an automatically converted binary string. This is now changed to just return the character string with the prefix. This change was due to incompatibility with handling binary strings in environment variables on Windows platforms. However, accessing ``$key`` using ``Encryption`` class config remains unchanged and still returns a binary string. +- Fixed a bug in the ``Entity`` class where declaring class parameters was preventing data propagation to the ``attributes`` array. +- Handling for the environment variable ``encryption.key`` has changed. Previously, explicit function calls, like ``getenv('encryption.key')`` or ``env('encryption.key')`` where the value has the special prefix ``hex2bin:``, returned an automatically converted binary string. These calls now return the character string with the prefix. This change was due to incompatibility with handling binary strings in environment variables on Windows platforms. However, accessing ``$key`` using the ``Encryption`` class config remains unchanged and still returns a binary string. - ``Config\Services`` (in **app/Config/Services.php**) now extends ``CodeIgniter\Config\BaseService`` to allow proper discovery of third-party services. See the repo's diff --git a/user_guide_src/source/changelogs/v4.1.0.rst b/user_guide_src/source/changelogs/v4.1.0.rst index eee8abfddc28..9bed70d70aab 100644 --- a/user_guide_src/source/changelogs/v4.1.0.rst +++ b/user_guide_src/source/changelogs/v4.1.0.rst @@ -12,7 +12,7 @@ Release Date: January 31, 2021 BREAKING ******** -- ``Autoloader::loadLegacy()`` method was previously used for migration of non-namespaced classes in transition to CodeIgniter v4. Since v4.1.0, this support was removed. +- The ``Autoloader::loadLegacy()`` method was previously used for migration of non-namespaced classes in transition to CodeIgniter v4. Since v4.1.0, this support was removed. Changes ******* @@ -22,7 +22,7 @@ Changes Deprecations ************ -- Deprecated ``Model::fillPlaceholders()`` method, use ``Validation::fillPlaceholders()`` instead. +- Deprecated ``Model::fillPlaceholders()`` method. Use ``Validation::fillPlaceholders()`` instead. Bugs Fixed ********** diff --git a/user_guide_src/source/changelogs/v4.1.2.rst b/user_guide_src/source/changelogs/v4.1.2.rst index 63c993396f7c..10e2b11f21f2 100644 --- a/user_guide_src/source/changelogs/v4.1.2.rst +++ b/user_guide_src/source/changelogs/v4.1.2.rst @@ -15,7 +15,7 @@ BREAKING Fixed `a bug `_ in ``current_url()`` that prevented configurations with an ``indexPage`` from including that value in the return value. Any installations using ``App::$indexPage`` should expect altered values from ``current_url()`` and all its dependencies -(including Response Testing, Pager, Form Helper, Pager, and View Parser). +(including Response Testing, Pager, Form Helper, and View Parser). Enhancements ------------ @@ -24,22 +24,22 @@ Enhancements - New ``assertRedirectTo()`` assertion available for HTTP tests. - New logger handler, ``ErrorlogHandler``, that writes to ``error_log()``. - Entity. Added custom type casting functionality. -- New option in routing. The ``priority`` option lower the priority of specific route processing. -- The ``Autoloader`` class can now load files which do not contain PHP classes. The list of `non-class` files will be listed in the ``$files`` property of ``Config\Autoload`` class. +- New option in routing. The ``priority`` option lowers the priority of specific route processing. +- The ``Autoloader`` class can now load files which do not contain PHP classes. The non-class files are listed in the ``$files`` property of the ``Config\Autoload`` class. Changes ------- - Layouts in views now support nested sections. - ``Response::getCookie`` now returns a ``Cookie`` instance instead of an array of cookie attributes. -- ``Response::getCookies`` now returns an array of ``Cookie`` instances instead of array of array of attributes. +- ``Response::getCookies`` now returns an array of ``Cookie`` instances instead of an array of arrays of attributes. - To eliminate warnings from modern browsers' consoles, empty samesite values will be defaulted to ``Lax`` on cookie dispatch. -- `Model::errors()` and `BaseModel::errors()` now always returns `array`; there was no definition change but the docblock has been updated. +- ``Model::errors()`` and ``BaseModel::errors()`` now always return ``array``; there was no definition change but the docblock has been updated. - ``Entity::castAs`` has changed behavior. Added new parameter ``$method``. Type casting has been moved to separate handlers. - Entity. Timestamp casting now throws an exception when an invalid value is passed - ``Entity::castAsJson`` uses external cast handler ``JsonCast::get``. - ``Entity::mutateDate`` uses external cast handler ``DatetimeCast::get``. -- In order for ``Config\**`` classes to get their respective properties' values from the ``.env``, it is now necessary to namespace the property with the name of the class. Previously, the property names are enough but now disallowed because it can get system environment variables, like ``PATH``. +- In order for ``Config\**`` classes to get their respective properties' values from the ``.env``, it is now necessary to namespace the property with the name of the class. Previously, the property names were enough, but this is now disallowed because it can get system environment variables, like ``PATH``. - The array helper ``_array_search_dot`` is now marked for ``@internal`` use. As this is used by ``dot_array_search``, users should not use ``_array_search_dot`` directly in their code. - ``CacheInterface::getMetaData()`` returns ``null`` for misses, or an array with at least the "expires" key set to the absolute epoch expiration, or ``null`` for "never expires". The File, Memcached, and Wincache Handlers still return ``false`` which will become ``null`` in a future release. @@ -47,12 +47,12 @@ Deprecations ------------ - Deprecated ``CodeIgniter\View\View::$currentSection`` property. -- Language strings and exceptions on invalid cookie samesite are deprecated for the ``CookieException``'s own exception message. -- Deprecated `CodeIgniter\Entity` in favor of `CodeIgniter\Entity\Entity` +- Language strings and exceptions for invalid cookie samesite values are deprecated in favor of ``CookieException``'s own exception message. +- Deprecated ``CodeIgniter\Entity`` in favor of ``CodeIgniter\Entity\Entity`` - Deprecated cookie-related properties of ``Response`` in order to use the ``Cookie`` class. - Deprecated cookie-related properties of ``Security`` in order to use the ``Cookie`` class. - Deprecated cookie-related properties of ``Session`` in order to use the ``Cookie`` class. -- Deprecated ``Security::isExpired()`` to use the ``Cookie``'s internal expires status. +- Deprecated ``Security::isExpired()`` in favor of ``Cookie``'s internal expiration status. - Deprecated ``CIDatabaseTestCase`` to use the ``DatabaseTestTrait`` instead. - Deprecated ``FeatureTestCase`` to use the ``FeatureTestTrait`` instead. - Deprecated ``ControllerTester`` to use the ``ControllerTestTrait`` instead. diff --git a/user_guide_src/source/changelogs/v4.1.4.rst b/user_guide_src/source/changelogs/v4.1.4.rst index b3fad8dd8b53..c5254765fbe9 100644 --- a/user_guide_src/source/changelogs/v4.1.4.rst +++ b/user_guide_src/source/changelogs/v4.1.4.rst @@ -17,46 +17,46 @@ BREAKING - The following methods were changed from "public" to "protected" to match their parent class methods and better align with their uses: - * ``CodeIgniter\Database\MySQLi\Connection::execute()`` - * ``CodeIgniter\Database\MySQLi\Connection::_fieldData()`` - * ``CodeIgniter\Database\MySQLi\Connection::_indexData()`` - * ``CodeIgniter\Database\MySQLi\Connection::_foreignKeyData()`` - * ``CodeIgniter\Database\Postgre\Builder::_like_statement()`` - * ``CodeIgniter\Database\Postgre\Connection::execute()`` - * ``CodeIgniter\Database\Postgre\Connection::_fieldData()`` - * ``CodeIgniter\Database\Postgre\Connection::_indexData()`` - * ``CodeIgniter\Database\Postgre\Connection::_foreignKeyData()`` - * ``CodeIgniter\Database\SQLSRV\Connection::execute()`` - * ``CodeIgniter\Database\SQLSRV\Connection::_fieldData()`` - * ``CodeIgniter\Database\SQLSRV\Connection::_indexData()`` - * ``CodeIgniter\Database\SQLSRV\Connection::_foreignKeyData()`` - * ``CodeIgniter\Database\SQLite3\Connection::execute()`` - * ``CodeIgniter\Database\SQLite3\Connection::_fieldData()`` - * ``CodeIgniter\Database\SQLite3\Connection::_indexData()`` - * ``CodeIgniter\Database\SQLite3\Connection::_foreignKeyData()`` - * ``CodeIgniter\Images\Handlers\GDHandler::_flatten()`` - * ``CodeIgniter\Images\Handlers\GDHandler::_flip()`` - * ``CodeIgniter\Images\Handlers\ImageMagickHandler::_flatten()`` - * ``CodeIgniter\Images\Handlers\ImageMagickHandler::_flip()`` - * ``CodeIgniter\Test\Mock\MockIncomingRequest::detectURI()`` - * ``CodeIgniter\Test\Mock\MockSecurity.php::sendCookie()`` - -- To be compatible with the strict inheritance checks of PHP 8.1, the following method signatures were added return types to match their parents' signatures whenever possible: - - * ``CodeIgniter\Cookie\Cookie::offsetExists()`` - * ``CodeIgniter\Cookie\Cookie::offsetSet()`` - * ``CodeIgniter\Cookie\Cookie::offsetUnset()`` - * ``CodeIgniter\Cookie\CookieStore::getIterator()`` - * ``CodeIgniter\I18n\Time::__wakeup()`` - * ``CodeIgniter\Test\Filters\CITestStreamFilter::filter()`` + * ``CodeIgniter\Database\MySQLi\Connection::execute()`` + * ``CodeIgniter\Database\MySQLi\Connection::_fieldData()`` + * ``CodeIgniter\Database\MySQLi\Connection::_indexData()`` + * ``CodeIgniter\Database\MySQLi\Connection::_foreignKeyData()`` + * ``CodeIgniter\Database\Postgre\Builder::_like_statement()`` + * ``CodeIgniter\Database\Postgre\Connection::execute()`` + * ``CodeIgniter\Database\Postgre\Connection::_fieldData()`` + * ``CodeIgniter\Database\Postgre\Connection::_indexData()`` + * ``CodeIgniter\Database\Postgre\Connection::_foreignKeyData()`` + * ``CodeIgniter\Database\SQLSRV\Connection::execute()`` + * ``CodeIgniter\Database\SQLSRV\Connection::_fieldData()`` + * ``CodeIgniter\Database\SQLSRV\Connection::_indexData()`` + * ``CodeIgniter\Database\SQLSRV\Connection::_foreignKeyData()`` + * ``CodeIgniter\Database\SQLite3\Connection::execute()`` + * ``CodeIgniter\Database\SQLite3\Connection::_fieldData()`` + * ``CodeIgniter\Database\SQLite3\Connection::_indexData()`` + * ``CodeIgniter\Database\SQLite3\Connection::_foreignKeyData()`` + * ``CodeIgniter\Images\Handlers\GDHandler::_flatten()`` + * ``CodeIgniter\Images\Handlers\GDHandler::_flip()`` + * ``CodeIgniter\Images\Handlers\ImageMagickHandler::_flatten()`` + * ``CodeIgniter\Images\Handlers\ImageMagickHandler::_flip()`` + * ``CodeIgniter\Test\Mock\MockIncomingRequest::detectURI()`` + * ``CodeIgniter\Test\Mock\MockSecurity::sendCookie()`` + +- To be compatible with the strict inheritance checks of PHP 8.1, return types were added to the following method signatures to match their parents' signatures whenever possible: + + * ``CodeIgniter\Cookie\Cookie::offsetExists()`` + * ``CodeIgniter\Cookie\Cookie::offsetSet()`` + * ``CodeIgniter\Cookie\Cookie::offsetUnset()`` + * ``CodeIgniter\Cookie\CookieStore::getIterator()`` + * ``CodeIgniter\I18n\Time::__wakeup()`` + * ``CodeIgniter\Test\Filters\CITestStreamFilter::filter()`` - Related to the strict inheritance checks of PHP 8.1, the following session handlers implementing ``SessionHandlerInterface`` have their public methods modified to match the interface: - * ``CodeIgniter\Session\Handlers\ArrayHandler`` - * ``CodeIgniter\Session\Handlers\DatabaseHandler`` - * ``CodeIgniter\Session\Handlers\FileHandler`` - * ``CodeIgniter\Session\Handlers\MemcachedHandler`` - * ``CodeIgniter\Session\Handlers\RedisHandler`` + * ``CodeIgniter\Session\Handlers\ArrayHandler`` + * ``CodeIgniter\Session\Handlers\DatabaseHandler`` + * ``CodeIgniter\Session\Handlers\FileHandler`` + * ``CodeIgniter\Session\Handlers\MemcachedHandler`` + * ``CodeIgniter\Session\Handlers\RedisHandler`` See the repo's `CHANGELOG_4.1.md `_ diff --git a/user_guide_src/source/changelogs/v4.1.5.rst b/user_guide_src/source/changelogs/v4.1.5.rst index 02393424dacb..160a3d0d6b66 100644 --- a/user_guide_src/source/changelogs/v4.1.5.rst +++ b/user_guide_src/source/changelogs/v4.1.5.rst @@ -12,25 +12,26 @@ Release Date: November 8, 2021 BREAKING ======== -- Fixed `a bug `_ on CSRF protection. Now CSRF protection works on PUT/PATCH/DELETE requests when CSRF filter is applied. If you use such requests, you need to send CSRF token. +- Fixed `a bug `_ in CSRF protection. Now CSRF protection works on PUT/PATCH/DELETE requests when the CSRF filter is applied. If you use such requests, you need to send the CSRF token. - In the previous version, if you didn't provide your own headers, ``CURLRequest`` would send the request-headers from the browser, due to a bug. As of this version, it does not send them. -- Fixed ``BaseBuilder::insertBatch()`` return value for ``testMode``. Now it returns SQL string array instead of a number of affected rows. This change was made because of maintaining compatibility between returning types for batch methods. Now the returned data type for ``BaseBuilder::insertBatch()`` is the same as the `updateBatch()` method. -- Major optimizations have been made to the way data is processed in ``BaseBuilder::insertBatch()`` and ``BaseBuilder::updateBatch()`` methods. This resulted in reduced memory usage and faster query processing. As a trade-off, the result generated by the ``$query->getOriginalQuery()`` method was changed. It no longer returns the query with the binded parameters, but the actual query that was run. +- Fixed ``BaseBuilder::insertBatch()`` return value for ``testMode``. Now it returns an SQL string array instead of the number of affected rows. This change was made to maintain compatibility between the return types of batch methods. Now the returned data type for ``BaseBuilder::insertBatch()`` is the same as for the ``updateBatch()`` method. +- Major optimizations have been made to the way data is processed in ``BaseBuilder::insertBatch()`` and ``BaseBuilder::updateBatch()`` methods. This resulted in reduced memory usage and faster query processing. As a trade-off, the result generated by the ``$query->getOriginalQuery()`` method was changed. It no longer returns the query with the bound parameters, but the actual query that was run. Enhancements ============ - Added Cache config for reserved characters - The :ref:`addForeignKey()` function of the ``Forge`` class can now define composite foreign keys in an array -- The ``dropKey`` function of the ``Forge`` class can remove key -- Now ``_`` can be used as separators in environment variable. See :ref:`env-var-namespace-separator`. -- Added Multiple filters for a route and Classname filter +- The ``dropKey`` function of the ``Forge`` class can remove a key +- Now ``_`` can be used as a separator in environment variables. See :ref:`env-var-namespace-separator`. +- Added multiple filters for a route and classname filters - Reduced memory usage of ``insertBatch()`` and ``updateBatch()`` -- Added :ref:`Session based CSRF Protection ` +- Added :ref:`Session-based CSRF Protection ` - Added ``valid_url_strict`` rule for ``Validation`` - Debug Toolbar - - Added formatted query string to timeline - - Improved keyword highlighting and escaping of query strings + + - Added formatted query string to timeline + - Improved keyword highlighting and escaping of query strings Changes ======= diff --git a/user_guide_src/source/changelogs/v4.1.6.rst b/user_guide_src/source/changelogs/v4.1.6.rst index 14e43d0adc84..a0ef55b60241 100644 --- a/user_guide_src/source/changelogs/v4.1.6.rst +++ b/user_guide_src/source/changelogs/v4.1.6.rst @@ -24,28 +24,28 @@ BREAKING Validation changes ================== -- The previous version of the Validation can't handle an array item. +- The previous version of the Validation could not handle an array item. Because of the bug fix, the validation results may be different, - or raise a ``TypeError``. + or validation may raise a ``TypeError``. But the previous version's results are probably incorrect. -- The Validation separated the validation process of multiple field - like ``contacts.*.name`` and single field. - When a single field has an array data, the previous version validates each element of the array. - The validation rule gets an element of the array as the parameter. +- The Validation separates the validation process of multiple fields + like ``contacts.*.name`` and of a single field. + When a single field had array data, the previous version validated each element of the array. + The validation rule got an element of the array as the parameter. On the other hand, the current version passes the array to the validation rule as a whole. Enhancements ************ - Full support for PHP 8.1. -- Database pane on debug toolbar now displays location where Query was called from. Also displays full backtrace. +- Database pane on debug toolbar now displays the location where the query was called from. Also displays the full backtrace. - :ref:`Subqueries ` in QueryBuilder can now be an instance of the BaseBuilder class. - Kint was updated from ^3.3 to ^4.0. Changes ******* -- The process of sending cookies has been moved to the ``Response`` class. Now the ``Security`` and ``CookieStore`` class don't send cookies, set them to the Response. +- The process of sending cookies has been moved to the ``Response`` class. Now the ``Security`` and ``CookieStore`` classes don't send cookies, but set them on the Response. Deprecations ************ diff --git a/user_guide_src/source/changelogs/v4.1.7.rst b/user_guide_src/source/changelogs/v4.1.7.rst index 592358514b09..7e955f6abf83 100644 --- a/user_guide_src/source/changelogs/v4.1.7.rst +++ b/user_guide_src/source/changelogs/v4.1.7.rst @@ -12,22 +12,22 @@ Release Date: January 9, 2022 BREAKING ******** -- Because ``FILTER_SANITIZE_STRING`` is deprecated since PHP 8.1, ``get_cookie()`` that uses it when ``$xssClean`` is true changed the output. Now it uses ``FILTER_SANITIZE_FULL_SPECIAL_CHARS``. Note that using XSS filtering is a bad practice. It does not prevent XSS attacks perfectly. Using ``esc()`` with the correct ``$context`` in the views is recommended. +- Because ``FILTER_SANITIZE_STRING`` has been deprecated since PHP 8.1, the output of ``get_cookie()``, which uses it when ``$xssClean`` is true, has changed. Now it uses ``FILTER_SANITIZE_FULL_SPECIAL_CHARS``. Note that using XSS filtering is a bad practice. It does not prevent XSS attacks perfectly. Using ``esc()`` with the correct ``$context`` in the views is recommended. Enhancements ************ -none. +None. Changes ******* -none. +None. Deprecations ************ -none. +None. Bugs Fixed ********** diff --git a/user_guide_src/source/changelogs/v4.2.0.rst b/user_guide_src/source/changelogs/v4.2.0.rst index 861666077934..85318be96759 100644 --- a/user_guide_src/source/changelogs/v4.2.0.rst +++ b/user_guide_src/source/changelogs/v4.2.0.rst @@ -12,7 +12,7 @@ Release Date: June 3, 2022 Highlights ********** -- Update minimal PHP requirement to 7.4. +- Update minimum PHP requirement to 7.4. - To make the default configuration more secure, auto-routing has been changed to disabled by default. - **OCI8 Driver for Oracle Database** (*contributed by* `ytetsuro `_). See `Database`_. - **Improved Auto Routing** (opt-in) (*contributed by* `kenjis `_). See `New Improved Auto Routing`_. @@ -38,8 +38,8 @@ BREAKING Method Signature Changes ======================== -- The method signature of ``CodeIgniter\Database\BaseBuilder::join()`` and ``CodeIgniter\Database\*\Builder::join()`` have been changed. -- The method signature of ``Validation::setRule()`` has been changed. The ``string`` typehint on the ``$rules`` parameter was removed. Extending classes should likewise remove the parameter so as not to break LSP. +- The method signatures of ``CodeIgniter\Database\BaseBuilder::join()`` and ``CodeIgniter\Database\*\Builder::join()`` have been changed. +- The method signature of ``Validation::setRule()`` has been changed. The ``string`` typehint on the ``$rules`` parameter was removed. Extending classes should likewise remove the typehint so as not to break LSP. - The method signature of ``CodeIgniter\CLI\CommandRunner::_remap()`` has been changed to fix a bug. - The default parameter values for ``Service::reset()`` and ``CIUnitTestCase::resetServices()`` have been changed from ``false`` to ``true``. This is to eliminate unexpected problems during testing, such as ``lang()`` not getting translated messages. @@ -47,15 +47,17 @@ Behavior Changes ================ - The ``CodeIgniter\CodeIgniter`` class has a new property ``$context`` and it must have the correct context at runtime. So the following files have been changed: - - ``public/index.php`` - - ``spark`` -- The ``system/bootstrap.php`` file has been modified to easily implement `Preloading `_. Returning a ``CodeIgniter`` instance and loading ``.env`` file have been moved to ``index.php`` and ``spark``. -- The ``CodeIgniter\Autoloader\Autoloader::initialize()`` has changed the behavior to fix a bug. It used to use Composer classmap only when ``$modules->discoverInComposer`` is true. Now it always uses the Composer classmap if Composer is available. + + - ``public/index.php`` + - ``spark`` + +- The ``system/bootstrap.php`` file has been modified to easily implement `Preloading `_. Returning a ``CodeIgniter`` instance and loading the ``.env`` file have been moved to ``index.php`` and ``spark``. +- The behavior of ``CodeIgniter\Autoloader\Autoloader::initialize()`` has changed to fix a bug. It used to use the Composer classmap only when ``$modules->discoverInComposer`` is true. Now it always uses the Composer classmap if Composer is available. - The color code output by :ref:`CLI::color() ` has been changed to fix a bug. - To prevent unexpected access from the web browser, if a controller is added to a cli route (``$routes->cli()``), all methods of that controller are no longer accessible via auto-routing. -- There is a possible backward compatibility break for those users extending the History Collector and they should probably update ``History::setFiles()`` method. -- The :php:func:`dot_array_search()`'s unexpected behavior has been fixed. Now ``dot_array_search('foo.bar.baz', ['foo' => ['bar' => 23]])`` returns ``null``. The previous versions returned ``23``. -- The ``CodeIgniter::storePreviousURL()`` has been changed to store only the URLs whose Content-Type was ``text/html``. It also affects the behavior of :php:func:`previous_url()` and :php:func:`redirect()->back() `. +- There is a possible backward compatibility break for users extending the History Collector, and they should probably update the ``History::setFiles()`` method. +- The unexpected behavior of :php:func:`dot_array_search()` has been fixed. Now ``dot_array_search('foo.bar.baz', ['foo' => ['bar' => 23]])`` returns ``null``. Previous versions returned ``23``. +- ``CodeIgniter::storePreviousURL()`` has been changed to store only the URLs whose Content-Type was ``text/html``. It also affects the behavior of :php:func:`previous_url()` and :php:func:`redirect()->back() `. Enhancements ************ @@ -65,57 +67,80 @@ Enhancements New Improved Auto Routing ========================= -Added an optional new more secure auto router. These are the changes from the legacy auto-routing: +Added a new, optional, more secure auto router. These are the changes from the legacy auto-routing: + +- A controller method needs an HTTP verb prefix like ``getIndex()``, ``postCreate()``. + + - Developers always know the HTTP method, so requests by an unexpected HTTP method do not pass. -- A controller method needs HTTP verb prefix like ``getIndex()``, ``postCreate()``. - - Developers always know the HTTP method, so requests by an unexpected HTTP method does not pass. - The Default Controller (``Home`` by default) and the Default Method (``index`` by default) must be omitted in the URI. - - It restricts one-to-one correspondence between controller methods and URIs. - - E.g. by default, you can access ``/``, but ``/home`` and ``/home/index`` will be 404. -- It checks method parameter count. - - If there are more parameters in the URI than the method parameters, it results in 404. -- It does not support ``_remap()`` method. - - It restricts one-to-one correspondence between controller methods and URIs. -- Can't access controllers in Defined Routes. - - It completely separates controllers accessible via **Auto Routes** from those accessible via **Defined Routes**. + + - It enforces a one-to-one correspondence between controller methods and URIs. + - E.g. by default, you can access ``/``, but ``/home`` and ``/home/index`` will be 404. + +- It checks the method parameter count. + + - If there are more parameters in the URI than the method parameters, it results in a 404. + +- It does not support the ``_remap()`` method. + + - It enforces a one-to-one correspondence between controller methods and URIs. + +- It can't access controllers in Defined Routes. + + - It completely separates controllers accessible via **Auto Routes** from those accessible via **Defined Routes**. See :ref:`auto-routing-improved` for the details. Database ======== -- Added new OCI8 driver for database. - - It can access Oracle Database and supports SQL and PL/SQL statements. +- Added a new OCI8 database driver. + + - It can access Oracle Database and supports SQL and PL/SQL statements. + - QueryBuilder - - Added Subqueries in the FROM section. See :ref:`query-builder-from-subquery`. - - Added Subqueries in the SELECT section. See :ref:`query-builder-select`. - - The ``BaseBuilder::buildSubquery()`` method can take an optional third argument ``string $alias``. - - Union queries. See :ref:`query-builder-union`. + + - Added Subqueries in the FROM section. See :ref:`query-builder-from-subquery`. + - Added Subqueries in the SELECT section. See :ref:`query-builder-select`. + - The ``BaseBuilder::buildSubquery()`` method can take an optional third argument ``string $alias``. + - Union queries. See :ref:`query-builder-union`. + - Raw SQL string support - - Added the class ``CodeIgniter\Database\RawSql`` which expresses raw SQL strings. - - :ref:`select() `, :ref:`where() `, :ref:`like() `, :ref:`join() ` accept the ``CodeIgniter\Database\RawSql`` instance. - - ``DBForge::addField()`` default value raw SQL string support. See :ref:`forge-addfield-default-value-rawsql`. + + - Added the class ``CodeIgniter\Database\RawSql`` which expresses raw SQL strings. + - :ref:`select() `, :ref:`where() `, :ref:`like() `, :ref:`join() ` accept a ``CodeIgniter\Database\RawSql`` instance. + - ``DBForge::addField()`` default value raw SQL string support. See :ref:`forge-addfield-default-value-rawsql`. + - SQLite3 has a new Config item ``foreignKeys`` that enables foreign key constraints. Helpers and Functions ===================== - HTML helper ``script_tag()`` now uses ``null`` values to write boolean attributes in minimized form: `` -In that case, you can change the delimiters for conditionals with the ``setConditionalDelimiters()`` method to avoid misinterpretations: +In that case, you can change the delimiters for conditionals with the ``setConditionalDelimiters()`` method to avoid +misinterpretations: .. literalinclude:: view_parser/027.php @@ -388,23 +351,23 @@ In this case, you will write the code in your template like this:: Escaping Data ============= -Variable substitutions without filters are escaped by default to help prevent XSS attacks on your pages. -CodeIgniter's ``esc()`` method supports several contexts, such as ``html``, ``attr``, and ``css``. -If no context is specified, the Parser uses ``html``. You can specify the context with the ``esc`` filter:: +Variable substitutions without filters are escaped by default to help prevent XSS attacks on your pages. CodeIgniter's +``esc()`` method supports several contexts, such as ``html``, ``attr``, and ``css``. If no context is specified, the +Parser uses ``html``. You can specify the context with the ``esc`` filter:: { user_styles | esc(css) } { title } -When a substitution uses one or more filters, the Parser does not add an ``esc`` filter automatically. -This also applies when a context is specified with ``setData()`` or ``setVar()``. -Add ``esc`` explicitly when filtering untrusted data. Filters run from left to right, so its position matters:: +When a substitution uses one or more filters, the Parser does not add an ``esc`` filter automatically. This also applies +when a context is specified with ``setData()`` or ``setVar()``. Add ``esc`` explicitly when filtering untrusted data. +Filters run from left to right, so its position matters:: { title|capitalize|esc } { body|esc|nl2br } -In the second example, ``esc`` escapes the input before ``nl2br`` adds HTML ``
`` tags. -Escaping after ``nl2br`` would display those tags as text. -Unknown filter names are ignored, but still prevent automatic escaping; check filter names carefully. +In the second example, ``esc`` escapes the input before ``nl2br`` adds HTML ``
`` tags. Escaping after ``nl2br`` +would display those tags as text. Unknown filter names are ignored, but still prevent automatic escaping; check filter +names carefully. To disable automatic escaping for a substitution without filters, add exclamation marks to its delimiters:: @@ -413,8 +376,8 @@ To disable automatic escaping for a substitution without filters, add exclamatio Filters ======= -Any single variable substitution can have one or more filters applied to it to modify the way it is presented. These -are not intended to drastically change the output, but to provide ways to reuse the same variable data with different +Any single variable substitution can have one or more filters applied to it to modify the way it is presented. These are +not intended to drastically change the output, but to provide ways to reuse the same variable data with different presentations. The ``esc`` filter discussed above is one example. Dates are another common use case, where you might need to format the same data differently in several sections on the same page. @@ -427,8 +390,8 @@ If the filter takes any arguments, they must be separated by commas and enclosed { created_at|date(Y-m-d) } -Multiple filters can be applied to the value by piping multiple ones together. They are processed in order, from -left to right:: +Multiple filters can be applied to the value by piping multiple ones together. They are processed in order, from left to +right:: { created_at|date_modify(+5 days)|date(Y-m-d) } @@ -506,14 +469,12 @@ See `PHP's NumberFormatter Second Link -An example with the iteration controlled in the controller, -using a view fragment: +An example with the iteration controlled in the controller, using a view fragment: .. literalinclude:: view_parser/021.php @@ -677,11 +633,12 @@ Class Reference - ``cache`` - the time in seconds to save a view's results - ``cache_name`` - the ID used to save/retrieve a cached view result; defaults to the viewpath - - ``cascadeData`` - true if the data pairs in effect when a nested or loop substitution occurs should be propagated + - ``cascadeData`` - true if the data pairs in effect when a nested or loop substitution occurs should be + propagated - ``saveData`` - true if the view data parameter should be retained for subsequent calls - Any conditional substitutions are performed first, then remaining - substitutions are performed for each data pair. + Any conditional substitutions are performed first, then remaining substitutions are performed for each data + pair. .. php:method:: renderString($template[, $options[, $saveData]]) @@ -695,10 +652,8 @@ Class Reference .. literalinclude:: view_parser/023.php - Never build the template source from user-provided content. Pass it as - data through ``setData()`` instead, or - :ref:`restrict conditionals ` if users are - meant to edit the template: + Never build the template source from user-provided content. Pass it as data through ``setData()`` instead, or + :ref:`restrict conditionals ` if users are meant to edit the template: .. literalinclude:: view_parser/029.php @@ -715,8 +670,7 @@ Class Reference .. literalinclude:: view_parser/024.php - Supported escape contexts: html, css, js, url, attr or raw. - If 'raw', no escaping will happen. + Supported escape contexts: html, css, js, url, attr or raw. If 'raw', no escaping will happen. .. php:method:: setVar($name[, $value = null[, $context = null]]) @@ -730,8 +684,7 @@ Class Reference .. literalinclude:: view_parser/025.php - Supported escape contexts: html, css, js, url, attr or raw. - If 'raw', no escaping will happen. + Supported escape contexts: html, css, js, url, attr or raw. If 'raw', no escaping will happen. .. php:method:: setDelimiters($leftDelimiter = '{', $rightDelimiter = '}') diff --git a/user_guide_src/source/outgoing/view_renderer.rst b/user_guide_src/source/outgoing/view_renderer.rst index 3277f69c7b7a..e8ef917ac9b1 100644 --- a/user_guide_src/source/outgoing/view_renderer.rst +++ b/user_guide_src/source/outgoing/view_renderer.rst @@ -10,45 +10,41 @@ View Renderer Using the View Renderer *********************** -The :php:func:`view()` function is a convenience function that grabs an instance of the -``renderer`` service, sets the data, and renders the view. While this is often -exactly what you want, you may find times where you want to work with it more directly. -In that case you can access the View service directly: +The :php:func:`view()` function is a convenience function that grabs an instance of the ``renderer`` service, sets the +data, and renders the view. While this is often exactly what you want, you may find times where you want to work with it +more directly. In that case you can access the View service directly: .. literalinclude:: view_renderer/001.php :lines: 2- -Alternatively, if you are not using the ``View`` class as your default renderer, you -can instantiate it directly: +Alternatively, if you are not using the ``View`` class as your default renderer, you can instantiate it directly: .. literalinclude:: view_renderer/002.php :lines: 2- -.. important:: You should create services only within controllers. If you need - access to the View class from a library, you should set that as a dependency - in your library's constructor. +.. important:: You should create services only within controllers. If you need access to the View class from a library, + you should set that as a dependency in your library's constructor. Then you can use any of the three standard methods that it provides: -:php:meth:`render() `, -:php:meth:`setVar() ` and +:php:meth:`render() `, :php:meth:`setVar() ` and :php:meth:`setData() `. What It Does ============ -The ``View`` class processes conventional HTML/PHP scripts stored in the application's view path, -after extracting view parameters into PHP variables, accessible inside the scripts. -This means that your view parameter names need to be legal PHP variable names. +The ``View`` class processes conventional HTML/PHP scripts stored in the application's view path, after extracting view +parameters into PHP variables, accessible inside the scripts. This means that your view parameter names need to be legal +PHP variable names. -The View class uses an associative array internally to accumulate view parameters -until you call its ``render()`` method. This means that your parameter (or variable) names -need to be unique, or a later variable setting will override an earlier one. +The View class uses an associative array internally to accumulate view parameters until you call its ``render()`` +method. This means that your parameter (or variable) names need to be unique, or a later variable setting will override +an earlier one. -This also impacts escaping parameter values for different contexts inside your -script. You will have to give each escaped value a unique parameter name. +This also impacts escaping parameter values for different contexts inside your script. You will have to give each +escaped value a unique parameter name. -No special meaning is attached to parameters whose value is an array. It is up -to you to process the array appropriately in your PHP code. +No special meaning is attached to parameters whose value is an array. It is up to you to process the array appropriately +in your PHP code. Setting View Parameters ======================= @@ -58,8 +54,7 @@ The :php:meth:`setVar() ` method sets a view .. literalinclude:: view_renderer/008.php :lines: 2- -The :php:meth:`setData() ` method sets multiple view -parameters at once. +The :php:meth:`setData() ` method sets multiple view parameters at once. .. literalinclude:: view_renderer/007.php :lines: 2- @@ -67,8 +62,8 @@ parameters at once. Method Chaining =============== -The ``setVar()`` and ``setData()`` methods are chainable, allowing you to combine a -number of different calls together in a chain: +The ``setVar()`` and ``setData()`` methods are chainable, allowing you to combine a number of different calls together +in a chain: .. literalinclude:: view_renderer/003.php :lines: 2- @@ -77,16 +72,16 @@ Escaping Data ============= When you pass data to the ``setVar()`` and ``setData()`` functions, you have the option to escape the data to protect -against cross-site scripting attacks. As the last parameter in either method, you can pass the desired context to -escape the data for. See below for context descriptions. +against cross-site scripting attacks. As the last parameter in either method, you can pass the desired context to escape +the data for. See below for context descriptions. If you don't want the data to be escaped, you can pass ``null`` or ``'raw'`` as the final parameter to each function: .. literalinclude:: view_renderer/004.php :lines: 2- -If you choose not to escape data, or you are passing in an object instance, you can manually escape the data within -the view with the :php:func:`esc()` function. The first parameter is the string to escape. The second parameter is the +If you choose not to escape data, or you are passing in an object instance, you can manually escape the data within the +view with the :php:func:`esc()` function. The first parameter is the string to escape. The second parameter is the context to escape the data for (see below):: getStat()) ?> @@ -95,9 +90,9 @@ Escaping Contexts ----------------- By default, the ``esc()`` and, in turn, the ``setVar()`` and ``setData()`` functions assume that the data you want to -escape is intended to be used within standard HTML. However, if the data is intended for use in JavaScript, CSS, -or in an href attribute, you would need different escaping rules to be effective. You can pass in the name of the -context as the second parameter. Valid contexts are ``'html'``, ``'js'``, ``'css'``, ``'url'``, and ``'attr'``:: +escape is intended to be used within standard HTML. However, if the data is intended for use in JavaScript, CSS, or in +an href attribute, you would need different escaping rules to be effective. You can pass in the name of the context as +the second parameter. Valid contexts are ``'html'``, ``'js'``, ``'css'``, ``'url'``, and ``'attr'``:: Some Link @@ -118,18 +113,16 @@ Several options can be passed to the ``render()`` or ``renderString()`` methods: - ``$options`` - - ``cache`` - the time in seconds to save a view's results; ignored for + - ``cache`` - the time in seconds to save a view's results; ignored for ``renderString()``. + - ``cache_name`` - the ID used to save/retrieve a cached view result; defaults to the ``$viewPath``; ignored for ``renderString()``. - - ``cache_name`` - the ID used to save/retrieve a cached view result; defaults - to the ``$viewPath``; ignored for ``renderString()``. - - ``debug`` - can be set to false to disable the addition of debug code for - the :ref:`Debug Toolbar `. + - ``debug`` - can be set to false to disable the addition of debug code for the + :ref:`Debug Toolbar `. -- ``$saveData`` - true if the view data parameters should be retained for - subsequent calls. +- ``$saveData`` - true if the view data parameters should be retained for subsequent calls. -.. note:: ``$saveData`` as defined by the interface must be a boolean, but implementing - classes (like ``View`` below) may extend this to include ``null`` values. +.. note:: ``$saveData`` as defined by the interface must be a boolean, but implementing classes (like ``View`` below) + may extend this to include ``null`` values. *************** Class Reference @@ -165,11 +158,10 @@ Class Reference .. literalinclude:: view_renderer/006.php :lines: 2- - .. warning:: ``renderString()`` executes the given view contents as PHP code, - just like a view file. Treat them as trusted code: never pass contents that - less-trusted users can edit, even if they are stored in your database. - Escaping or validating such contents does not make them safe to execute. - Pass user-provided values as view data instead. + .. warning:: ``renderString()`` executes the given view contents as PHP code, just like a view file. Treat them + as trusted code: never pass contents that less-trusted users can edit, even if they are stored in your + database. Escaping or validating such contents does not make them safe to execute. Pass user-provided values + as view data instead. .. php:method:: setData([$data[, $context = null]]) @@ -183,11 +175,10 @@ Class Reference .. literalinclude:: view_renderer/007.php :lines: 2- - Supported escape contexts: ``html``, ``css``, ``js``, ``url``, ``attr`` or ``raw``. - If ``'raw'``, no escaping will happen. + Supported escape contexts: ``html``, ``css``, ``js``, ``url``, ``attr`` or ``raw``. If ``'raw'``, no escaping + will happen. - Each call adds to the array of data that the object is accumulating, - until the view is rendered. + Each call adds to the array of data that the object is accumulating, until the view is rendered. .. php:method:: setVar($name[, $value = null[, $context = null]]) @@ -202,8 +193,8 @@ Class Reference .. literalinclude:: view_renderer/008.php :lines: 2- - Supported escape contexts: ``html``, ``css``, ``js``, ``url``, ``attr`` or ``raw``. - If ``'raw'``, no escaping will happen. + Supported escape contexts: ``html``, ``css``, ``js``, ``url``, ``attr`` or ``raw``. If ``'raw'``, no escaping + will happen. - If you use a view data variable that you have previously used - for this object, the new value will replace the existing one. + If you use a view data variable that you have previously used for this object, the new value will replace the + existing one. diff --git a/user_guide_src/source/outgoing/views.rst b/user_guide_src/source/outgoing/views.rst index f57e45b09654..adbf95005a82 100644 --- a/user_guide_src/source/outgoing/views.rst +++ b/user_guide_src/source/outgoing/views.rst @@ -6,15 +6,14 @@ Views :local: :depth: 2 -A view is simply a web page, or a page fragment, like a header, footer, sidebar, etc. In fact, -views can flexibly be embedded within other views (within other views, etc.) if you need -this type of hierarchy. +A view is simply a web page, or a page fragment, like a header, footer, sidebar, etc. In fact, views can flexibly be +embedded within other views (within other views, etc.) if you need this type of hierarchy. Views are never called directly. They must be loaded by a controller or :ref:`view route `. -Remember that in an MVC framework, -the Controller acts as the traffic cop, so it is responsible for fetching a particular view. If you have -not read the :doc:`Controllers ` page, you should do so before continuing. +Remember that in an MVC framework, the Controller acts as the traffic cop, so it is responsible for fetching a +particular view. If you have not read the :doc:`Controllers ` page, you should do so before +continuing. Using the example controller you created in the controller page, let's add a view to it. @@ -37,8 +36,8 @@ Then save the file in your **app/Views** directory. Displaying a View ================= -To load and display a particular view file, you will use the :php:func:`view()` -function in your controller, as in the following code: +To load and display a particular view file, you will use the :php:func:`view()` function in your controller, as in the +following code: .. literalinclude:: views/001.php :lines: 2- @@ -49,13 +48,12 @@ Where *name* is the name of your view file. .. note:: The ``view()`` function uses :doc:`view_renderer` internally. -Now, create a file called **Blog.php** in the **app/Controllers** directory, -and put this in it: +Now, create a file called **Blog.php** in the **app/Controllers** directory, and put this in it: .. literalinclude:: views/002.php -Open the routing file located at **app/Config/Routes.php**, and look for the "Route Definitions". -Add the following code: +Open the routing file located at **app/Config/Routes.php**, and look for the "Route Definitions". Add the following +code: .. literalinclude:: views/013.php :lines: 2- @@ -67,11 +65,11 @@ If you visit your site, you should see your new view. The URL is similar to this Loading Multiple Views ====================== -CodeIgniter will intelligently handle multiple calls to :php:func:`view()` from -within a controller. If more than one call happens, they will be appended together. +CodeIgniter will intelligently handle multiple calls to :php:func:`view()` from within a controller. If more than one +call happens, they will be appended together. -For example, you may wish to have a header view, a menu view, a -content view, and a footer view. That might look something like this: +For example, you may wish to have a header view, a menu view, a content view, and a footer view. That might look +something like this: .. literalinclude:: views/003.php @@ -80,8 +78,8 @@ In the example above, we are using "dynamically added data", which you will see Storing Views within Sub-directories ==================================== -Your view files can also be stored within sub-directories if you prefer that type of organization. -When doing so, you will need to include the directory name when loading the view. Example: +Your view files can also be stored within sub-directories if you prefer that type of organization. When doing so, you +will need to include the directory name when loading the view. Example: .. literalinclude:: views/004.php :lines: 2- @@ -92,22 +90,21 @@ Namespaced Views ================ You can store views under a **Views** directory that is namespaced, and load that view as if it were namespaced. While -PHP does not support loading non-class files from a namespace, CodeIgniter provides this feature to make it possible -to package your views together in a module-like fashion for easy re-use or distribution. +PHP does not support loading non-class files from a namespace, CodeIgniter provides this feature to make it possible to +package your views together in a module-like fashion for easy re-use or distribution. -If you have an **example/blog** directory that has a PSR-4 mapping set up in the :doc:`Autoloader ` living -under the namespace ``Example\Blog``, you could retrieve view files as if they were namespaced also. +If you have an **example/blog** directory that has a PSR-4 mapping set up in the +:doc:`Autoloader ` living under the namespace ``Example\Blog``, you could retrieve view files as +if they were namespaced also. -Following this -example, you could load the **blog_view.php** file from **example/blog/Views** by prepending the namespace to the view name -(specifying the end directory ``Views`` as in ``Example\Blog\Views\`` is not required): +Following this example, you could load the **blog_view.php** file from **example/blog/Views** by prepending the +namespace to the view name (specifying the end directory ``Views`` as in ``Example\Blog\Views\`` is not required): .. literalinclude:: views/005.php -.. note:: You must use backslashes (``\``) when referencing namespaced views, - as this is how CodeIgniter distinguishes a namespaced view from a regular - file path. Forward slashes (``/``) are only used for subdirectories within - the standard **app/Views** folder. +.. note:: You must use backslashes (``\``) when referencing namespaced views, as this is how CodeIgniter distinguishes a + namespaced view from a regular file path. Forward slashes (``/``) are only used for subdirectories within the + standard **app/Views** folder. .. _views-overriding-namespaced-views: @@ -116,19 +113,21 @@ Overriding Namespaced Views .. versionadded:: 4.7.0 -You can override a namespaced view by creating a matching directory structure within your application's **app/Views** directory. -This allows you to customize the output of modules or packages without modifying their core source code. +You can override a namespaced view by creating a matching directory structure within your application's **app/Views** +directory. This allows you to customize the output of modules or packages without modifying their core source code. Configuration ------------- -By default, overrides are looked for in the **app/Views/overrides** directory. You can configure this location via the ``$appOverridesFolder`` property in **app/Config/View.php**: +By default, overrides are looked for in the **app/Views/overrides** directory. You can configure this location via the +``$appOverridesFolder`` property in **app/Config/View.php**: .. code-block:: php public string $appOverridesFolder = 'overrides'; -If you prefer to map namespaces directly to the root of **app/Views** (without a subdirectory), you can set this value to an empty string (``''``). +If you prefer to map namespaces directly to the root of **app/Views** (without a subdirectory), you can set this value +to an empty string (``''``). Example ------- @@ -143,7 +142,8 @@ Assume you have a module named **Blog** with the namespace ``Example\Blog``. The └── Views └── blog_view.php -To override this view (using the default configuration), create a file at the matching path within **app/Views/overrides**: +To override this view (using the default configuration), create a file at the matching path within +**app/Views/overrides**: .. code-block:: text @@ -154,28 +154,28 @@ To override this view (using the default configuration), create a file at the ma └── Blog <-- Matches the second part of namespace └── blog_view.php <-- Your custom view -Now, when you call ``view('Example\Blog\blog_view')``, CodeIgniter will automatically load your custom view from **app/Views/overrides/Example/Blog/blog_view.php** instead of the original module view file. +Now, when you call ``view('Example\Blog\blog_view')``, CodeIgniter will automatically load your custom view from +**app/Views/overrides/Example/Blog/blog_view.php** instead of the original module view file. -.. note:: The override path must match exactly how you reference the view. - If you load a view as ``view('Example\Blog\blog_view')``, the override - path is **app/Views/overrides/Example/Blog/blog_view.php**. However, - if you explicitly include the ``Views`` directory in the call, e.g., - ``view('Example\Blog\Views\blog_view')``, the override path must also - include it: **app/Views/overrides/Example/Blog/Views/blog_view.php**. +.. note:: The override path must match exactly how you reference the view. If you load a view as + ``view('Example\Blog\blog_view')``, the override path is **app/Views/overrides/Example/Blog/blog_view.php**. + However, if you explicitly include the ``Views`` directory in the call, e.g., + ``view('Example\Blog\Views\blog_view')``, the override path must also include it: + **app/Views/overrides/Example/Blog/Views/blog_view.php**. .. _caching-views: Caching Views ============= -You can cache a view with the :php:func:`view()` function by passing a ``cache`` -option with the number of seconds to cache the view for, in the third parameter: +You can cache a view with the :php:func:`view()` function by passing a ``cache`` option with the number of seconds to +cache the view for, in the third parameter: .. literalinclude:: views/006.php :lines: 2- -By default, the view will be cached using the same name as the view file itself. You can customize this by passing -along ``cache_name`` and the cache ID you wish to use: +By default, the view will be cached using the same name as the view file itself. You can customize this by passing along +``cache_name`` and the cache ID you wish to use: .. literalinclude:: views/007.php :lines: 2- @@ -183,8 +183,8 @@ along ``cache_name`` and the cache ID you wish to use: Adding Dynamic Data to the View =============================== -Data is passed from the controller to the view by way of an array in the second -parameter of the :php:func:`view()` function. +Data is passed from the controller to the view by way of an array in the second parameter of the :php:func:`view()` +function. Here's an example: @@ -211,26 +211,24 @@ Then load the page at the URL you've been using and you should see the variables The saveData Option ------------------- -The data passed in is retained for subsequent calls to :php:func:`view()`. If you -call the function multiple times in a single request, you will not have to pass -the desired data to each ``view()``. +The data passed in is retained for subsequent calls to :php:func:`view()`. If you call the function multiple times in a +single request, you will not have to pass the desired data to each ``view()``. -However, this might allow data to "bleed" into -other views, potentially causing issues. If you would prefer to clean the data after one call, you can pass the ``saveData`` option -into the ``$options`` array in the third parameter. +However, this might allow data to "bleed" into other views, potentially causing issues. If you would prefer to clean the +data after one call, you can pass the ``saveData`` option into the ``$options`` array in the third parameter. .. literalinclude:: views/010.php :lines: 2- -Additionally, if you would like the ``view()`` function to clear the data by default -between calls, you can set ``$saveData`` to ``false`` in **app/Config/View.php**. +Additionally, if you would like the ``view()`` function to clear the data by default between calls, you can set +``$saveData`` to ``false`` in **app/Config/View.php**. Creating Loops ============== -The data array you pass to your view files is not limited to simple variables. You can pass multi-dimensional -arrays, which can be looped to generate multiple rows. For example, if you pull data from your database, it will -typically be in the form of a multi-dimensional array. +The data array you pass to your view files is not limited to simple variables. You can pass multi-dimensional arrays, +which can be looped to generate multiple rows. For example, if you pull data from your database, it will typically be in +the form of a multi-dimensional array. Here's a simple example. Add this to your controller: diff --git a/user_guide_src/source/testing/benchmark.rst b/user_guide_src/source/testing/benchmark.rst index 90f31463490c..3e7ed81d6791 100644 --- a/user_guide_src/source/testing/benchmark.rst +++ b/user_guide_src/source/testing/benchmark.rst @@ -2,13 +2,13 @@ Benchmarking ############ -CodeIgniter provides two separate tools to help you benchmark your code and test different options: -the **Timer** and the **Iterator**. The Timer allows you to easily calculate the time between two points in the -execution of your script. The Iterator allows you to set up several variations and run those tests, recording -performance and memory statistics to help you decide which version is the best. +CodeIgniter provides two separate tools to help you benchmark your code and test different options: the **Timer** and +the **Iterator**. The Timer allows you to easily calculate the time between two points in the execution of your script. +The Iterator allows you to set up several variations and run those tests, recording performance and memory statistics to +help you decide which version is the best. -The Timer class is always active, being started from the moment the framework is invoked until right before -sending the output to the user, enabling a very accurate timing of the entire system execution. +The Timer class is always active, being started from the moment the framework is invoked until right before sending the +output to the user, enabling a very accurate timing of the entire system execution. .. contents:: :local: @@ -18,15 +18,15 @@ sending the output to the user, enabling a very accurate timing of the entire sy Using the Timer *************** -With the Timer, you can measure the time between two moments in the execution of your application. This makes -it simple to measure the performance of different aspects of your application. All measurement is done using -the ``start()`` and ``stop()`` methods. +With the Timer, you can measure the time between two moments in the execution of your application. This makes it simple +to measure the performance of different aspects of your application. All measurement is done using the ``start()`` and +``stop()`` methods. Timer::start() ============== -The ``start()`` method takes a single parameter: the name of this timer. You can use any string as the name -of the timer. It is only used as a later reference, to know which measurement is which: +The ``start()`` method takes a single parameter: the name of this timer. You can use any string as the name of the +timer. It is only used as a later reference, to know which measurement is which: .. literalinclude:: benchmark/001.php @@ -42,8 +42,7 @@ The name is not case-sensitive, but otherwise must match the name you gave it wh timer() ======= -Alternatively, you can use the :doc:`global function ` ``timer()`` to start -and stop timers: +Alternatively, you can use the :doc:`global function ` ``timer()`` to start and stop timers: .. literalinclude:: benchmark/003.php @@ -54,8 +53,8 @@ Timer::record() .. versionadded:: 4.3.0 -Since v4.3.0, if you use very small code blocks to benchmark, you can also use the ``record()`` method. It accepts -a no-parameter callable and measures its execution time. The ``start()`` and ``stop()`` methods will be called +Since v4.3.0, if you use very small code blocks to benchmark, you can also use the ``record()`` method. It accepts a +no-parameter callable and measures its execution time. The ``start()`` and ``stop()`` methods will be called automatically around the function call. .. literalinclude:: benchmark/010.php @@ -71,14 +70,14 @@ The same functionality is also available when passing a callable to ``timer()`` Viewing Your Benchmark Points ============================= -When your application runs, all of the timers that you have set are collected by the Timer class. It does -not automatically display them, though. You can retrieve all of your timers by calling the ``getTimers()`` method. -This returns an array of benchmark information, including start, end, and duration: +When your application runs, all of the timers that you have set are collected by the Timer class. It does not +automatically display them, though. You can retrieve all of your timers by calling the ``getTimers()`` method. This +returns an array of benchmark information, including start, end, and duration: .. literalinclude:: benchmark/004.php -You can change the precision of the calculated duration by passing in the number of decimal places you want to be shown as -the only parameter. The default value is 4 digits after the decimal point: +You can change the precision of the calculated duration by passing in the number of decimal places you want to be shown +as the only parameter. The default value is 4 digits after the decimal point: .. literalinclude:: benchmark/005.php @@ -87,9 +86,9 @@ The timers are automatically displayed in the :doc:`Debug Toolbar getOutput()``, it returns the whole output string. -- If you specify ``0`` or a positive number, it returns the output array item. - Each item has the output of a ``CLI::fwrite()`` call. -- If you specify a negative number ``-n``, it returns the last ``n``-th item of - the output array. +- If you specify ``0`` or a positive number, it returns the output array item. Each item has the output of a + ``CLI::fwrite()`` call. +- If you specify a negative number ``-n``, it returns the last ``n``-th item of the output array. getOutputs(): array ^^^^^^^^^^^^^^^^^^^ @@ -89,8 +86,8 @@ An example demonstrating this inside one of your test cases: .. literalinclude:: overview/018.php -The ``StreamFilterTrait`` has a configurator that is called automatically. -See :ref:`Testing Traits `. +The ``StreamFilterTrait`` has a configurator that is called automatically. See +:ref:`Testing Traits `. If you override the ``setUp()`` or ``tearDown()`` methods in your test, then you must call the ``parent::setUp()`` and ``parent::tearDown()`` methods respectively to configure the ``StreamFilterTrait``. @@ -102,8 +99,8 @@ CITestStreamFilter **CITestStreamFilter** is for manual/single use. -If you need to capture streams in only one test, then instead of using the StreamFilterTrait trait, you can manually -add a filter to streams. +If you need to capture streams in only one test, then instead of using the StreamFilterTrait trait, you can manually add +a filter to streams. How to Use ^^^^^^^^^^ @@ -128,13 +125,11 @@ PhpStreamWrapper .. versionadded:: 4.3.0 -**PhpStreamWrapper** provides a way to write tests for methods that require user input, -such as ``CLI::prompt()``, ``CLI::wait()``, and ``CLI::input()``. +**PhpStreamWrapper** provides a way to write tests for methods that require user input, such as ``CLI::prompt()``, +``CLI::wait()``, and ``CLI::input()``. -.. note:: The PhpStreamWrapper is a stream wrapper class. - If you don't know PHP's stream wrapper, - see `The streamWrapper class `_ - in the PHP manual. +.. note:: The PhpStreamWrapper is a stream wrapper class. If you don't know PHP's stream wrapper, see + `The streamWrapper class `_ in the PHP manual. How to Use ^^^^^^^^^^ @@ -143,12 +138,11 @@ How to Use - ``PhpStreamWrapper::restore()`` Restore the php protocol wrapper back to the PHP built-in wrapper. - ``PhpStreamWrapper::setContent()`` Set the input data. -.. important:: The PhpStreamWrapper is intended only for testing ``php://stdin``. - But when you register it, it handles all the `php protocol `_ streams, - such as ``php://stdout``, ``php://stderr``, ``php://memory``. - So it is strongly recommended that ``PhpStreamWrapper`` be registered/unregistered - only when needed. Otherwise, it will interfere with other built-in php streams - while registered. +.. important:: The PhpStreamWrapper is intended only for testing ``php://stdin``. But when you register it, it handles + all the `php protocol `_ streams, such as ``php://stdout``, + ``php://stderr``, ``php://memory``. So it is strongly recommended that ``PhpStreamWrapper`` be + registered/unregistered only when needed. Otherwise, it will interfere with other built-in php streams while + registered. An example demonstrating this inside one of your test cases: diff --git a/user_guide_src/source/testing/controllers.rst b/user_guide_src/source/testing/controllers.rst index 8956fe0a9094..1422e506a5f2 100644 --- a/user_guide_src/source/testing/controllers.rst +++ b/user_guide_src/source/testing/controllers.rst @@ -4,8 +4,8 @@ Testing Controllers Testing your controllers is made convenient with a couple of new helper classes and traits. When testing controllers, you can execute the code within a controller, without first running through the entire application bootstrap process. -Often, using the :doc:`Feature Testing tools ` will be simpler, but this functionality is here in -case you need it. +Often, using the :doc:`Feature Testing tools ` will be simpler, but this functionality is here in case you need +it. .. note:: Because the entire framework has not been bootstrapped, there will be times when you cannot test a controller this way. @@ -23,8 +23,8 @@ To enable Controller Testing, you need to use the ``ControllerTestTrait`` trait Once the trait has been included, you can start setting up the environment, including the request and response classes, the request body, URI, and more. You specify the controller to use with the ``controller()`` method, passing in the -fully qualified class name of your controller. Finally, call the ``execute()`` method with the name of the method -to run as the parameter: +fully qualified class name of your controller. Finally, call the ``execute()`` method with the name of the method to run +as the parameter: .. literalinclude:: controllers/002.php @@ -34,8 +34,8 @@ Helper Methods controller($class) ------------------ -Specifies the class name of the controller to test. The first parameter must be a fully qualified class name -(i.e., include the namespace): +Specifies the class name of the controller to test. The first parameter must be a fully qualified class name (i.e., +include the namespace): .. literalinclude:: controllers/003.php @@ -48,8 +48,8 @@ Executes the specified method within the controller. The first parameter is the By specifying the second and subsequent parameters, you can pass them to the controller method. -This returns a new helper class that provides a number of routines for checking the response itself. See below -for details. +This returns a new helper class that provides a number of routines for checking the response itself. See below for +details. withConfig($config) ------------------- @@ -67,8 +67,8 @@ Allows you to provide an **IncomingRequest** instance tailored to your testing n .. literalinclude:: controllers/006.php -If you do not provide one, a new IncomingRequest instance with the default application values will be passed -into your controller. +If you do not provide one, a new IncomingRequest instance with the default application values will be passed into your +controller. withResponse($response) ----------------------- @@ -77,8 +77,8 @@ Allows you to provide a **Response** instance: .. literalinclude:: controllers/007.php -If you do not provide one, a new Response instance with the default application values will be passed -into your controller. +If you do not provide one, a new Response instance with the default application values will be passed into your +controller. withLogger($logger) ------------------- @@ -87,30 +87,29 @@ Allows you to provide a **Logger** instance: .. literalinclude:: controllers/008.php -If you do not provide one, a new Logger instance with the default configuration values will be passed -into your controller. +If you do not provide one, a new Logger instance with the default configuration values will be passed into your +controller. withUri(string $uri) -------------------- -Allows you to provide a new URI that simulates the URL the client was visiting when this controller was run. -This is helpful if you need to check URI segments within your controller. The only parameter is a string -representing a valid URI: +Allows you to provide a new URI that simulates the URL the client was visiting when this controller was run. This is +helpful if you need to check URI segments within your controller. The only parameter is a string representing a valid +URI: .. literalinclude:: controllers/009.php It is a good practice to always provide the URI during testing to avoid surprises. -.. note:: Since v4.4.0, this method creates a new Request instance with the URI, - because the Request instance should have the URI instance. Also, if the hostname - in the URI string is invalid with ``Config\App``, the valid hostname will be - set. +.. note:: Since v4.4.0, this method creates a new Request instance with the URI, because the Request instance should + have the URI instance. Also, if the hostname in the URI string is invalid with ``Config\App``, the valid hostname + will be set. withBody($body) --------------- -Allows you to provide a custom body for the request. This can be helpful when testing API controllers where -you need to set a JSON value as the body. The only parameter is a string that represents the body of the request: +Allows you to provide a custom body for the request. This can be helpful when testing API controllers where you need to +set a JSON value as the body. The only parameter is a string that represents the body of the request: .. literalinclude:: controllers/010.php @@ -123,45 +122,44 @@ how to use this class to perform additional assertions and verification in your Filter Testing ============== -Similar to Controller Testing, the framework provides tools to help with creating tests for -custom :doc:`Filters ` and your project's use of them in routing. +Similar to Controller Testing, the framework provides tools to help with creating tests for custom +:doc:`Filters ` and your project's use of them in routing. The Helper Trait ---------------- -Just like with the Controller Tester, you need to include the ``FilterTestTrait`` in your test -cases to enable these features: +Just like with the Controller Tester, you need to include the ``FilterTestTrait`` in your test cases to enable these +features: .. literalinclude:: controllers/011.php Configuration ------------- -Because of the logical overlap with Controller Testing, ``FilterTestTrait`` is designed to -work together with ``ControllerTestTrait`` should you need both on the same class. -Once the trait has been included, ``CIUnitTestCase`` will detect its ``setUp`` method and -prepare all the components needed for your tests. Should you need a special configuration, -you can alter any of the properties before calling the support methods: +Because of the logical overlap with Controller Testing, ``FilterTestTrait`` is designed to work together with +``ControllerTestTrait`` should you need both on the same class. Once the trait has been included, ``CIUnitTestCase`` +will detect its ``setUp`` method and prepare all the components needed for your tests. Should you need a special +configuration, you can alter any of the properties before calling the support methods: * ``$request`` A prepared version of the default ``IncomingRequest`` service * ``$response`` A prepared version of the default ``ResponseInterface`` service -* ``$filtersConfig`` The default ``Config\Filters`` configuration (note: discovery is handled by ``Filters`` so this will not include module aliases) +* ``$filtersConfig`` The default ``Config\Filters`` configuration (note: discovery is handled by ``Filters`` so this + will not include module aliases) * ``$filters`` An instance of ``CodeIgniter\Filters\Filters`` using the three components above * ``$collection`` A prepared version of ``RouteCollection`` which includes the discovery of ``Config\Routes`` -The default configuration will usually be best for your testing since it most closely emulates -a "live" project, but (for example) if you wanted to simulate a filter triggering accidentally -on an unfiltered route, you could add it to the Config: +The default configuration will usually be best for your testing since it most closely emulates a "live" project, but +(for example) if you wanted to simulate a filter triggering accidentally on an unfiltered route, you could add it to the +Config: .. literalinclude:: controllers/012.php Checking Routes --------------- -The first helper method is ``getFiltersForRoute()``, which will simulate the provided route -and return a list of all Filters (by their alias) that would have run for the given position -("before" or "after"), without actually executing any controller or routing code. This has -a large performance advantage over Controller and HTTP Testing. +The first helper method is ``getFiltersForRoute()``, which will simulate the provided route and return a list of all +Filters (by their alias) that would have run for the given position ("before" or "after"), without actually executing +any controller or routing code. This has a large performance advantage over Controller and HTTP Testing. .. php:function:: getFiltersForRoute($route, $position) @@ -177,9 +175,9 @@ a large performance advantage over Controller and HTTP Testing. Calling Filter Methods ---------------------- -The properties described in Configuration are all set up to ensure maximum performance without -interference from other tests. The next helper method will return a callable -method using these properties to test your Filter code safely and check the results. +The properties described in Configuration are all set up to ensure maximum performance without interference from other +tests. The next helper method will return a callable method using these properties to test your Filter code safely and +check the results. .. php:function:: getFilterCaller($filter, $position) @@ -197,8 +195,8 @@ method using these properties to test your Filter code safely and check the resu Assertions ---------- -In addition to the helper methods above, ``FilterTestTrait`` also comes with some assertions -to streamline your test methods. +In addition to the helper methods above, ``FilterTestTrait`` also comes with some assertions to streamline your test +methods. assertFilter() ^^^^^^^^^^^^^^ @@ -210,7 +208,8 @@ The ``assertFilter()`` method checks that the given route at the given position assertNotFilter() ^^^^^^^^^^^^^^^^^ -The ``assertNotFilter()`` method checks that the given route at the given position does not use the filter (by its alias): +The ``assertNotFilter()`` method checks that the given route at the given position does not use the filter (by its +alias): .. literalinclude:: controllers/016.php diff --git a/user_guide_src/source/testing/database.rst b/user_guide_src/source/testing/database.rst index 35d0ab23b634..a451f77c8735 100644 --- a/user_guide_src/source/testing/database.rst +++ b/user_guide_src/source/testing/database.rst @@ -9,28 +9,27 @@ Testing Your Database The Test Class ************** -In order to take advantage of the built-in database tools that CodeIgniter provides for testing, your -tests must extend ``CIUnitTestCase`` and use the ``DatabaseTestTrait``: +In order to take advantage of the built-in database tools that CodeIgniter provides for testing, your tests must extend +``CIUnitTestCase`` and use the ``DatabaseTestTrait``: .. literalinclude:: database/001.php -Because special functionality is executed during the ``setUp()`` and ``tearDown()`` phases, you must ensure -that you call the parent's methods if you need to use those methods. Otherwise, you will lose much -of the functionality described here: +Because special functionality is executed during the ``setUp()`` and ``tearDown()`` phases, you must ensure that you +call the parent's methods if you need to use those methods. Otherwise, you will lose much of the functionality described +here: .. literalinclude:: database/002.php Setting Up a Test Database ************************** -When running database tests, you need to provide a database that can be used during testing. Instead of -using the PHPUnit built-in database features, the framework provides tools specific to CodeIgniter. The first -step is to ensure that you have set up a ``tests`` database group in **app/Config/Database.php**. -This specifies a database connection that is only used while running tests, to keep your other data safe. +When running database tests, you need to provide a database that can be used during testing. Instead of using the +PHPUnit built-in database features, the framework provides tools specific to CodeIgniter. The first step is to ensure +that you have set up a ``tests`` database group in **app/Config/Database.php**. This specifies a database connection +that is only used while running tests, to keep your other data safe. -If you have multiple developers on your team, you will likely want to keep your credentials stored in -the **.env** file. To do so, edit the file to ensure the following lines are present and have the -correct information:: +If you have multiple developers on your team, you will likely want to keep your credentials stored in the **.env** file. +To do so, edit the file to ensure the following lines are present and have the correct information:: database.tests.hostname = localhost database.tests.database = ci4_test @@ -43,9 +42,9 @@ correct information:: Migrations and Seeds ==================== -When running tests, you need to ensure that your database has the correct schema set up and that -it is in a known state for every test. You can use migrations and seeds to set up your database, -by adding a couple of class properties to your test. +When running tests, you need to ensure that your database has the correct schema set up and that it is in a known state +for every test. You can use migrations and seeds to set up your database, by adding a couple of class properties to your +test. .. literalinclude:: database/003.php @@ -55,31 +54,31 @@ Migrations $migrate ^^^^^^^^ -This boolean value determines whether the database migration runs before a test. -By default, the database is always migrated to the latest available state as defined by ``$namespace``. -If ``false``, migration never runs. If you want to disable migration, set it to ``false``. +This boolean value determines whether the database migration runs before a test. By default, the database is always +migrated to the latest available state as defined by ``$namespace``. If ``false``, migration never runs. If you want to +disable migration, set it to ``false``. $migrateOnce ^^^^^^^^^^^^ -This boolean value determines whether the database migration runs only once. If you want -to run migration once before the first test, set it to ``true``. If not present or ``false``, migration -runs before each test. +This boolean value determines whether the database migration runs only once. If you want to run migration once before +the first test, set it to ``true``. If not present or ``false``, migration runs before each test. $refresh ^^^^^^^^ -This boolean value determines whether the database is completely refreshed before a test. If ``true``, -all migrations are rolled back to version 0. +This boolean value determines whether the database is completely refreshed before a test. If ``true``, all migrations +are rolled back to version 0. $namespace ^^^^^^^^^^ -By default, CodeIgniter will look in **tests/_support/Database/Migrations** to locate the migrations -that it should run during testing. You can change this location by specifying a new namespace in the ``$namespace`` property. -This should not include the **Database\\Migrations** sub-namespace but just the base namespace. +By default, CodeIgniter will look in **tests/_support/Database/Migrations** to locate the migrations that it should run +during testing. You can change this location by specifying a new namespace in the ``$namespace`` property. This should +not include the **Database\\Migrations** sub-namespace but just the base namespace. -.. important:: If you set this property to ``null``, it runs migrations from all available namespaces like ``php spark migrate --all``. +.. important:: If you set this property to ``null``, it runs migrations from all available namespaces like + ``php spark migrate --all``. Seeds ----- @@ -87,22 +86,21 @@ Seeds $seed ^^^^^ -If present and not empty, this specifies the name of a Seed file that is used to populate the database with -test data before the test runs. +If present and not empty, this specifies the name of a Seed file that is used to populate the database with test data +before the test runs. $seedOnce ^^^^^^^^^ -This boolean value determines whether the database seeding runs only once. If you want -to run database seeding once before the first test, set it to ``true``. If not present or ``false``, database seeding -runs before each test. +This boolean value determines whether the database seeding runs only once. If you want to run database seeding once +before the first test, set it to ``true``. If not present or ``false``, database seeding runs before each test. $basePath ^^^^^^^^^ -By default, CodeIgniter will look in **tests/_support/Database/Seeds** to locate the seeds that it should run during testing. -You can change this directory by specifying the ``$basePath`` property. This should not include the **Seeds** directory, -but the path to the single directory that holds the sub-directory. +By default, CodeIgniter will look in **tests/_support/Database/Seeds** to locate the seeds that it should run during +testing. You can change this directory by specifying the ``$basePath`` property. This should not include the **Seeds** +directory, but the path to the single directory that holds the sub-directory. Helper Methods ************** @@ -125,14 +123,14 @@ Called during ``setUp()``, this method is available if you need to run migration seed($name) ----------- -Allows you to manually load a Seed into the database. The only parameter is the name of the seed to run. The seed -must be present within the path specified in ``$basePath``. +Allows you to manually load a Seed into the database. The only parameter is the name of the seed to run. The seed must +be present within the path specified in ``$basePath``. hasInDatabase($table, $data) ---------------------------- -Inserts a new row into the database. This row is removed after the current test runs. ``$data`` is an associative -array with the data to insert into the table. +Inserts a new row into the database. This row is removed after the current test runs. ``$data`` is an associative array +with the data to insert into the table. .. literalinclude:: database/007.php @@ -142,8 +140,8 @@ Getting Data from Database grabFromDatabase($table, $column, $criteria) -------------------------------------------- -Returns the value of ``$column`` from the specified table where the row matches ``$criteria``. If more than one -row is found, it will only return the first one. +Returns the value of ``$column`` from the specified table where the row matches ``$criteria``. If more than one row is +found, it will only return the first one. .. literalinclude:: database/006.php diff --git a/user_guide_src/source/testing/debugging.rst b/user_guide_src/source/testing/debugging.rst index 5ee0b2342876..a269f40da153 100644 --- a/user_guide_src/source/testing/debugging.rst +++ b/user_guide_src/source/testing/debugging.rst @@ -17,37 +17,35 @@ CodeIgniter Error Logs CodeIgniter logs error messages, according to the settings in **app/Config/Logger.php**. -The default configuration has daily log files stored in **writable/logs**. -It would be a good idea to check them if things aren't working the way you expect! +The default configuration has daily log files stored in **writable/logs**. It would be a good idea to check them if +things aren't working the way you expect! -You can adjust the error threshold to see more or fewer messages. See -:ref:`Logging ` for details. +You can adjust the error threshold to see more or fewer messages. See :ref:`Logging ` for +details. Logging All SQL Queries ======================= -All SQL queries issued by CodeIgniter can be logged. -See :ref:`Database Events ` for details. +All SQL queries issued by CodeIgniter can be logged. See :ref:`Database Events ` for details. ******************** Replacing var_dump() ******************** -While using Xdebug and a good IDE can be indispensable to debug your application, -sometimes a quick ``var_dump()`` is all you need. CodeIgniter makes that even -better by bundling in the excellent `Kint `_ +While using Xdebug and a good IDE can be indispensable to debug your application, sometimes a quick ``var_dump()`` is +all you need. CodeIgniter makes that even better by bundling in the excellent `Kint `_ debugging tool for PHP. -This goes way beyond your usual tool, providing many alternate pieces of data, -like formatting timestamps into recognizable dates, showing you hexcodes as colors, -displaying array data as a table for easy reading, and much, much more. +This goes way beyond your usual tool, providing many alternate pieces of data, like formatting timestamps into +recognizable dates, showing you hexcodes as colors, displaying array data as a table for easy reading, and much, much +more. Enabling Kint ============= -By default, Kint is enabled in **development** and **testing** :doc:`environments ` only. -It will be enabled whenever the constant ``CI_DEBUG`` is defined and its value is truthy. -This is defined in the boot files (e.g. **app/Config/Boot/development.php**). +By default, Kint is enabled in **development** and **testing** :doc:`environments ` only. It will +be enabled whenever the constant ``CI_DEBUG`` is defined and its value is truthy. This is defined in the boot files +(e.g. **app/Config/Boot/development.php**). Using Kint ========== @@ -64,7 +62,8 @@ allows the script to continue executing: dd() ---- -This method is identical to ``d()``, except that it also calls ``die()``, so no further code is executed during this request. +This method is identical to ``d()``, except that it also calls ``die()``, so no further code is executed during this +request. trace() ------- @@ -82,47 +81,49 @@ For more information, see `Kint's page `_. The Debug Toolbar ***************** -The Debug Toolbar provides at-a-glance information about the current page request, including benchmark results, -queries you have run, request and response data, and more. This can all prove very useful during development -to help you debug and optimize. +The Debug Toolbar provides at-a-glance information about the current page request, including benchmark results, queries +you have run, request and response data, and more. This can all prove very useful during development to help you debug +and optimize. .. note:: The Debug Toolbar is still under construction with several planned features not yet implemented. Enabling the Toolbar ==================== -The toolbar is enabled by default in any :doc:`environment ` *except* **production**. It will be shown whenever the -constant ``CI_DEBUG`` is defined and its value is truthy. This is defined in the boot files (e.g. +The toolbar is enabled by default in any :doc:`environment ` *except* **production**. It will be +shown whenever the constant ``CI_DEBUG`` is defined and its value is truthy. This is defined in the boot files (e.g. **app/Config/Boot/development.php**) and can be modified there to determine the environments in which it is shown. -.. note:: The Debug Toolbar is not displayed when your ``baseURL`` setting (in **app/Config/App.php** or ``app.baseURL`` in **.env**) does not match your actual URL. +.. note:: The Debug Toolbar is not displayed when your ``baseURL`` setting (in **app/Config/App.php** or ``app.baseURL`` + in **.env**) does not match your actual URL. -The toolbar itself is displayed as an :doc:`After Filter `. You can stop it from ever -running by removing ``'toolbar'`` from the ``$required`` (or ``$globals``) property of **app/Config/Filters.php**. +The toolbar itself is displayed as an :doc:`After Filter `. You can stop it from ever running by +removing ``'toolbar'`` from the ``$required`` (or ``$globals``) property of **app/Config/Filters.php**. .. note:: Prior to v4.5.0, the toolbar was set to ``$globals`` by default. Choosing What to Show --------------------- -CodeIgniter ships with several Collectors that, as the name implies, collect data to display on the toolbar. You -can easily make your own to customize the toolbar. To determine which collectors are shown, again head over to -the **app/Config/Toolbar.php** configuration file: +CodeIgniter ships with several Collectors that, as the name implies, collect data to display on the toolbar. You can +easily make your own to customize the toolbar. To determine which collectors are shown, again head over to the +**app/Config/Toolbar.php** configuration file: .. literalinclude:: debugging/003.php Comment out any collectors that you do not want to show. Add custom Collectors here by providing the fully qualified -class name. The exact collectors that appear here will affect which tabs are shown, as well as what information is -shown on the Timeline. +class name. The exact collectors that appear here will affect which tabs are shown, as well as what information is shown +on the Timeline. -.. note:: Some tabs, like Database and Logs, will only display when they have content to show. Otherwise, they - are removed to help out on smaller displays. +.. note:: Some tabs, like Database and Logs, will only display when they have content to show. Otherwise, they are + removed to help out on smaller displays. The Collectors that ship with CodeIgniter are: * **Timers** collects all of the benchmark data, both from the system and from your application. * **Database** displays a list of queries that all database connections have performed, and their execution time. -* **Logs** displays any information that was logged. In long-running systems, or systems with many items being logged, this can cause memory issues and should be disabled. +* **Logs** displays any information that was logged. In long-running systems, or systems with many items being logged, + this can cause memory issues and should be disabled. * **Views** displays render time for views on the timeline, and shows any data passed to the views on a separate tab. * **Cache** displays information about cache hits and misses, and execution times. * **Files** displays a list of all files that have been loaded during this request. @@ -139,24 +140,24 @@ Please read the information on setting Benchmark points in the :doc:`Benchmark L Creating Custom Collectors ========================== -Creating custom collectors is a straightforward task. You create a new class that extends ``CodeIgniter\Debug\Toolbar\Collectors\BaseCollector``, -fully namespaced so that the autoloader can locate it. This provides a number of methods -that you can override, and has four required class properties that you must correctly set depending on how you want -the Collector to work: +Creating custom collectors is a straightforward task. You create a new class that extends +``CodeIgniter\Debug\Toolbar\Collectors\BaseCollector``, fully namespaced so that the autoloader can locate it. This +provides a number of methods that you can override, and has four required class properties that you must correctly set +depending on how you want the Collector to work: .. literalinclude:: debugging/004.php **$hasTimeline** should be set to ``true`` for any Collector that wants to display information in the toolbar's -timeline. If this is true, you will need to implement the ``formatTimelineData()`` method to format and return the -data for display. +timeline. If this is true, you will need to implement the ``formatTimelineData()`` method to format and return the data +for display. -**$hasTabContent** should be ``true`` if the Collector wants to display its own tab with custom content. If this -is true, you will need to provide a ``$title``, implement the ``display()`` method to render the tab's contents, -and might need to implement the ``getTitleDetails()`` method if you want to display additional information just -to the right of the tab content's title. +**$hasTabContent** should be ``true`` if the Collector wants to display its own tab with custom content. If this is +true, you will need to provide a ``$title``, implement the ``display()`` method to render the tab's contents, and might +need to implement the ``getTitleDetails()`` method if you want to display additional information just to the right of +the tab content's title. -**$hasVarData** should be ``true`` if this Collector wants to add additional data to the ``Vars`` tab. If this -is true, you will need to implement the ``getVarData()`` method. +**$hasVarData** should be ``true`` if this Collector wants to add additional data to the ``Vars`` tab. If this is true, +you will need to implement the ``getVarData()`` method. **$title** is displayed on open tabs. @@ -170,12 +171,12 @@ To display a toolbar tab, you must: 3. Implement the ``display()`` method. 4. Optionally, implement the ``getTitleDetails()`` method. -The ``display()`` method creates the HTML that is displayed within the tab itself. It does not need to worry about -the title of the tab, as that is automatically handled by the toolbar. It should return a string of HTML. +The ``display()`` method creates the HTML that is displayed within the tab itself. It does not need to worry about the +title of the tab, as that is automatically handled by the toolbar. It should return a string of HTML. -The ``getTitleDetails()`` method should return a string that is displayed just to the right of the tab's title. -It can be used to provide additional overview information. For example, the Database tab displays the total -number of queries across all connections, while the Files tab displays the total number of files. +The ``getTitleDetails()`` method should return a string that is displayed just to the right of the tab's title. It can +be used to provide additional overview information. For example, the Database tab displays the total number of queries +across all connections, while the Files tab displays the total number of files. Providing Timeline Data ----------------------- @@ -185,8 +186,8 @@ To provide information to be displayed in the Timeline, you must: 1. Set ``$hasTimeline`` to ``true``. 2. Implement the ``formatTimelineData()`` method. -The ``formatTimelineData()`` method must return an array of arrays formatted in a way that the timeline can use -to sort it correctly and display the correct information. The inner arrays must include the following information: +The ``formatTimelineData()`` method must return an array of arrays formatted in a way that the timeline can use to sort +it correctly and display the correct information. The inner arrays must include the following information: .. literalinclude:: debugging/005.php @@ -210,10 +211,17 @@ Hot Reloading .. versionadded:: 4.4.0 -The Debug Toolbar includes a feature called Hot Reloading that allows you to make changes to your application's code and have them automatically reloaded in the browser without having to refresh the page. This is a great time-saver during development. +The Debug Toolbar includes a feature called Hot Reloading that allows you to make changes to your application's code and +have them automatically reloaded in the browser without having to refresh the page. This is a great time-saver during +development. -To enable Hot Reloading while you are developing, you can click the button on the left side of the toolbar that looks like a refresh icon. This will enable Hot Reloading for all pages until you disable it. +To enable Hot Reloading while you are developing, you can click the button on the left side of the toolbar that looks +like a refresh icon. This will enable Hot Reloading for all pages until you disable it. -Hot Reloading works by scanning the files within the **app** directory every second and looking for changes. If it finds any, it will send a message to the browser to reload the page. It does not scan any other directories, so if you are making changes to files outside of the **app** directory, you will need to manually refresh the page. +Hot Reloading works by scanning the files within the **app** directory every second and looking for changes. If it finds +any, it will send a message to the browser to reload the page. It does not scan any other directories, so if you are +making changes to files outside of the **app** directory, you will need to manually refresh the page. -If you need to watch files outside of the **app** directory, or are finding it slow due to the size of your project, you can specify the directories to scan and the file extensions to scan for in the ``$watchedDirectories`` and ``$watchedExtensions`` properties of the **app/Config/Toolbar.php** configuration file. +If you need to watch files outside of the **app** directory, or are finding it slow due to the size of your project, you +can specify the directories to scan and the file extensions to scan for in the ``$watchedDirectories`` and +``$watchedExtensions`` properties of the **app/Config/Toolbar.php** configuration file. diff --git a/user_guide_src/source/testing/fabricator.rst b/user_guide_src/source/testing/fabricator.rst index c496838bef1e..2b8bac4ba75b 100644 --- a/user_guide_src/source/testing/fabricator.rst +++ b/user_guide_src/source/testing/fabricator.rst @@ -2,9 +2,9 @@ Generating Test Data #################### -Often you will need sample data for your application to run its tests. The ``Fabricator`` class -uses `Faker `_ to turn models into generators -of random data. Use fabricators in your seeds or test cases to stage fake data for your unit tests. +Often you will need sample data for your application to run its tests. The ``Fabricator`` class uses +`Faker `_ to turn models into generators of random data. Use fabricators in your +seeds or test cases to stage fake data for your unit tests. .. contents:: :local: @@ -13,12 +13,13 @@ of random data. Use fabricators in your seeds or test cases to stage fake data f Supported Models ================ -``Fabricator`` supports any model that extends the framework's core model, ``CodeIgniter\Model``. -You may use your own custom models by ensuring they implement ``CodeIgniter\Test\Interfaces\FabricatorModel``: +``Fabricator`` supports any model that extends the framework's core model, ``CodeIgniter\Model``. You may use your own +custom models by ensuring they implement ``CodeIgniter\Test\Interfaces\FabricatorModel``: .. literalinclude:: fabricator/001.php -.. note:: In addition to methods, the interface outlines some necessary properties for the target model. Please see the interface code for details. +.. note:: In addition to methods, the interface outlines some necessary properties for the target model. Please see the + interface code for details. Loading Fabricators =================== @@ -34,11 +35,11 @@ The parameter can be a string specifying the name of the model, or an instance o Defining Formatters =================== -Faker generates data by requesting it from a formatter. With no formatters defined, ``Fabricator`` will -attempt to guess at the most appropriate fit based on the field name and properties of the model it -represents, falling back on ``$fabricator->defaultFormatter``. This may be fine if your field names -correspond with common formatters, or if you don't care much about the content of the fields, but most -of the time you will want to specify the formatters to use as the second parameter to the constructor: +Faker generates data by requesting it from a formatter. With no formatters defined, ``Fabricator`` will attempt to guess +at the most appropriate fit based on the field name and properties of the model it represents, falling back on +``$fabricator->defaultFormatter``. This may be fine if your field names correspond with common formatters, or if you +don't care much about the content of the fields, but most of the time you will want to specify the formatters to use as +the second parameter to the constructor: .. literalinclude:: fabricator/004.php @@ -47,9 +48,9 @@ You can also change the formatters after a fabricator is initialized by using th Advanced Formatting ------------------- -Sometimes the default return of a formatter is not enough. Faker providers allow parameters to most formatters -to further limit the scope of random data. A fabricator will check its representative model for the ``fake()`` -method where you can define exactly what the faked data should look like: +Sometimes the default return of a formatter is not enough. Faker providers allow parameters to most formatters to +further limit the scope of random data. A fabricator will check its representative model for the ``fake()`` method where +you can define exactly what the faked data should look like: .. literalinclude:: fabricator/005.php @@ -57,8 +58,8 @@ Notice in this example how the first three values are equivalent to the formatte we have requested an image size other than the default and ``login`` uses a conditional based on app configuration, neither of which is possible using the ``$formatters`` parameter. -You may want to keep your test data separate from your production models, so it is a good practice to define -a child class in your test support folder: +You may want to keep your test data separate from your production models, so it is a good practice to define a child +class in your test support folder: .. literalinclude:: fabricator/006.php @@ -67,32 +68,31 @@ Setting Modifiers .. versionadded:: 4.5.0 -Faker provides three special providers, ``unique()``, ``optional()``, and ``valid()``, -to be called before any provider. Fabricator fully supports these modifiers by providing -dedicated methods. +Faker provides three special providers, ``unique()``, ``optional()``, and ``valid()``, to be called before any provider. +Fabricator fully supports these modifiers by providing dedicated methods. .. literalinclude:: fabricator/022.php -The arguments passed after the field name are passed directly to the modifiers as-is. You can refer -to `Faker's documentation on modifiers`_ for details. +The arguments passed after the field name are passed directly to the modifiers as-is. You can refer to +`Faker's documentation on modifiers`_ for details. .. _Faker's documentation on modifiers: https://fakerphp.github.io/#modifiers -Instead of calling each method on Fabricator, you may use Faker's modifiers directly if you are using -the ``fake()`` method on your models. +Instead of calling each method on Fabricator, you may use Faker's modifiers directly if you are using the ``fake()`` +method on your models. .. literalinclude:: fabricator/023.php Localization ============ -Faker supports a lot of different locales. Check their documentation to determine which providers -support your locale. Specify a locale in the third parameter while initiating a fabricator: +Faker supports a lot of different locales. Check their documentation to determine which providers support your locale. +Specify a locale in the third parameter while initiating a fabricator: .. literalinclude:: fabricator/007.php -If no locale is specified, it will use the one defined in **app/Config/App.php** as ``defaultLocale``. -You can check the locale of an existing fabricator using its ``getLocale()`` method. +If no locale is specified, it will use the one defined in **app/Config/App.php** as ``defaultLocale``. You can check the +locale of an existing fabricator using its ``getLocale()`` method. Faking the Data =============== @@ -109,15 +109,15 @@ You can also get a lot of them back by supplying a count: .. literalinclude:: fabricator/010.php -The return type of ``make()`` mimics what is defined in the representative model, but you can -force a type using the methods directly: +The return type of ``make()`` mimics what is defined in the representative model, but you can force a type using the +methods directly: .. literalinclude:: fabricator/011.php -The return from ``make()`` is ready to be used in tests or inserted into the database. Alternatively, -``Fabricator`` includes the ``create()`` command to insert it for you and return the result. Due -to model callbacks, database formatting, and special keys like primary and timestamps, the return -from ``create()`` can differ from ``make()``. You might get back something like this: +The return from ``make()`` is ready to be used in tests or inserted into the database. Alternatively, ``Fabricator`` +includes the ``create()`` command to insert it for you and return the result. Due to model callbacks, database +formatting, and special keys like primary and timestamps, the return from ``create()`` can differ from ``make()``. You +might get back something like this: .. literalinclude:: fabricator/012.php @@ -125,18 +125,18 @@ Similar to ``make()``, you can supply a count to insert and return an array of o .. literalinclude:: fabricator/013.php -Finally, there may be times you want to test with the full database object but you are not actually -using a database. ``create()`` takes a second parameter to allow mocking the object, returning -the object with extra database fields above without actually touching the database: +Finally, there may be times you want to test with the full database object but you are not actually using a database. +``create()`` takes a second parameter to allow mocking the object, returning the object with extra database fields above +without actually touching the database: .. literalinclude:: fabricator/014.php Specifying Test Data ==================== -Generated data is great, but sometimes you may want to supply a specific field for a test without -compromising your formatters configuration. Rather than creating a new fabricator for each variant, -you can use ``setOverrides()`` to specify the value for any fields: +Generated data is great, but sometimes you may want to supply a specific field for a test without compromising your +formatters configuration. Rather than creating a new fabricator for each variant, you can use ``setOverrides()`` to +specify the value for any fields: .. literalinclude:: fabricator/015.php @@ -144,8 +144,8 @@ Now any data generated with ``make()`` or ``create()`` will always use "Bobby" f .. literalinclude:: fabricator/016.php -``setOverrides()`` can take a second parameter to indicate whether this should be a persistent -override or only for a single action: +``setOverrides()`` can take a second parameter to indicate whether this should be a persistent override or only for a +single action: .. literalinclude:: fabricator/017.php @@ -158,8 +158,8 @@ If no second parameter is supplied then passed values will persist by default. Test Helper =========== -Often all you will need is a one-and-done fake object for testing. The Test Helper provides -the ``fake($model, $overrides, $persist = true)`` function to do just this: +Often all you will need is a one-and-done fake object for testing. The Test Helper provides the +``fake($model, $overrides, $persist = true)`` function to do just this: .. literalinclude:: fabricator/019.php @@ -172,14 +172,12 @@ If you just need a fake object without saving it to the database, you can pass f Table Counts ============ -Frequently your faked data will depend on other faked data. ``Fabricator`` provides a static -count of the number of faked items you have created for each table. Consider the following -example: +Frequently your faked data will depend on other faked data. ``Fabricator`` provides a static count of the number of +faked items you have created for each table. Consider the following example: -Your project has users and groups. In your test case you want to create various scenarios -with groups of different sizes, so you use ``Fabricator`` to create a bunch of groups. -Now you want to create fake users but don't want to assign them to a non-existent group ID. -Your model's fake method could look like this: +Your project has users and groups. In your test case you want to create various scenarios with groups of different +sizes, so you use ``Fabricator`` to create a bunch of groups. Now you want to create fake users but don't want to assign +them to a non-existent group ID. Your model's fake method could look like this: .. literalinclude:: fabricator/021.php @@ -188,8 +186,7 @@ Now creating a new user will ensure it is a part of a valid group: ``$user = fak Methods ------- -``Fabricator`` handles the counts internally, but you can also access these static methods -to assist with using them: +``Fabricator`` handles the counts internally, but you can also access these static methods to assist with using them: getCount(string $table): int ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -199,23 +196,23 @@ Return the current value for a specific table (default: 0). setCount(string $table, int $count): int ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Set the value for a specific table manually, for example if you create some test items -without using a fabricator that you still wanted factored into the final counts. +Set the value for a specific table manually, for example if you create some test items without using a fabricator that +you still wanted factored into the final counts. upCount(string $table): int ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Increment the value for a specific table by one and return the new value. (This is what is -used internally with ``Fabricator::create()``.) +Increment the value for a specific table by one and return the new value. (This is what is used internally with +``Fabricator::create()``.) downCount(string $table): int ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Decrement the value for a specific table by one and return the new value, for example if -you deleted a fake item but wanted to track the change. +Decrement the value for a specific table by one and return the new value, for example if you deleted a fake item but +wanted to track the change. resetCounts() ^^^^^^^^^^^^^ -Resets all counts. It is a good idea to call this between test cases (though using -``CIUnitTestCase::$refresh = true`` does it automatically). +Resets all counts. It is a good idea to call this between test cases (though using ``CIUnitTestCase::$refresh = true`` +does it automatically). diff --git a/user_guide_src/source/testing/feature.rst b/user_guide_src/source/testing/feature.rst index f73277ffb42f..8d0a4f4d0c8d 100644 --- a/user_guide_src/source/testing/feature.rst +++ b/user_guide_src/source/testing/feature.rst @@ -2,10 +2,10 @@ HTTP Feature Testing #################### -Feature testing allows you to view the results of a single call to your application. This might be returning the -results of a single web form, hitting an API endpoint, and more. This is handy because it allows you to test the entire -life-cycle of a single request, ensuring that the routing works and the response is in the correct format, analyzing the results, -and more. +Feature testing allows you to view the results of a single call to your application. This might be returning the results +of a single web form, hitting an API endpoint, and more. This is handy because it allows you to test the entire +life-cycle of a single request, ensuring that the routing works and the response is in the correct format, analyzing the +results, and more. .. contents:: :local: @@ -14,9 +14,8 @@ and more. The Test Class ============== -Feature testing requires the ``CodeIgniter\Test\FeatureTestTrait`` trait. Add -``CodeIgniter\Test\DatabaseTestTrait`` when your tests also need database staging. -Ensure that ``parent::setUp()`` and ``parent::tearDown()`` are called if you +Feature testing requires the ``CodeIgniter\Test\FeatureTestTrait`` trait. Add ``CodeIgniter\Test\DatabaseTestTrait`` +when your tests also need database staging. Ensure that ``parent::setUp()`` and ``parent::tearDown()`` are called if you implement your own methods. .. literalinclude:: feature/001.php @@ -26,19 +25,16 @@ implement your own methods. Requesting a Page ================= -Essentially, feature tests simply allow you to call an endpoint on your application and get the results back. -To do this, you use the ``call()`` method. +Essentially, feature tests simply allow you to call an endpoint on your application and get the results back. To do +this, you use the ``call()`` method. 1. The first parameter is the HTTP method to use (most frequently either ``GET`` or ``POST``). 2. The second parameter is the URI path on your site to test. -3. The third parameter ``$params`` accepts an array that is used to populate the - superglobal variables for the HTTP verb you are using. So, a method of **GET** - would have the ``$_GET`` variable populated, while a **POST** request would - have the ``$_POST`` array populated. The ``$params`` is also used in - :ref:`feature-formatting-the-request`. +3. The third parameter ``$params`` accepts an array that is used to populate the superglobal variables for the HTTP verb + you are using. So, a method of **GET** would have the ``$_GET`` variable populated, while a **POST** request would + have the ``$_POST`` array populated. The ``$params`` is also used in :ref:`feature-formatting-the-request`. - .. note:: The ``$params`` array does not make sense for every HTTP verb, but is - included for consistency. + .. note:: The ``$params`` array does not make sense for every HTTP verb, but is included for consistency. .. literalinclude:: feature/002.php :lines: 2- @@ -60,16 +56,16 @@ override any existing routes in the system: .. literalinclude:: feature/004.php :lines: 2- -Each of the "routes" is a 3-element array containing the HTTP verb (or "add" for all), -the URI to match, and the routing destination. +Each of the "routes" is a 3-element array containing the HTTP verb (or "add" for all), the URI to match, and the routing +destination. .. _feature-setting-session-values: Setting Session Values ---------------------- -You can set custom session values to use during a single test with the ``withSession()`` method. This takes an array -of key/value pairs that should exist within the ``$_SESSION`` variable when this request is made, or ``null`` to indicate +You can set custom session values to use during a single test with the ``withSession()`` method. This takes an array of +key/value pairs that should exist within the ``$_SESSION`` variable when this request is made, or ``null`` to indicate that the current values of ``$_SESSION`` should be used. This is handy for testing authentication and more. .. literalinclude:: feature/005.php @@ -78,8 +74,8 @@ that the current values of ``$_SESSION`` should be used. This is handy for testi Setting Headers --------------- -You can set header values with the ``withHeaders()`` method. This takes an array of key/value pairs that would be -passed as a header into the call: +You can set header values with the ``withHeaders()`` method. This takes an array of key/value pairs that would be passed +as a header into the call: .. literalinclude:: feature/006.php :lines: 2- @@ -87,8 +83,8 @@ passed as a header into the call: Bypassing Events ---------------- -Events are handy to use in your application, but can be problematic during testing, especially events that are used -to send out emails. You can tell the system to skip any event handling with the ``skipEvents()`` method: +Events are handy to use in your application, but can be problematic during testing, especially events that are used to +send out emails. You can tell the system to skip any event handling with the ``skipEvents()`` method: .. literalinclude:: feature/007.php :lines: 2- @@ -99,11 +95,11 @@ Formatting the Request ---------------------- You can set the format of your request's body using the ``withBodyFormat()`` method. Currently, this supports either -``json`` or ``xml``. -This is useful when testing JSON or XML APIs so that you can set the request in the form that the controller will expect. +``json`` or ``xml``. This is useful when testing JSON or XML APIs so that you can set the request in the form that the +controller will expect. -This will take the parameters passed into ``call()``, ``post()``, ``get()``... and assign them to the -body of the request in the given format. +This will take the parameters passed into ``call()``, ``post()``, ``get()``... and assign them to the body of the +request in the given format. This will also set the ``Content-Type`` header for your request accordingly. @@ -115,14 +111,14 @@ This will also set the ``Content-Type`` header for your request accordingly. Setting the Body ---------------- -You can set the body of your request with the ``withBody()`` method. This allows you to format the body however you want. -It is recommended that you use this if you have more complicated XML to test. +You can set the body of your request with the ``withBody()`` method. This allows you to format the body however you +want. It is recommended that you use this if you have more complicated XML to test. -This will not set -the ``Content-Type`` header for you. If you need that, you can set it with the ``withHeaders()`` method. +This will not set the ``Content-Type`` header for you. If you need that, you can set it with the ``withHeaders()`` +method. Checking the Response ===================== -``FeatureTestTrait::call()`` returns an instance of a ``TestResponse``. See :doc:`Testing Responses ` on -how to use this class to perform additional assertions and verification in your test cases. +``FeatureTestTrait::call()`` returns an instance of a ``TestResponse``. See :doc:`Testing Responses ` on how +to use this class to perform additional assertions and verification in your test cases. diff --git a/user_guide_src/source/testing/index.rst b/user_guide_src/source/testing/index.rst index 866ef30f5b6f..5fa01a853da2 100644 --- a/user_guide_src/source/testing/index.rst +++ b/user_guide_src/source/testing/index.rst @@ -1,21 +1,21 @@ -####### -Testing -####### - -CodeIgniter ships with a number of tools to help you test and debug your application thoroughly. -The following sections should get you quickly testing your applications. - -.. toctree:: - :titlesonly: - - Getting Started - Database - Generating Data - Controller Testing - HTTP Testing - response - cli - Mocking - benchmark - debugging - Session Testing +####### +Testing +####### + +CodeIgniter ships with a number of tools to help you test and debug your application thoroughly. The following sections +should get you quickly testing your applications. + +.. toctree:: + :titlesonly: + + Getting Started + Database + Generating Data + Controller Testing + HTTP Testing + response + cli + Mocking + benchmark + debugging + Session Testing diff --git a/user_guide_src/source/testing/mocking.rst b/user_guide_src/source/testing/mocking.rst index 7ca3e57efbc9..b1b2eacec5d4 100644 --- a/user_guide_src/source/testing/mocking.rst +++ b/user_guide_src/source/testing/mocking.rst @@ -2,10 +2,10 @@ Mocking System Classes ###################### -Several components within the framework provide mocked versions of their classes that can be used during testing. These classes -can take the place of the normal class during test execution, often providing additional assertions to test that actions -have taken place (or not taken place) during the execution of the test. This might be checking that data gets cached correctly, -that emails were sent correctly, etc. +Several components within the framework provide mocked versions of their classes that can be used during testing. These +classes can take the place of the normal class during test execution, often providing additional assertions to test that +actions have taken place (or not taken place) during the execution of the test. This might be checking that data gets +cached correctly, that emails were sent correctly, etc. .. contents:: :local: @@ -22,14 +22,14 @@ While this returns an instance of ``CodeIgniter\Test\Mock\MockCache`` that you c mock into the Service class, so any calls within your code to ``service('cache')`` or ``Config\Services::cache()`` will use the mocked class in its place. -When using this in more than one test method within a single file, you should call either the ``clean()`` or ``bypass()`` -methods during the test ``setUp()`` to ensure a clean slate when your tests run. +When using this in more than one test method within a single file, you should call either the ``clean()`` or +``bypass()`` methods during the test ``setUp()`` to ensure a clean slate when your tests run. Additional Methods ------------------ -You can instruct the mocked cache handler to never do any caching with the ``bypass()`` method. This will emulate -using the dummy handler and ensures that your test does not rely on cached data. +You can instruct the mocked cache handler to never do any caching with the ``bypass()`` method. This will emulate using +the dummy handler and ensures that your test does not rely on cached data. .. literalinclude:: mocking/002.php diff --git a/user_guide_src/source/testing/overview.rst b/user_guide_src/source/testing/overview.rst index 607a2e2f538a..c18f1edd7da0 100644 --- a/user_guide_src/source/testing/overview.rst +++ b/user_guide_src/source/testing/overview.rst @@ -2,9 +2,9 @@ Testing ####### -CodeIgniter has been built to make testing both the framework and your application as simple as possible. -Support for `PHPUnit `__ is built in, and the framework provides a number of convenient -helper methods to make testing every aspect of your application as painless as possible. +CodeIgniter has been built to make testing both the framework and your application as simple as possible. Support for +`PHPUnit `__ is built in, and the framework provides a number of convenient helper methods to make +testing every aspect of your application as painless as possible. .. contents:: :local: @@ -23,9 +23,9 @@ PHPUnit to use within your system. Composer -------- -The recommended method is to install it in your project using `Composer `__. While it's possible -to install it globally, we do not recommend it, since it can cause compatibility issues with other projects on your -system as time goes on. +The recommended method is to install it in your project using `Composer `__. While it's +possible to install it globally, we do not recommend it, since it can cause compatibility issues with other projects on +your system as time goes on. Ensure that you have Composer installed on your system. From the project root (the directory that contains the application and system directories) type the following from the command line: @@ -34,8 +34,8 @@ application and system directories) type the following from the command line: composer require --dev phpunit/phpunit -This will install the correct version for your current PHP version. Once that is done, you can run all of the -tests for this project by typing: +This will install the correct version for your current PHP version. Once that is done, you can run all of the tests for +this project by typing: .. code-block:: console @@ -50,8 +50,9 @@ If you are using Windows, use the following command: Phar ---- -The other option is to download the .phar file as described in the `PHPUnit installation guide `__. -This is a standalone file that should be placed within your project root. +The other option is to download the .phar file as described in the +`PHPUnit installation guide `__. This is a standalone file that +should be placed within your project root. ************************ Testing Your Application @@ -60,37 +61,33 @@ Testing Your Application PHPUnit Configuration ===================== -In your CodeIgniter project root, there is the ``phpunit.dist.xml`` file. This -controls unit testing of your application. If you provide your own ``phpunit.xml``, -it will override this. +In your CodeIgniter project root, there is the ``phpunit.dist.xml`` file. This controls unit testing of your +application. If you provide your own ``phpunit.xml``, it will override this. By default, test files are placed under the **tests** directory in the project root. The Test Class ============== -In order to take advantage of the additional tools provided, your tests must extend -``CodeIgniter\Test\CIUnitTestCase``. +In order to take advantage of the additional tools provided, your tests must extend ``CodeIgniter\Test\CIUnitTestCase``. -There are no rules for how test files must be placed. However, we recommend that -you establish placement rules in advance so that you can quickly understand where -the test files are located. +There are no rules for how test files must be placed. However, we recommend that you establish placement rules in +advance so that you can quickly understand where the test files are located. -In this document, the test files corresponding to the classes in the **app** directory -will be placed in the **tests/app** directory. To test a new library, -**app/Libraries/Foo.php**, you would create a new file at +In this document, the test files corresponding to the classes in the **app** directory will be placed in the +**tests/app** directory. To test a new library, **app/Libraries/Foo.php**, you would create a new file at **tests/app/Libraries/FooTest.php**: .. literalinclude:: overview/001.php -To test one of your models, **app/Models/UserModel.php**, you might end up with -something like this in **tests/app/Models/UserModelTest.php**: +To test one of your models, **app/Models/UserModel.php**, you might end up with something like this in +**tests/app/Models/UserModelTest.php**: .. literalinclude:: overview/002.php -You can create any directory structure that fits your testing style/needs. When namespacing the test classes, -remember that the **app** directory is the root of the ``App`` namespace, so any classes you use must -have the correct namespace relative to ``App``. +You can create any directory structure that fits your testing style/needs. When namespacing the test classes, remember +that the **app** directory is the root of the ``App`` namespace, so any classes you use must have the correct namespace +relative to ``App``. .. note:: Namespaces are not strictly required for test classes, but they are helpful to ensure no class names collide. @@ -99,8 +96,8 @@ When testing database results, you must use the :doc:`DatabaseTestTrait resetServices()`` method that ``CIUnitTestCase`` provides. -.. note:: This method resets all states of Services, and the ``RouteCollection`` - will have no routes. If you want your routes to be loaded, you need to - call the ``loadRoutes()`` method like ``Services::routes()->loadRoutes()``. +.. note:: This method resets all states of Services, and the ``RouteCollection`` will have no routes. If you want your + routes to be loaded, you need to call the ``loadRoutes()`` method like ``Services::routes()->loadRoutes()``. Services::resetSingle(string $name) ----------------------------------- Removes any mock and shared instances for a single service, by its name. -.. note:: The ``Cache``, ``Email`` and ``Session`` services are mocked by default to prevent intrusive testing behavior. To prevent these from being mocked, remove their method callback from the class property: ``$setUpMethods = ['mockEmail', 'mockSession'];`` +.. note:: The ``Cache``, ``Email`` and ``Session`` services are mocked by default to prevent intrusive testing behavior. + To prevent these from being mocked, remove their method callback from the class property: + ``$setUpMethods = ['mockEmail', 'mockSession'];`` Mocking Factory Instances ========================= -Similar to Services, you may find yourself needing to supply a pre-configured class instance -during testing that will be used with ``Factories``. Use the same ``Factories::injectMock()`` and ``Factories::reset()`` -static methods as **Services**, but they take an additional preceding parameter for the -component name: +Similar to Services, you may find yourself needing to supply a pre-configured class instance during testing that will be +used with ``Factories``. Use the same ``Factories::injectMock()`` and ``Factories::reset()`` static methods as +**Services**, but they take an additional preceding parameter for the component name: .. literalinclude:: overview/017.php -.. note:: All component Factories are reset by default between each test. Modify your test case's ``$setUpMethods`` if you need instances to persist. +.. note:: All component Factories are reset by default between each test. Modify your test case's ``$setUpMethods`` if + you need instances to persist. Testing and Time ================ -Testing time-dependent code can be challenging. However, when using the -:doc:`Time <../libraries/time>` class, the current time can be fixed or changed -at will during testing. +Testing time-dependent code can be challenging. However, when using the :doc:`Time <../libraries/time>` class, the +current time can be fixed or changed at will during testing. Below is sample test code that fixes the current time: .. literalinclude:: overview/021.php -You can fix the current time with the ``Time::setTestNow()`` method. -Optionally, you can specify a locale as the second parameter. +You can fix the current time with the ``Time::setTestNow()`` method. Optionally, you can specify a locale as the second +parameter. -Don't forget to reset the current time after the test by calling it without -parameters. +Don't forget to reset the current time after the test by calling it without parameters. diff --git a/user_guide_src/source/testing/response.rst b/user_guide_src/source/testing/response.rst index 352f6310e1ef..0b68c106fea4 100644 --- a/user_guide_src/source/testing/response.rst +++ b/user_guide_src/source/testing/response.rst @@ -2,10 +2,9 @@ Testing Responses ################# -The ``TestResponse`` class provides a number of helpful functions for parsing and testing responses -from your test cases. Usually a ``TestResponse`` will be provided for you as a result of your -:doc:`Controller Tests ` or :doc:`HTTP Feature Tests `, but you can always -create your own directly using any ``ResponseInterface``: +The ``TestResponse`` class provides a number of helpful functions for parsing and testing responses from your test +cases. Usually a ``TestResponse`` will be provided for you as a result of your :doc:`Controller Tests ` or +:doc:`HTTP Feature Tests `, but you can always create your own directly using any ``ResponseInterface``: .. literalinclude:: response/001.php :lines: 2- @@ -17,8 +16,8 @@ create your own directly using any ``ResponseInterface``: Testing the Response ******************** -Whether you have received a ``TestResponse`` as a result of your tests or created one yourself, -there are a number of new assertions that you can use in your tests. +Whether you have received a ``TestResponse`` as a result of your tests or created one yourself, there are a number of +new assertions that you can use in your tests. Accessing Request/Response ========================== @@ -45,8 +44,8 @@ Checking Response Status isOK() ------ -Returns a boolean true/false based on whether the response is perceived to be "ok". This is primarily determined by -a response status code in the 200s or 300s. An empty body is not considered valid, unless in redirects. +Returns a boolean true/false based on whether the response is perceived to be "ok". This is primarily determined by a +response status code in the 200s or 300s. An empty body is not considered valid, unless in redirects. .. literalinclude:: response/004.php :lines: 2- @@ -78,8 +77,7 @@ Asserts that the Response is an instance of RedirectResponse. ``assertNotRedirec assertRedirectTo() ------------------ -Asserts that the Response is an instance of RedirectResponse and the destination -matches the URI given. +Asserts that the Response is an instance of RedirectResponse and the destination matches the URI given. .. literalinclude:: response/008.php :lines: 2- @@ -108,8 +106,8 @@ Session Assertions assertSessionHas(string $key, $value = null) -------------------------------------------- -Asserts that a value exists in the resulting session. If ``$value`` is passed, it will also assert that the variable's value -matches what was specified. +Asserts that a value exists in the resulting session. If ``$value`` is passed, it will also assert that the variable's +value matches what was specified. .. literalinclude:: response/011.php :lines: 2- @@ -128,8 +126,8 @@ Header Assertions assertHeader(string $key, $value = null) ---------------------------------------- -Asserts that a header named ``$key`` exists in the response. If ``$value`` is not empty, it will also assert that -the values match. +Asserts that a header named ``$key`` exists in the response. If ``$value`` is not empty, it will also assert that the +values match. .. literalinclude:: response/013.php :lines: 2- @@ -148,8 +146,8 @@ Cookie Assertions assertCookie(string $key, $value = null, string $prefix = '') ------------------------------------------------------------- -Asserts that a cookie named ``$key`` exists in the response. If ``$value`` is not empty, it will also assert that -the values match. You can set the cookie prefix, if needed, by passing it in as the third parameter. +Asserts that a cookie named ``$key`` exists in the response. If ``$value`` is not empty, it will also assert that the +values match. You can set the cookie prefix, if needed, by passing it in as the third parameter. .. literalinclude:: response/015.php :lines: 2- @@ -165,8 +163,8 @@ Asserts that a cookie named ``$key`` does not exist in the response. assertCookieExpired(string $key, string $prefix = '') ----------------------------------------------------- -Asserts that a cookie named ``$key`` exists, but has expired. You can set the cookie prefix, if needed, by passing it -in as the second parameter. +Asserts that a cookie named ``$key`` exists, but has expired. You can set the cookie prefix, if needed, by passing it in +as the second parameter. .. literalinclude:: response/017.php :lines: 2- @@ -174,14 +172,13 @@ in as the second parameter. DOM Helpers =========== -The response you get back contains a number of helper methods to inspect the HTML output within the response. These -are useful for use within assertions in your tests. +The response you get back contains a number of helper methods to inspect the HTML output within the response. These are +useful for use within assertions in your tests. see() ----- -Returns a boolean true/false based on whether the text on the page exists either -by itself, or more specifically within +Returns a boolean true/false based on whether the text on the page exists either by itself, or more specifically within a tag, as specified by type, class, or id: .. literalinclude:: response/018.php @@ -230,9 +227,8 @@ seeXPath() .. versionadded:: 4.5.0 -You can use ``seeXPath()`` to take advantage of the full power that XPath gives you. -This method is aimed at more advanced users who want to write more complex expressions -using the DOMXPath object directly: +You can use ``seeXPath()`` to take advantage of the full power that XPath gives you. This method is aimed at more +advanced users who want to write more complex expressions using the DOMXPath object directly: .. literalinclude:: response/033.php :lines: 2- @@ -251,8 +247,8 @@ assertions. assertSee(string $search = null, string $element = null) -------------------------------------------------------- -Asserts that text/HTML is on the page, either by itself or, more specifically, within -a tag, as specified by type, class, or id: +Asserts that text/HTML is on the page, either by itself or, more specifically, within a tag, as specified by type, +class, or id: .. literalinclude:: response/024.php :lines: 2- @@ -276,8 +272,7 @@ Similar to ``assertSee()``, but this only checks for an existing element. It doe assertDontSeeElement(string $search) ------------------------------------ -Similar to ``assertSee()``, but this only checks for a missing element. It does not check for -specific text: +Similar to ``assertSee()``, but this only checks for a missing element. It does not check for specific text: .. literalinclude:: response/027.php :lines: 2- @@ -301,8 +296,8 @@ Asserts that an input tag exists with the name and value: Working with JSON ================= -Responses will frequently contain JSON, especially when working with API methods. The following methods -can help to test the responses. +Responses will frequently contain JSON, especially when working with API methods. The following methods can help to test +the responses. getJSON() --------- diff --git a/user_guide_src/source/testing/session_testing.rst b/user_guide_src/source/testing/session_testing.rst index 6bb4811112cf..749185e17090 100644 --- a/user_guide_src/source/testing/session_testing.rst +++ b/user_guide_src/source/testing/session_testing.rst @@ -2,12 +2,13 @@ Session Testing ############### -Testing session behavior in your application is made simple with the ArrayHandler session driver. -Unlike other session drivers, ArrayHandler does not persist data to disk, database, or external storage. -This allows you to simulate session interactions safely during unit or integration tests, without affecting real session data. +Testing session behavior in your application is made simple with the ArrayHandler session driver. Unlike other session +drivers, ArrayHandler does not persist data to disk, database, or external storage. This allows you to simulate session +interactions safely during unit or integration tests, without affecting real session data. -Using this driver, you can set, retrieve, and assert session data entirely in memory, making your tests faster and more isolated. -While in most production scenarios you would use file, database, or cache-backed sessions, ArrayHandler exists specifically to support testing workflows and prevent side effects. +Using this driver, you can set, retrieve, and assert session data entirely in memory, making your tests faster and more +isolated. While in most production scenarios you would use file, database, or cache-backed sessions, ArrayHandler exists +specifically to support testing workflows and prevent side effects. .. contents:: :local: @@ -16,7 +17,8 @@ While in most production scenarios you would use file, database, or cache-backed Initializing Sessions ===================== -You can initialize a session using the ArrayHandler driver for testing. This example shows how to create a session instance with a proper configuration: +You can initialize a session using the ArrayHandler driver for testing. This example shows how to create a session +instance with a proper configuration: .. literalinclude:: session_testing/001.php @@ -29,8 +31,8 @@ Once initialized, you can set session values and retrieve them as usual: .. note:: - Session data is stored in memory and lasts as long as the ArrayHandler object exists; - after the object is destroyed (typically at the end of a request or test), the data is lost. + Session data is stored in memory and lasts as long as the ArrayHandler object exists; after the object is destroyed + (typically at the end of a request or test), the data is lost. Example Test Case ================= @@ -46,23 +48,22 @@ Using PHPUnit Assertions with ArrayHandler ------------------------------------------ When testing sessions directly with Session and ArrayHandler in a unit test, use standard PHPUnit assertions. -``assertSessionHas()`` and ``assertSessionMissing()`` are not available in this context because you are interacting directly with the session object, -not a response object. +``assertSessionHas()`` and ``assertSessionMissing()`` are not available in this context because you are interacting +directly with the session object, not a response object. .. literalinclude:: session_testing/004.php Session Assertions via TestResponse ----------------------------------- -When testing controllers or HTTP responses, you can use CodeIgniter 4's session -assertion helpers, such as ``assertSessionHas()`` and ``assertSessionMissing()``, -which are available on the ``TestResponse`` object. These helpers allow you to -assert the state of the session during the HTTP request/response lifecycle. -See :ref:`Session Assertions ` for more details. +When testing controllers or HTTP responses, you can use CodeIgniter 4's session assertion helpers, such as +``assertSessionHas()`` and ``assertSessionMissing()``, which are available on the ``TestResponse`` object. These helpers +allow you to assert the state of the session during the HTTP request/response lifecycle. See +:ref:`Session Assertions ` for more details. Custom Session Values ===================== -In Feature Tests, you can provide custom session data for a single test using the ``withSession()`` method. -This allows you to simulate session states such as logged-in users or specific roles during the request. -For full details and examples, see :ref:`Setting Session Values `. +In Feature Tests, you can provide custom session data for a single test using the ``withSession()`` method. This allows +you to simulate session states such as logged-in users or specific roles during the request. For full details and +examples, see :ref:`Setting Session Values `.