diff --git a/user_guide_src/source/changelogs/index.rst b/user_guide_src/source/changelogs/index.rst index d22414ccda2e..c107d65b0fd8 100644 --- a/user_guide_src/source/changelogs/index.rst +++ b/user_guide_src/source/changelogs/index.rst @@ -2,253 +2,17 @@ Change Logs ########### -Version |version| -==================================================== - -Release Date: Not Released - -**Next release of CodeIgniter4** - - -:doc:`See all the changes. ` - -Version 4.0.0-rc.1 -==================================================== - -Release Date: September 02, 2019 - -Highlights: - -One breaking change: - -- Migrations refactored and streamlined for more wholistic functionality (BC) - -Enhancements: - -- CI3 Email ported to CI4 -- Encryption (basic) added -- added convert() to ImageHandlerInterface -- disabled debug toolbar for downloads -- CLI commands returns 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 - -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 - -Message changes: - -- Migration has new & modified messages -- Messages now has RESTful set - - -:doc:`See all the changes. ` - -Version 4.0.0-beta.4 -==================================================== - -Release Date: July 25, 2019 - -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 routing has been beefed up - -New messages: - -- new translation key: Database/noDateFormat - -Testing changes: - -- enhanced database & migration testing in tests/_support - -:doc:`See all the changes. ` - -Version 4.0.0-beta.3 -==================================================== - -Release Date: May 06, 2019 - -Highlights: - -- Fixed a number of model, database, validation & debug toolbar issues -- Type hinting added throughout & typos corrected (see API docs) - -New messages: - -- Database.FieldNotExists -- Validation.equals, not_equals - -App changes: - -- Removed $salt config item in app/Config/App -- Enabled migrations by default in app/Config/Migrations -- Simplified public/.htaccess - -:doc:`See all the changes. ` - -Version 4.0.0-beta.2 -==================================================== - -Release Date: April 04, 2019 - -Highlights: - -- 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 - -New messages: - -- Database.noPrimaryKey, 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 - -:doc:`See all the changes. ` - -Version 4.0.0-beta.1 -==================================================== - -Release Date: Unreleased - -Highlights: - -- New View Layouts provide simple way to create site site view templates. -- Fixed user guide CSS for proper wide table display -- Converted UploadedFile to use system messages -- Numerous database, migration & model bugs fixed -- Refactored unit testing for appstarter & framework distributions - -New messages: - -- 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 - -:doc:`See all the changes. ` - -Version 4.0.0-alpha.5 -==================================================== - -Release Date: January 30, 2019 - -**Alpha 5** - -Highlights: - -- 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 -- code coverage is up to 78% - -:doc:`See all the changes. ` - -Version 4.0.0-alpha.4 -==================================================== - -Release Date: December 15, 2018 - -**Next release of CodeIgniter4** - -Highlights: - -- 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 - - -:doc:`See all the changes. ` - -Version 4.0.0-alpha.3 -==================================================== - -Release Date: November 30, 2018 - -**Next alpha release of CodeIgniter4** - -- Numerous bug fixes, across the framework -- Many missing features implemented, across the framework -- Code coverage is up to 72% -- CodeIgniter4 has been promoted to its own github organization. - That is reflected in docs and comments. -- We have integrated a git pre-commit hook, which will apply the - CI4 code sniffer rules, and attempt to fix them. - We have run all the source files through it, and any "funny" - code formatting is temporary until the rules are updated. -- We welcome Natan Felles, from Brazil, to the code developer team. - He has proven to be passionate, dedicated and thorough :) - -:doc:`See all the changes. ` - - -Version 4.0.0-alpha.2 -================================= - -Release Date: Oct 26, 2018 - -**Second alpha release of CodeIgniter4** - -- bug fixes -- features implemented -- tutorial revised - -:doc:`See all the changes. ` - -Version 4.0.0-alpha.1 -================================= - -Release Date: September 28, 2018 - -**Rewrite of the CodeIgniter framework** - -Non-code changes: - - User Guide adapted or rewritten - - `System message translations repository `_ - - `Roadmap subforum `_ for more transparent planning - -New core classes: - - CodeIgniter (bootstrap) - - Common (shared functions) - - ComposerScripts (integrate third party tools) - - Controller (base controller) - - Model (base model) - - Entity (entity encapsulation) - -Some new, some old & some borrowed packages, all namespaced. - -:doc:`See all the changes. ` - .. toctree:: - :hidden: - :titlesonly: - - next - v4.0.0-alpha.5 - v4.0.0-alpha.4 - v4.0.0-alpha.3 - v4.0.0-alpha.2 - v4.0.0-alpha.1 + :titlesonly: + + next + v4.0.0-rc.1 + v4.0.0-beta.4 + v4.0.0-beta.3 + v4.0.0-beta.2 + v4.0.0-beta.1 + v4.0.0-alpha.5 + v4.0.0-alpha.4 + v4.0.0-alpha.3 + v4.0.0-alpha.2 + v4.0.0-alpha.1 diff --git a/user_guide_src/source/changelogs/next.rst b/user_guide_src/source/changelogs/next.rst index 4abb2ec033c8..d32cbc5f3a9f 100644 --- a/user_guide_src/source/changelogs/next.rst +++ b/user_guide_src/source/changelogs/next.rst @@ -3,12 +3,207 @@ Version |version| Release Date: Not released -**Next (pre-)release of CodeIgniter4** +**RC.2 release of CodeIgniter4** +Enhancements: + +- 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 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 + - 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: ------------ +---------- +- #2271 fix ResourcePresenter::setModel() +- #2269 testMode() method for BaseBuilder +- #2268 Validation session use only if exists +- #2267 Tests setUp and tearDown: void +- #2265 Fix a validation issue on multiple file upload +- #2264 fix. Parser allow other extension +- #2262 Fix parameter type in Debug/Exceptions +- #2261 Fix lang() signature +- #2260 Explain the whoops page +- #2259 Add URI & url_helper tests +- #2257 Several updates to the HAVING clauses +- #2253 Fix invalid parameters +- #2246 EXIF not supported for GIF +- #2245 Fix class ref parameter types +- #2241 Fix ini_set parameter type +- #2240 Handle JSON POSTs in CSRF +- #2232 Fixes BaseBuilder getWhere() bug +- #2231 Add magic __isset to classes with __get +- #2230 Add escape to SQLite _listTables() +- #2229 MySQLi escapeLikeStringDirect() +- #2228 Exclude `sqlite_%` from listTables() +- #2224 change new \Config\Database() to config('Database') +- #2221 Documentation fixes +- #2218 Typo corrected +- #2216 Update uri.rst +- #2213 Filter listTables cache response on constrainPrefix +- #2211 Add listTable() tests +- #2209 Add trace() +- #2208 Add $db->getPrefix() +- #2205 Fix empty() bug on DBPrefix +- #2201 Foreign key columns +- #2200 Notify Kint of dd alias +- #2199 Add getForeignKeyData to User Guide +- #2187 Update Session.php +- #2191 Migration rollback reverse +- #2190 Fix name of ForeignKeyChecks +- #2189 missing return +- #2184 Fix case on "Seeds/" directory +- #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/helpers/index.rst b/user_guide_src/source/helpers/index.rst index 50889ee36ff1..559491cdd009 100644 --- a/user_guide_src/source/helpers/index.rst +++ b/user_guide_src/source/helpers/index.rst @@ -2,7 +2,7 @@ Helpers ####### -Helpers are collections of useful procedureal functions. +Helpers are collections of useful procedural functions. .. toctree:: :glob: diff --git a/user_guide_src/source/incoming/incomingrequest.rst b/user_guide_src/source/incoming/incomingrequest.rst index e203cb801f0e..815d5010b7d7 100644 --- a/user_guide_src/source/incoming/incomingrequest.rst +++ b/user_guide_src/source/incoming/incomingrequest.rst @@ -253,10 +253,15 @@ and uses best practices to minimize any security risks. echo $file->getType(); // image/jpg } -You can also retrieve a single file based on the filename given in the HTML file input:: +You can retrieve a single file uploaded on its own, based on the filename given in the HTML file input:: $file = $request->getFile('uploadedfile'); +You can retrieve an array of same-named files uploaded as part of a +multi-file upload, based on the filename given in the HTML file input:: + + $files = $request->getFileMultiple('uploadedfile'); + Content Negotiation ---------------------------------------------------------------------------- diff --git a/user_guide_src/source/installation/repositories.rst b/user_guide_src/source/installation/repositories.rst index e05209340461..06f0b100f59c 100644 --- a/user_guide_src/source/installation/repositories.rst +++ b/user_guide_src/source/installation/repositories.rst @@ -59,3 +59,26 @@ These correspond to the repositories mentioned above: - `codeigniter4/coding-standard `_ See the :doc:`Installation ` page for more information. + +CodeIgniter 4 Projects +====================== + +We maintain a `codeigniter4projects `_ organization +on Github as well, with projects that are not part of the framework, +but which showcase it or make it easier to work with! + ++------------------+--------------+-----------------------------------------------------------------+ ++ Repository + Audience + Description + ++==================+==============+=================================================================+ ++ website2 + developers + The codeigniter.com website, written in CodeIgniter 4 + ++------------------+--------------+-----------------------------------------------------------------+ ++ module-tests + plugin + PHPunit testing scaffold for CI4 module / plugin developers + ++ + developers + + ++------------------+--------------+-----------------------------------------------------------------+ ++ project-tests + app + PHPunit testugn scaffold for CI4 projects + ++ + developers + + ++------------------+--------------+-----------------------------------------------------------------+ ++ + + + ++------------------+--------------+-----------------------------------------------------------------+ + +These are not composer-installable repositories. diff --git a/user_guide_src/source/libraries/uploaded_files.rst b/user_guide_src/source/libraries/uploaded_files.rst index 81315a49e978..346d3f8ecb2e 100644 --- a/user_guide_src/source/libraries/uploaded_files.rst +++ b/user_guide_src/source/libraries/uploaded_files.rst @@ -126,6 +126,11 @@ In controller:: $file1 = $this->request->getFile('images.0'); $file2 = $this->request->getFile('images.1'); +You might find it easier to use ``getFileMultiple()``, to get an array of uploaded files with the same name:: + + $files = $this->request->getFileMultiple('images'); + + Another example:: Upload an avatar: diff --git a/user_guide_src/source/libraries/validation.rst b/user_guide_src/source/libraries/validation.rst index 789d8aae26b7..573685e0dcaa 100644 --- a/user_guide_src/source/libraries/validation.rst +++ b/user_guide_src/source/libraries/validation.rst @@ -131,7 +131,7 @@ this code and save it to your **app/Controllers/** folder:: if (! $this->validate([])) { echo view('Signup', [ - 'validation' => $this->validation + 'validation' => $this->validator ]); } else @@ -734,6 +734,8 @@ ext_in Yes Fails if the file's extension is not one lis is_image Yes Fails if the file cannot be determined to be an image based on the mime type. is_image[field_name] ======================= =========== =============================================================================================== ======================================== +The file validation rules apply for both single and multiple file uploads. + .. note:: You can also use any native PHP functions that permit up to two parameters, where at least one is required (to pass the field data).