From 21acdfff2bc5640e80c1a5981cdfcb21c87bcb41 Mon Sep 17 00:00:00 2001 From: Master Yoda Date: Sat, 24 Nov 2018 07:52:02 -0800 Subject: [PATCH 1/9] First crack at updated admin scripts --- admin/README.md | 5 +- admin/config | 12 +++ admin/docbot | 2 +- admin/post_release | 3 +- admin/pre-release | 86 +++++++++++-------- admin/release | 13 ++- admin/workflow.md | 55 ++++++------ user_guide_src/source/changelog.rst | 59 ------------- .../source/changelogs/index-not.rst | 11 --- user_guide_src/source/changelogs/next.rst | 79 +++++++++++++---- 10 files changed, 168 insertions(+), 157 deletions(-) create mode 100644 admin/config delete mode 100644 user_guide_src/source/changelog.rst delete mode 100644 user_guide_src/source/changelogs/index-not.rst diff --git a/admin/README.md b/admin/README.md index f535dd433c3e..7650affe132e 100644 --- a/admin/README.md +++ b/admin/README.md @@ -2,7 +2,7 @@ This folder contains tools or docs useful for project maintainers. -##Repositories Organization, inside https://github.com/codeigniter4 +##Repositories inside https://github.com/codeigniter4 - **CodeIgniter4** is the main development repository. It supports issues and pull requests, and has a rule to enforce GPG-signed commits. @@ -45,6 +45,7 @@ This folder contains tools or docs useful for project maintainers. ##Maintainer Scripts +- **config** holds variables used for the maintainer & release building - **docbot** re-builds the user guide from the RST source for it, and optionally deploys it to the `gh-pages` branch of the main repository (if the user running it has maintainer rights on that repo). @@ -59,7 +60,7 @@ scripts used by the release manager: This includes updating version dependencies or constants, generating version(s) of the user guide; and possibly moving or ignoring stuff, distinguishing release from development. - If successful, it will leave a `releasing` file, with the version number + If successful, it will update the `config` file, with the version number in it. - **release** builds release branches for the derived repositories (framework, appstarter and userguide). diff --git a/admin/config b/admin/config new file mode 100644 index 000000000000..42ca33adbf5d --- /dev/null +++ b/admin/config @@ -0,0 +1,12 @@ + +# Variables used for maintainers & release building + +CI_ORG=https://github.com/codeigniter4/ + +BOLD='\033[1m' +NORMAL='\033[0m' +COLOR='\033[1;31m' +ERROR='\033[0;31m' + +# If RELEASE is set to something below, then we are part-way through the workflow +RELEASE= \ No newline at end of file diff --git a/admin/docbot b/admin/docbot index ee1716752f1f..93ca28fb7c28 100755 --- a/admin/docbot +++ b/admin/docbot @@ -2,7 +2,7 @@ # Rebuild and deploy CodeIgniter4 user guide -UPSTREAM=https://github.com/codeigniter4/CodeIgniter4.git +. config # Prepare the nested repo clone folder cd user_guide_src diff --git a/admin/post_release b/admin/post_release index e72de30a0f82..48b812271011 100644 --- a/admin/post_release +++ b/admin/post_release @@ -1,9 +1,8 @@ #!/bin/bash -#######################DO NOT USE YET######################## ## Cleanup after a framework release -UPSTREAM=https://github.com/codeigniter4/CodeIgniter4.git +UPSTREAM=${CI_ORG}CodeIgniter4.git version=4 qualifier= diff --git a/admin/pre-release b/admin/pre-release index 0e8027b25f2e..48470765059b 100755 --- a/admin/pre-release +++ b/admin/pre-release @@ -1,26 +1,27 @@ #!/bin/bash -#######################DO NOT USE YET######################## -## Build a framework release branch +## Build framework release branch & distributables #--------------------------------------------------- # Setup variables -UPSTREAM=https://github.com/codeigniter4/CodeIgniter4.git +. admin/config + +#--------------------------------------------------- +# Sanity check - are we underway already? +if [ -n "$RELEASE" ]; then + echo -e "${BOLD}${ERROR}A release build is already underway${NORMAL}" + exit 1 +fi + action=test version=4 qualifier= branch=release- releasable='application docs public system writable README.md composer.json contributing.md env license.txt spark' -release_empty='tests tests/_support' which=release -BOLD='\033[1m' -NORMAL='\033[0m' -COLOR='\033[1;31m' -ERROR='\033[0;31m' - echo -e "${BOLD}${COLOR}CodeIgniter4 release builder${NORMAL}" echo '----------------------------' @@ -29,7 +30,7 @@ echo '----------------------------' echo -e "${BOLD}Checking arguments...${NORMAL}" if [ $# -lt 1 ]; then - echo -e "${BOLD}Usage: admin/release version# pre-release-qualifier${NORMAL}" + echo -e "${BOLD}Usage: admin/pre-release version# pre-release-qualifier${NORMAL}" exit 1 fi @@ -39,7 +40,8 @@ if [ $# -gt 1 ]; then qualifier="-${2}" which='pre-release' fi -branch="release-$version$qualifier" +RELEASE=$version$qualifier +branch="release-$RELEASE" #--------------------------------------------------- # Create the release branch @@ -57,7 +59,7 @@ echo -e "${BOLD}Updating version dependencies${NORMAL}" function check_unique { count=`grep -c '$1' < $2 | wc -l` if [ $count -ne 1 ]; then - echo -e "${BOLD}${COLOR}$2 has ${count} occurences of '$1'${NORMAL}" + echo -e "${BOLD}${COLOR}$2 has ${count} occurrences of '$1'${NORMAL}" exit 1 fi } @@ -65,31 +67,43 @@ function check_unique { # Make sure there is only one line to affect in each file check_unique "const CI_VERSION" 'system/CodeIgniter.php' check_unique "release =" 'user_guide_src/source/conf.py' -check_unique "|release|" 'user_guide_src/source/changelog.rst' -check_unique "Release Date.*Not Released" 'user_guide_src/source/changelog.rst' +check_unique "|release|" 'user_guide_src/source/changelogs/index.rst' +check_unique "Release Date.*Not Released" 'user_guide_src/source/changelogs/index.rst' # CI_VERSION definition in system/CodeIgniter.php -sed -i "/const CI_VERSION/s/'.*'/'${version}${qualifier}'/" system/CodeIgniter.php +sed -i "/const CI_VERSION/s/'.*'/'${RELEASE}'/" system/CodeIgniter.php # release substitution variable in user_guide_src/source/conf.py -sed -i "/release =/s/'.*'/'${version}${qualifier}'/" user_guide_src/source/conf.py +sed -i "/release =/s/'.*'/'${RELEASE}'/" user_guide_src/source/conf.py # version & date in user_guide_src/source/changelog.rst -sed -i "/|release|/s/|.*|/${version}${qualifier}/" user_guide_src/source/changelog.rst -sed -i "/Release Date/s/Not Released/$(date +'%B %d, %Y')/" user_guide_src/source/changelog.rst +sed -i "/|release|/s/|.*|/${RELEASE}/" user_guide_src/source/changelogs/index.rst +sed -i "/Release Date/s/Not Released/$(date +'%B %d, %Y')/" user_guide_src/source/changelogs/index.rst + +# establish version-specific changelog +mv user_guide_src/source/changelogs/next.rst user_guide_src/source/changelogs/${RELEASE}.rst +# start new changelog for next version #--------------------------------------------------- # Setup the distribution folders +echo -e "${BOLD}Building repo distributions${NORMAL}" + +function setup_repo { + mkdir dist/$1 + cd dist/$1 + git init + git remote add origin ${CI_ORG}/$1 + git fetch +} if [ -d dist ]; then rm -rf dist/ fi mkdir dist -if [ -d build ]; then - rm -rf build/ -fi -mkdir build +setup_repo framework +setup_repo docs +setup_repo app-starter #--------------------------------------------------- # Generate the user guide @@ -104,32 +118,34 @@ make epub cd .. -mv user_guide_src/build/html build/docs +cp -rf user_guide_src/build/html dist/docs +mv user_guide_src/built/html dist/framework/docs + +cd dist/docs +git checkout gh-pages +cp -r ../../docs . #--------------------------------------------------- # And finally, get ready for merging git add . -git commit -m "Release ${version}${qualifier}" +git commit -m "Release ${RELEASE}" #--------------------------------------------------- # Hide stuff from the release bundle echo -e "${BOLD}Build the distributables${NORMAL}" -for f in $releasable; do - cp -r $f build/ -done -for f in $release_empty; do - mkdir build/$f -done - # add the docs -mv user_guide_src/build/epub/CodeIgniter4.epub dist/CodeIgniter-${version}${qualifier}.epub +mv user_guide_src/build/epub/CodeIgniter4.epub dist/CodeIgniter-${BRANCH}.epub cd build -zip -r ../dist/v${version}${qualifier}.zip * -tar -zcf ../dist/v${version}${qualifier}.tar.gz * +zip -r ../dist/v${RELEASE}.zip * +tar -zcf ../dist/v${RELEASE}.tar.gz * + +#--------------------------------------------------- +# Save the in-progress branch designation for following steps +sed -i "/RELEASE=/s/=.*/=${RELEASE}/" admin/config #--------------------------------------------------- # Done for now echo -e "${BOLD}Your $branch branch is ready to inspect.${NORMAL}" -echo -e "${BOLD}Follow the directions in release.md to continue.${NORMAL}" +echo -e "${BOLD}Follow the directions in workflow.md to continue.${NORMAL}" diff --git a/admin/release b/admin/release index 5bfe8a2c14c2..c6ef2ba9e30c 100755 --- a/admin/release +++ b/admin/release @@ -1,12 +1,21 @@ #!/bin/bash -#######################DO NOT USE YET######################## ## Build the distributable repo branches +. admin/config + +#--------------------------------------------------- +# Sanity check - are we underway already? +if [ "$BRANCH" ]; then + echo -e "${BOLD}${ERROR}No release build is underway${NORMAL}" + exit 1 +fi + + #--------------------------------------------------- # Setup variables -UPSTREAM=https://github.comcodeigniter4/CodeIgniter4.git +UPSTREAM=${CI_ORG}CodeIgniter4.git action=test version=4 qualifier= diff --git a/admin/workflow.md b/admin/workflow.md index 51d07d8e9b4e..90a71a97f8be 100644 --- a/admin/workflow.md +++ b/admin/workflow.md @@ -1,18 +1,25 @@ # Workflow -The repo has two branches of interest: "master" (stable) and "develop" (in progress). +The main repo has two branches of interest: "master" (stable) and "develop" (in progress). There might be other feature branches, but they are not relevant to this process. Once "develop" is ready for a new release, the general workflow is to +pre-release... - create a "release" branch from develop - update version dependencies or constants - generate version(s) of the user guide - move or ignore stuff, distinguishing release from development - test that all is as it should be + +release... - merge the release branch into "master" -- **manually** create the release & tag on github, based on master -- put everything back where it should be for development +- update the distribution repos +- **manually** create the releases & tag them on github, based on master + +post-release... +- eliminate the build & dist folders used above +- setup substitution variables for the next release - merge the post-release branch into "master" - merge the post-release branch into "develop" - **manually** delete the release branches in the repo @@ -30,21 +37,13 @@ Visually: post-release -> master post->release -> develop -The `release` bash script does the first six workflow steps, -and the `post-release` script does the other three between -the manual steps. - -For now, everything past the release branch build will be done -manually, until the condidence level is high enough to -automate some/all of those steps. - ## Assumptions You (a maintainer) have forked the main CodeIgniter4 repo, and the git alias `origin`, in your local clone, refers to your fork. -The script creates an additional alias, `upstream`, which refers to the -main repo. This separation keeps the release branch isolated -for any testing you want to do. +The `config` script defines an additional alias, `CI_ORG`, which refers to the +CodeIgniter 4 organization on github. +This separation keeps the release branch isolated for any testing you want to do. The `develop` branch of the main repo should be "clean", and ready for a release. This means that the changelog and upgrading instructions @@ -58,9 +57,9 @@ as part of a bug fix minor release. Inside a shell prompt, in the project root: - `admin/release version [qualifier]` + `admin/pre-release version [qualifier]` -Nothing is pushed to the repo. at this point - +Nothing is pushed to the repo at this point - the results are left inside the release branch in your local clone. @@ -71,25 +70,27 @@ The "qualifier" argument is a suffix to add to the version for a pre-release, e.g. `beta.2` or `rc.41`. Examples: -- `admin/release 4.0.0 alpha.1` would prepare the "4.0.0-alpha.1" pre-release PR -- `admin/release 4.0.0` would prepare the "4.0.0" release PR -- `admin/release peanut butter banana` would complain and tell you to read these directions +- `admin/pre-release 4.0.0 alpha.1` would prepare the "4.0.0-alpha.1" pre-release PR +- `admin/pre-release 4.0.0` would prepare the "4.0.0" release PR +- `admin/pre-release peanut butter banana` would complain and tell you to read these directions + +Once you have vetted the `dist` folder inside your local repo, you +can merge & push everything with + + `admin/release` -Complete the next few steps of the release manually: -- merge the release branch to "master" -- push that to the main repo -- on github.com, create an appropriate release (or pre-release) +On github.com, create an appropriate release (or pre-release), +with any optional files from the root of `dist`. -Once the release branch has been vetted, and you have -completed the manual steps, clean up with: +Once the github releases are done, clean up with: - `admin/post_release version [qualifier]` + `admin/post_release` ## Release notes On launch of a new release, a release notes post should be made in the announcements subforum. The planned text for it (so it can be previewed -by admins) is in `admin/release_notes`. +by admins) is in `admin/release_notes.bb`. ## Audience diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst deleted file mode 100644 index 29d825bf38bd..000000000000 --- a/user_guide_src/source/changelog.rst +++ /dev/null @@ -1,59 +0,0 @@ -########## -Change Log -########## - -Version |version| -==================================================== - -Release Date: Not Released - -**Next alpha release of CodeIgniter4** - -- Numerous bug fixes -- Many missing features implemented -- 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. - -: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](https://github.com/bcit-ci/CodeIgniter4-translations) - - [Roadmap subforum](https://forum.codeigniter.com/forum-33.html) 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. ` diff --git a/user_guide_src/source/changelogs/index-not.rst b/user_guide_src/source/changelogs/index-not.rst deleted file mode 100644 index 36f15c561928..000000000000 --- a/user_guide_src/source/changelogs/index-not.rst +++ /dev/null @@ -1,11 +0,0 @@ -##################### -Changelog Details -##################### - -Here are the gory details of changes in each version - -.. toctree:: - :glob: - :titlesonly: - - * \ No newline at end of file diff --git a/user_guide_src/source/changelogs/next.rst b/user_guide_src/source/changelogs/next.rst index 1a337c434a1e..7bc0d6b13fc6 100644 --- a/user_guide_src/source/changelogs/next.rst +++ b/user_guide_src/source/changelogs/next.rst @@ -5,6 +5,7 @@ Release Date: Not Released **Next alpha release of CodeIgniter4** + The list of changed files follows, with PR numbers shown. - admin/ @@ -45,8 +46,8 @@ The list of changed files follows, with PR numbers shown. - Mimes #1453 - Services #1180, #1469 - Database/ - - BaseBuilder #1335 - - BaseConnection #1335, #1407 + - BaseBuilder #1335, #1491 + - BaseConnection #1335, #1407, #1491 - BaseResult #1426 - Config #1465, #1469 - Forge #1343, #1449, #1470 @@ -57,6 +58,7 @@ The list of changed files follows, with PR numbers shown. - SQLite3/Connection #1335, #1449 - SQLite3/Forge #1470 - Debug + - Exceptions #1500 - Toolbar #1370, #1465, #1469 - Toolbar/Views/toolbar.tpl #1469 - Email/ @@ -74,13 +76,14 @@ The list of changed files follows, with PR numbers shown. - HTTP/ - DownloadResponse #1375 - Exceptions/DownloadException #1405 - - Files/UploadedFile #1335, #1399 - - IncomingRequest #1445, #1469 + - Files/FileCollection #1506 + - Files/UploadedFile #1335, #1399, #1500, #1506 + - IncomingRequest #1445, #1469, #1496 - RedirectResponse #1387, #1451, #1464 - - Response #1456, #1472, #1477 + - Response #1456, #1472, #1477, #1486, #1504, #1505 - ResponseInterface #1384 - UploadedFile #1368, #1456 - - URI #1213, #1469 + - URI #1213, #1469, #1508 - Language/ - en/Database #1335 - en/Filters #1378 @@ -90,8 +93,9 @@ The list of changed files follows, with PR numbers shown. - Pager #1213 - PagerRenderer #1213 - Router/ - - RouteCollection #1464 + - RouteCollection #1464, #1524 - RouteCollectionInterface #1406, #1410 + - Router #1523 - Session/Handlers/ - BaseHandler #1180, #1483 - DatabaseHandler #1180 @@ -101,16 +105,18 @@ The list of changed files follows, with PR numbers shown. - Test/ - CIUnitTestCase #1467 - FeatureTestCase #1427, #1468 - - Filters//CITestStreamFilter #1465 + - Filters/CITestStreamFilter #1465 - Validation / - CreditCardRules #1447 + - FormatRules #1507 - Rules #1345 - Validation #1345 - View/ - Filters #1469 - Parser #1417 - View #1357, #1377, #1410 - - CodeIgniter #1465 + - CodeIgniter #1465, #1505, #1523, 2047b5a + - Common #1486, #1496, #1504, #1513 - ComposerScripts #1469 - Controller #1423 - Entity #1369, #1373 @@ -125,16 +131,20 @@ The list of changed files follows, with PR numbers shown. - RedisHandlerTest #1180, #1481 - CLI/ - CLITest #1467, #1489 + - Commands/ + - SessionCommandsTest #1455 - Database/Live/ - ForgeTest #1449, #1470 - HTTP/ + - Files/FileCOllectionTest #1506 - Files/FileMovingTest #1424 - DownloadResponseTest #1375 + - IncomingRequestTest #1496 - RedirectResponseTest #1387, #1456 - - ResponseCookieTest #1472 - - ResponseSendTest #1477 - - ResponseTest #1375, #1456, #1472 - - URITest #1456 + - ResponseCookieTest #1472, #1509 + - ResponseSendTest #1477, #1486, #1509 + - ResponseTest #1375, #1456, #1472, #1486 + - URITest #1456, #1495 - Helpers/ - DateHelperTest #1479 - I18n/ @@ -146,8 +156,8 @@ The list of changed files follows, with PR numbers shown. - Pager/ - PagerRendererTest #1213 - Router/ - - RouteCollectionTest #1438 - - RouterTest#1438 + - RouteCollectionTest #1438, #1524 + - RouterTest #1438, #1523 - Session/ - SessionTest #1180 - Test/ @@ -157,11 +167,16 @@ The list of changed files follows, with PR numbers shown. - TestCaseTest #1390 - Throttle/ - ThrottleTest #1398 + - Validation/ + - FormatRulesTest #1507 - View/ - ParserTest #1335 - - CommonFunctionsTest #1180 + - CodeIgniterTest #1500 + - CommonFunctionsSendTest #1486, #1509 + - CommonFunctionsTest #1180, #1486, #1496 - user_guide_src /source/ + - changelogs/ #1385, #1490 - concepts/ - services #1469 - structure #1448 @@ -173,28 +188,55 @@ The list of changed files follows, with PR numbers shown. - seeds #1482 - extending/ - core_classes #1469 + - helpers/ + - form_helper #1499 - installation/ - index #1388 - libraries/ - pagination #1213 + - validation #27868b + - models/ + - entities #1518 - outgoing/ - - resposne #1472 + - response #1472, #1494 - testing/ - overview #1467 - tutorial/ - create_news_item #1442 - - changelog #1385 - / - composer.json #1388, #1418 - README.md + - spark 2047b5a - .travis.yml #1394 PRs merged: ----------- +- 2047b5a Don't run filters when using spark. +- #1524 Test routes resource with 'websafe' option +- #1523 Check if the matched route regex is filtered +- #1521 .gitignore clean up +- #1518 Small typo: changed setCreatedOn to setCreatedAt +- #1517 move .htaccess from per-directory in writable/{directory} to writable/ +- #1513 More secure redirection +- #1509 remove unused use statements +- #1508 remove duplicate strtolower() call in URI::setScheme() call +- #1507 Fix multi "empty" string separated by "," marked as valid emails +- #1506 Flesh out HTTP/File unit testing +- #1505 Do not exit until all Response is completed +- 27868b Add missing docs for {field} and {param} placeholders +- #1504 Revert RedirectResponse changes +- #1500 Ignoring errors suppressed by @ +- #1499 Fix form_helper's set_value writeup +- #1496 Fix Common::old() +- #1495 Add URI segment test +- #1494 Method naming in user guide +- #1491 Error logging +- #1490 Changelog(s) restructure - #1489 Add CLI::strlen() - #1488 Load Language strings from other locations +- #1486 Test RedirectResponse problem report - #1484 missing slash - #1483 Small typo in Session\Handlers\BaseHandler.php - #1482 doc fix: query binding fix in Seeds documentation @@ -286,3 +328,4 @@ PRs merged: - #1335 Review and improvements in databases drivers MySQLi, Postgre and SQLite - #1213 URI segment as page number in Pagination - #1180 using HTTP\Request instance to pull ip address + From d6352c05cd1e2fbb4526494d20a63a098c99dd86 Mon Sep 17 00:00:00 2001 From: Master Yoda Date: Sun, 25 Nov 2018 09:59:53 -0800 Subject: [PATCH 2/9] Remember starting directory --- admin/config | 1 + admin/next.rst | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 admin/next.rst diff --git a/admin/config b/admin/config index 42ca33adbf5d..dda03e85e0a0 100644 --- a/admin/config +++ b/admin/config @@ -2,6 +2,7 @@ # Variables used for maintainers & release building CI_ORG=https://github.com/codeigniter4/ +CI_DIR=`pwd` BOLD='\033[1m' NORMAL='\033[0m' diff --git a/admin/next.rst b/admin/next.rst new file mode 100644 index 000000000000..253007152933 --- /dev/null +++ b/admin/next.rst @@ -0,0 +1,15 @@ +########### +Change Logs +########### + +Version |version| +==================================================== + +Release Date: Not Released + +**Next release of CodeIgniter4** + + +:doc:`See all the changes. ` + + From 359907cf092cec400e76202af84859a8a27eaeaf Mon Sep 17 00:00:00 2001 From: Jim Parry Date: Wed, 28 Nov 2018 08:40:38 -0800 Subject: [PATCH 3/9] Split into separate release scripts --- admin/README.md | 35 ++-- .../source/changelogs}/next.rst | 5 +- admin/config | 13 -- admin/framework/composer.json | 38 +++++ admin/post_release | 91 ---------- admin/pre-release | 151 ----------------- admin/release | 159 ++++++++++-------- admin/release-appstarter | 38 +++++ admin/release-config | 27 +++ admin/release-deploy | 52 ++++++ admin/release-framework | 42 +++++ admin/release-notes.bb | 2 +- admin/release-revert | 26 +++ admin/release-userguide | 39 +++++ admin/starter/composer.json | 36 ++++ admin/workflow.md | 50 ++---- composer.json | 2 +- 17 files changed, 426 insertions(+), 380 deletions(-) rename admin/{ => codeigniter4/user_guide_src/source/changelogs}/next.rst (67%) delete mode 100644 admin/config create mode 100644 admin/framework/composer.json delete mode 100644 admin/post_release delete mode 100755 admin/pre-release create mode 100644 admin/release-appstarter create mode 100644 admin/release-config create mode 100644 admin/release-deploy create mode 100755 admin/release-framework create mode 100644 admin/release-revert create mode 100644 admin/release-userguide create mode 100644 admin/starter/composer.json diff --git a/admin/README.md b/admin/README.md index 7650affe132e..b830e650876f 100644 --- a/admin/README.md +++ b/admin/README.md @@ -23,7 +23,7 @@ This folder contains tools or docs useful for project maintainers. - **userguide** is released documentation publishing repository. It contains built versions of the user guide, corresponding to the framework releases. - It could be downloaded, forked or composer-installed. + It could be downloaded, forked or potentially composer-installed. This is a read-only repository. - **coding-standard** is the coding style standards repository. @@ -45,7 +45,7 @@ This folder contains tools or docs useful for project maintainers. ##Maintainer Scripts -- **config** holds variables used for the maintainer & release building +- **release-config** holds variables used for the maintainer & release building - **docbot** re-builds the user guide from the RST source for it, and optionally deploys it to the `gh-pages` branch of the main repository (if the user running it has maintainer rights on that repo). @@ -56,22 +56,33 @@ This folder contains tools or docs useful for project maintainers. The release workflow is detailed in its own writeup; these are the main scripts used by the release manager: -- **pre-release** builds a new release branch in the main repo, for vetting. +- **release** builds a new release branch in the main repo, for vetting. This includes updating version dependencies or constants, generating version(s) of the user guide; and possibly moving or ignoring stuff, distinguishing release from development. If successful, it will update the `config` file, with the version number - in it. -- **release** builds release branches for the derived repositories - (framework, appstarter and userguide). - These are pushed to the respective repositories (if the user has maintainer - rights), but the actual associated releases are created on github.com manually, so - that additional binaries can be added to the release if appropriate. -- **post-release** cleans up after a release, eg. setting up the changelog for - the next release. + in it, and it will run the related scripts following, to revise + the release distributions. +- **release-framework** builds the distributable framework repo. + It could be used on its own, but is normally part of `release`. +- **release-appstarter** builds the distributable appstarter repo. + It could be used on its own, but is normally part of `release`. +- **release-userguide** builds the distributable userguide repo. + It could be used on its own, but is normally part of `release`. +- **release-deploy** pushes the release changes to the appropriate github + repositories. Tag & create releases on github. This is not easily reversible! +- **release-revert** can be used to restore your repositories to the state they + were in before you started a release. **IF** you haven't deployed. + This is in case you decide not to proceed with the release, for any reason. + Remember to be polite when running it. ##Other Stuff - **release-notes.bb** is a boilerplate for forum announcements of a new release. - It is marked up using [BBcode](https://en.wikipedia.org/wiki/BBCode). \ No newline at end of file + It is marked up using [BBcode](https://en.wikipedia.org/wiki/BBCode). +- The **framework** and **starter** subfolders contain files that will over-ride + those from the development repository, when the distribution repositories + are built. +- The subfolders inside `admin` contain "next release" files in the case of + `codeigniter4` and over-written distribution files in the other cases. diff --git a/admin/next.rst b/admin/codeigniter4/user_guide_src/source/changelogs/next.rst similarity index 67% rename from admin/next.rst rename to admin/codeigniter4/user_guide_src/source/changelogs/next.rst index 253007152933..b8691312bef4 100644 --- a/admin/next.rst +++ b/admin/codeigniter4/user_guide_src/source/changelogs/next.rst @@ -9,7 +9,8 @@ Release Date: Not Released **Next release of CodeIgniter4** +The list of changed files follows, with PR numbers shown. -:doc:`See all the changes. ` - +PRs merged: +----------- diff --git a/admin/config b/admin/config deleted file mode 100644 index dda03e85e0a0..000000000000 --- a/admin/config +++ /dev/null @@ -1,13 +0,0 @@ - -# Variables used for maintainers & release building - -CI_ORG=https://github.com/codeigniter4/ -CI_DIR=`pwd` - -BOLD='\033[1m' -NORMAL='\033[0m' -COLOR='\033[1;31m' -ERROR='\033[0;31m' - -# If RELEASE is set to something below, then we are part-way through the workflow -RELEASE= \ No newline at end of file diff --git a/admin/framework/composer.json b/admin/framework/composer.json new file mode 100644 index 000000000000..d51327b88d76 --- /dev/null +++ b/admin/framework/composer.json @@ -0,0 +1,38 @@ +{ + "name": "codeigniter4/framework", + "type": "project", + "description": "The CodeIgniter framework v4", + "homepage": "https://codeigniter.com", + "license": "MIT", + "require": { + "php": ">=7.1", + "ext-curl": "*", + "ext-intl": "*", + "kint-php/kint": "^2.1", + "zendframework/zend-escaper": "^2.5" + }, + "require-dev": { + "codeigniter4/codeigniter4-standard": "^1.0", + "mikey179/vfsStream": "1.6.*", + "phpunit/phpunit": "^7.0", + "squizlabs/php_codesniffer": "^3.3" + }, + "autoload": { + "psr-4": { + "CodeIgniter\\": "system/", + "Psr\\Log\\": "system/ThirdParty/PSR/Log/" + } + }, + "scripts": { + "post-update-cmd": [ + "composer dump-autoload", + "CodeIgniter\\ComposerScripts::postUpdate", + "bash admin/setup.sh" + ] + }, + "support": { + "forum": "http://forum.codeigniter.com/", + "source": "https://github.com/codeigniter4/CodeIgniter4", + "slack": "https://codeigniterchat.slack.com" + } +} diff --git a/admin/post_release b/admin/post_release deleted file mode 100644 index 48b812271011..000000000000 --- a/admin/post_release +++ /dev/null @@ -1,91 +0,0 @@ -#!/bin/bash - -## Cleanup after a framework release - -UPSTREAM=${CI_ORG}CodeIgniter4.git -version=4 -qualifier= - -branch=post-release- -devonly='.github/* admin/* build/* contributing/* user_guide_src/* CODE_OF_CONDUCT.md \ -DCO.txt PULL_REQUEST_TEMPLATE.md' -which=release - -BOLD='\033[1m' -NORMAL='\033[0m' -COLOR='\033[1;31m' -ERROR='\033[0;31m' - -echo -e "${BOLD}${COLOR}CodeIgniter4 release cleanup${NORMAL}" -echo '----------------------------' - -#--------------------------------------------------- -# Check arguments -echo -e "${BOLD}Checking arguments...${NORMAL}" - -if [ $# -lt 1 ]; then - echo "You really need to read the directions first!" - exit 1 -fi - -version=$1 -if [ $# -gt 1 ]; then - qualifier="-${2}" - which='pre-release' -fi -release_branch="release-$version$qualifier" -branch="post-${release_branch}" - -#--------------------------------------------------- -# Create the post-release branch -echo -e "${BOLD}Creating $branch${NORMAL}" - -git checkout $release_branch -git branch -d $branch # remove the branch if there -git checkout -b $branch - -#--------------------------------------------------- -# Put our house back in order -echo -e "${BOLD}Put our house back in order${NORMAL}" - -mv -r admin/previous-gitignore .gitignore -rm -Rf docs - -#--------------------------------------------------- -# Add next version block in changelog.rst -echo -e "${BOLD}Setup next release${NORMAL}" -sed -i '5 i\ -Version |release| -==================================================== - -Release Date: Not Released -' user_guide_src/source/changelog.rst - -git add . -git commit -S -m "Post ${branch} cleanup" - -#--------------------------------------------------- -# Cleanup master -echo -e "${BOLD}Cleanup the master branch${NORMAL}" -git checkout master -git merge ${branch} -git push origin master -#git push UPSTREAM master - -#--------------------------------------------------- -# Cleanup develop -echo -e "${BOLD}Cleanup the develop branch${NORMAL}" -git checkout develop -git merge ${branch} -git push origin develop -#git push UPSTREAM develop - -# keep or delete the release branch? up to you -# at this point, you should have uptodate develop and master, -# as well as the release and post-release branches - -#--------------------------------------------------- -# Phew! - -echo -e "${BOLD}Congratulations - we have liftoff${NORMAL}" -echo "Don't forget to announce this release on the forum and on twitter!" diff --git a/admin/pre-release b/admin/pre-release deleted file mode 100755 index 48470765059b..000000000000 --- a/admin/pre-release +++ /dev/null @@ -1,151 +0,0 @@ -#!/bin/bash - -## Build framework release branch & distributables - -#--------------------------------------------------- -# Setup variables - -. admin/config - -#--------------------------------------------------- -# Sanity check - are we underway already? -if [ -n "$RELEASE" ]; then - echo -e "${BOLD}${ERROR}A release build is already underway${NORMAL}" - exit 1 -fi - -action=test -version=4 -qualifier= - -branch=release- -releasable='application docs public system writable README.md composer.json contributing.md env license.txt spark' -which=release - -echo -e "${BOLD}${COLOR}CodeIgniter4 release builder${NORMAL}" -echo '----------------------------' - -#--------------------------------------------------- -# Check arguments -echo -e "${BOLD}Checking arguments...${NORMAL}" - -if [ $# -lt 1 ]; then - echo -e "${BOLD}Usage: admin/pre-release version# pre-release-qualifier${NORMAL}" - exit 1 -fi - - -version=$1 -if [ $# -gt 1 ]; then - qualifier="-${2}" - which='pre-release' -fi -RELEASE=$version$qualifier -branch="release-$RELEASE" - -#--------------------------------------------------- -# Create the release branch -echo -e "${BOLD}Creating $which $branch to $action ${NORMAL}" - -git checkout develop -git branch -d $branch &>/dev/null # remove the branch if there -git checkout -b $branch -composer update - -#--------------------------------------------------- -# Update version dependencies -echo -e "${BOLD}Updating version dependencies${NORMAL}" - -function check_unique { - count=`grep -c '$1' < $2 | wc -l` - if [ $count -ne 1 ]; then - echo -e "${BOLD}${COLOR}$2 has ${count} occurrences of '$1'${NORMAL}" - exit 1 - fi -} - -# Make sure there is only one line to affect in each file -check_unique "const CI_VERSION" 'system/CodeIgniter.php' -check_unique "release =" 'user_guide_src/source/conf.py' -check_unique "|release|" 'user_guide_src/source/changelogs/index.rst' -check_unique "Release Date.*Not Released" 'user_guide_src/source/changelogs/index.rst' - -# CI_VERSION definition in system/CodeIgniter.php -sed -i "/const CI_VERSION/s/'.*'/'${RELEASE}'/" system/CodeIgniter.php - -# release substitution variable in user_guide_src/source/conf.py -sed -i "/release =/s/'.*'/'${RELEASE}'/" user_guide_src/source/conf.py - -# version & date in user_guide_src/source/changelog.rst -sed -i "/|release|/s/|.*|/${RELEASE}/" user_guide_src/source/changelogs/index.rst -sed -i "/Release Date/s/Not Released/$(date +'%B %d, %Y')/" user_guide_src/source/changelogs/index.rst - -# establish version-specific changelog -mv user_guide_src/source/changelogs/next.rst user_guide_src/source/changelogs/${RELEASE}.rst -# start new changelog for next version - -#--------------------------------------------------- -# Setup the distribution folders -echo -e "${BOLD}Building repo distributions${NORMAL}" - -function setup_repo { - mkdir dist/$1 - cd dist/$1 - git init - git remote add origin ${CI_ORG}/$1 - git fetch -} - -if [ -d dist ]; then - rm -rf dist/ -fi -mkdir dist - -setup_repo framework -setup_repo docs -setup_repo app-starter - -#--------------------------------------------------- -# Generate the user guide -echo -e "${BOLD}Generate the user guide${NORMAL}" - -cd user_guide_src - -# make the UG -rm -rf build/* -make html -make epub - -cd .. - -cp -rf user_guide_src/build/html dist/docs -mv user_guide_src/built/html dist/framework/docs - -cd dist/docs -git checkout gh-pages -cp -r ../../docs . - -#--------------------------------------------------- -# And finally, get ready for merging -git add . -git commit -m "Release ${RELEASE}" - -#--------------------------------------------------- -# Hide stuff from the release bundle -echo -e "${BOLD}Build the distributables${NORMAL}" - -# add the docs -mv user_guide_src/build/epub/CodeIgniter4.epub dist/CodeIgniter-${BRANCH}.epub - -cd build -zip -r ../dist/v${RELEASE}.zip * -tar -zcf ../dist/v${RELEASE}.tar.gz * - -#--------------------------------------------------- -# Save the in-progress branch designation for following steps -sed -i "/RELEASE=/s/=.*/=${RELEASE}/" admin/config - -#--------------------------------------------------- -# Done for now -echo -e "${BOLD}Your $branch branch is ready to inspect.${NORMAL}" -echo -e "${BOLD}Follow the directions in workflow.md to continue.${NORMAL}" diff --git a/admin/release b/admin/release index c6ef2ba9e30c..c092c3267ccd 100755 --- a/admin/release +++ b/admin/release @@ -1,36 +1,11 @@ #!/bin/bash -## Build the distributable repo branches +## Build framework release branch & distributables -. admin/config - -#--------------------------------------------------- -# Sanity check - are we underway already? -if [ "$BRANCH" ]; then - echo -e "${BOLD}${ERROR}No release build is underway${NORMAL}" - exit 1 -fi - - -#--------------------------------------------------- # Setup variables +. admin/release-config -UPSTREAM=${CI_ORG}CodeIgniter4.git -action=test -version=4 -qualifier= - -branch=post-release- -devonly='.github/* admin/* build/* contributing/* user_guide_src/* CODE_OF_CONDUCT.md \ -DCO.txt PULL_REQUEST_TEMPLATE.md' -which=release - -BOLD='\033[1m' -NORMAL='\033[0m' -COLOR='\033[1;31m' -ERROR='\033[0;31m' - -echo -e "${BOLD}${COLOR}CodeIgniter4 release cleanup${NORMAL}" +echo -e "${BOLD}${COLOR}CodeIgniter4 release builder${NORMAL}" echo '----------------------------' #--------------------------------------------------- @@ -38,68 +13,106 @@ echo '----------------------------' echo -e "${BOLD}Checking arguments...${NORMAL}" if [ $# -lt 1 ]; then - echo "You really need to read the directions first!" + echo -e "${BOLD}Usage: admin/release version# pre-release-qualifier${NORMAL}" exit 1 fi -version=$1 -if [ $# -gt 1 ]; then - qualifier="-${2}" - which='pre-release' -fi -release_branch="release-$version$qualifier" -branch="post-${release_branch}" - #--------------------------------------------------- -# Create the post-release branch -echo -e "${BOLD}Creating $branch${NORMAL}" +# Create the release branch +echo -e "${BOLD}Creating $which $branch to $action ${NORMAL}" -git checkout $release_branch -git branch -d $branch # remove the branch if there +git checkout develop +git branch -d $branch &>/dev/null # remove the branch if there git checkout -b $branch +composer update #--------------------------------------------------- -# Put our house back in order -echo -e "${BOLD}Put our house back in order${NORMAL}" +# Update version dependencies +echo -e "${BOLD}Updating version dependencies${NORMAL}" -mv -r admin/previous-gitignore .gitignore -rm -Rf docs +function check_unique { + count=`grep -c '$1' < $2 | wc -l` + if [ $count -ne 1 ]; then + echo -e "${BOLD}${COLOR}$2 has ${count} occurrences of '$1'${NORMAL}" + exit 1 + fi +} -#--------------------------------------------------- -# Add next version block in changelog.rst -echo -e "${BOLD}Setup next release${NORMAL}" -sed -i '5 i\ -Version |release| -==================================================== +# Make sure there is only one line to affect in each file +check_unique "const CI_VERSION" 'system/CodeIgniter.php' +check_unique "release =" 'user_guide_src/source/conf.py' +check_unique "|release|" 'user_guide_src/source/changelogs/index.rst' +check_unique "Release Date.*Not Released" 'user_guide_src/source/changelogs/index.rst' + +# CI_VERSION definition in system/CodeIgniter.php +sed -i "/const CI_VERSION/s/'.*'/'${RELEASE}'/" system/CodeIgniter.php -Release Date: Not Released -' user_guide_src/source/changelog.rst +# release substitution variable in user_guide_src/source/conf.py +sed -i "/release =/s/'.*'/'${RELEASE}'/" user_guide_src/source/conf.py -git add . -git commit -S -m "Post ${branch} cleanup" +# version & date in user_guide_src/source/index.rst +sed -i "/|release|/s/|.*|/${RELEASE}/" user_guide_src/source/changelogs/index.rst +sed -i "/Release Date/s/Not Released/$(date +'%B %d, %Y')/" user_guide_src/source/changelogs/index.rst + +# version & date in user_guide_src/source/next.rst +sed -i "/|release|/s/|.*|/${RELEASE}/" user_guide_src/source/changelogs/next.rst +sed -i "/Release Date/s/Not Released/$(date +'%B %d, %Y')/" user_guide_src/source/changelogs/next.rst +sed -i "/|version|/s/|version|/${RELEASE}/" user_guide_src/source/changelogs/next.rst + +# establish version-specific changelog +mv user_guide_src/source/changelogs/next.rst user_guide_src/source/changelogs/${RELEASE}.rst #--------------------------------------------------- -# Cleanup master -echo -e "${BOLD}Cleanup the master branch${NORMAL}" -git checkout master -git merge ${branch} -git push origin master -#git push UPSTREAM master +# Setup the distribution folders +echo -e "${BOLD}Building distribution folders${NORMAL}" + +function setup_repo { + echo -e "${BOLD}... $1${NORMAL}" + if [ -d dist/$1 ]; then + rm -rf dist/$1 + fi + mkdir dist/$1 + cd dist/$1 + git init + git remote add origin ${CI_ORG}/$1.git + git fetch + git checkout master + git checkout -b $branch + cd $CI_DIR +} + +if [ -d dist ]; then + rm -rf dist/ +fi +mkdir dist + +setup_repo framework +setup_repo userguide +setup_repo appstarter #--------------------------------------------------- -# Cleanup develop -echo -e "${BOLD}Cleanup the develop branch${NORMAL}" -git checkout develop -git merge ${branch} -git push origin develop -#git push UPSTREAM develop +# Generate the user guide +echo -e "${BOLD}Generate the user guide${NORMAL}" + +cd user_guide_src -# keep or delete the release branch? up to you -# at this point, you should have uptodate develop and master, -# as well as the release and post-release branches +# make the UG +rm -rf build/* +echo -e "${BOLD}... HTML version${NORMAL}" +make html +echo -e "${BOLD}... epub version${NORMAL}" +make epub + +cd ${CI_DIR} #--------------------------------------------------- -# Phew! +# Build the distributables + +. release-framework +. release-userguide +. release-appstarter -echo -e "${BOLD}Congratulations - we have liftoff${NORMAL}" -echo "Don't forget to announce this release on the forum and on twitter!" +#--------------------------------------------------- +# Done for now +echo -e "${BOLD}Your $branch branch is ready to inspect.${NORMAL}" +echo -e "${BOLD}Follow the directions in workflow.md to continue.${NORMAL}" diff --git a/admin/release-appstarter b/admin/release-appstarter new file mode 100644 index 000000000000..5cefb7821aa1 --- /dev/null +++ b/admin/release-appstarter @@ -0,0 +1,38 @@ +#!/bin/bash + +## Build app starter distributable + +# Setup variables +. admin/release-config +TARGET=dist/appstarter + +echo -e "${BOLD}Build the framework distributable${NORMAL}" + +echo -e "${BOLD}Copy the main files/folders...${NORMAL}" +releasable='application public writable README.md contributing.md env license.txt spark' +for fff in $releasable + if [ -d $fff ]; then + rm -rf ${TARGET}/$fff + cp -rf $fff ${TARGET}/ + else + rm ${TARGET}/$fff + cp -f $fff ${TARGET}/ + fi +done + +echo -e "${BOLD}Override as needed...${NORMAL}" +cp -rf admin/starter/* ${TARGET}/ + +#--------------------------------------------------- +# And finally, get ready for merging +cd $TARGET +git add . +git commit -S -m "Release ${RELEASE}" +git checkout master +git merge $branch + +cd $CI_DIR + +#--------------------------------------------------- +# Done for now +echo -e "${BOLD}Distributable app starter ready..${NORMAL}" diff --git a/admin/release-config b/admin/release-config new file mode 100644 index 000000000000..8ff1f746be4e --- /dev/null +++ b/admin/release-config @@ -0,0 +1,27 @@ +# Variables used for release building + +if [ "$CI_ORG" ]; then +else + + # Initialize variables + CI_ORG=https://github.com/codeigniter4 + CI_DIR=`pwd` + + BOLD='\033[1m' + NORMAL='\033[0m' + COLOR='\033[1;31m' + ERROR='\033[0;31m' + + qualifier= + which=release + + version=$1 + if [ $# -gt 1 ]; then + qualifier="-${2}" + which='pre-release' + fi + + RELEASE=$version$qualifier + branch="release-$RELEASE" + +fi \ No newline at end of file diff --git a/admin/release-deploy b/admin/release-deploy new file mode 100644 index 000000000000..8c65278c20d5 --- /dev/null +++ b/admin/release-deploy @@ -0,0 +1,52 @@ +#!/bin/bash + +## Push local changes to github + +echo -e "${BOLD}${COLOR}CodeIgniter4 release deployment${NORMAL}" +echo '-------------------------------' + +# Check for politeness, to avoid inadvertent deployment +if [ $# -lt 2 ]; then + echo "You forgot the magic word" + exit 1 +fi +if [ $1 != 'please' ]; then + echo "What do you say?" + exit 1 +fi + +. admin/release-config + +echo -e "${BOLD}Merge release into master${NORMAL}" +git checkout master +git merge $branch +git push origin master +git push ${CI_ORG}/CodeIgniter4 master + +echo -e "${BOLD}Merge release into develop${NORMAL}" +git checkout develop +git merge $branch +git push origin develop +git push ${CI_ORG}/CodeIgniter4 develop + +echo -e "${BOLD}Pushing to the user guide repository${NORMAL}" +cd ${CI_DIR}/dist/userguide +git push origin master +git push ${CI_ORG}/userguide master + +echo -e "${BOLD}Pushing to the framework repository${NORMAL}" +cd ${CI_DIR}/dist/framework +git push origin master +git push ${CI_ORG}/framework master + +echo -e "${BOLD}Pushing to the app starter repository${NORMAL}" +cd ${CI_DIR}/dist/appstarter +git push origin master +git push ${CI_ORG}/appstarter master + +cd ${CI_DIR} + +#--------------------------------------------------- +# Phew! +echo -e "${BOLD}Congratulations - we have liftoff${NORMAL}" +echo "Don't forget to announce this release on the forum and on twitter!" diff --git a/admin/release-framework b/admin/release-framework new file mode 100755 index 000000000000..29845c840f91 --- /dev/null +++ b/admin/release-framework @@ -0,0 +1,42 @@ +#!/bin/bash + +## Build framework distributable + +# Setup variables +. admin/release-config +TARGET=dist/framework + +echo -e "${BOLD}Build the framework distributable${NORMAL}" + +echo -e "${BOLD}Copy the main files/folders...${NORMAL}" +releasable='application docs public system writable README.md composer.json contributing.md env license.txt spark' +for fff in $releasable + if [ -d $fff ]; then + rm -rf ${TARGET}/$fff + cp -rf $fff ${TARGET}/ + else + rm ${TARGET}/$fff + cp -f $fff ${TARGET}/ + fi +done + +echo -e "${BOLD}Override as needed...${NORMAL}" +cp -rf admin/framework/* ${TARGET}/ + +# add the docs +rm -rf ${TARGET}/docs +cp -rf user_guide_src/build/html ${TARGET}/docs + +#--------------------------------------------------- +# And finally, get ready for merging +cd $TARGET +git add . +git commit -S -m "Release ${RELEASE}" +git checkout master +git merge $branch + +cd $CI_DIR + +#--------------------------------------------------- +# Done for now +echo -e "${BOLD}Distributable framework ready..${NORMAL}" diff --git a/admin/release-notes.bb b/admin/release-notes.bb index 5bc9eed90c31..2e1928602715 100644 --- a/admin/release-notes.bb +++ b/admin/release-notes.bb @@ -36,6 +36,6 @@ Do NOT create repo issues with support questions - we are using github for bug a Do NOT post support questions or feature requests in response to this thread - those will be deleted. We are trying to make the best of the -limited resousrces that we have! +limited resources that we have! Thank you, and ENJOY! \ No newline at end of file diff --git a/admin/release-revert b/admin/release-revert new file mode 100644 index 000000000000..1c8a4eacd504 --- /dev/null +++ b/admin/release-revert @@ -0,0 +1,26 @@ +#!/bin/bash + +## Revert local repos to pre-release state +echo -e "${BOLD}${COLOR}CodeIgniter4 release revert${NORMAL}" +echo '---------------------------' + +if [ $# -lt 2 ]; then + echo "You forgot the magic word" + exit 1 +fi +if [ $1 != 'please' ]; then + echo "What do you say?" + exit 1 +fi + +. admin/release-config + +echo -e "${BOLD}Reverting the main repository${NORMAL}" +git checkout master +git pull -f ${CI_ORG}/CodeIgniter4 master +git checkout develop +git pull -f${CI_ORG}/CodeIgniter4 develop + +#--------------------------------------------------- +# Phew! +echo -e "${BOLD}Congratulations - we have aborted liftoff${NORMAL}" diff --git a/admin/release-userguide b/admin/release-userguide new file mode 100644 index 000000000000..831dbccdeb11 --- /dev/null +++ b/admin/release-userguide @@ -0,0 +1,39 @@ +#!/bin/bash + +## Build user guide distributable + +# Setup variables +. admin/release-config +TARGET=dist/userguide + +echo -e "${BOLD}Build the user guide distributable${NORMAL}" + +echo -e "${BOLD}Copy the main files/folders...${NORMAL}" +releasable='application public writable README.md contributing.md env license.txt spark' +for fff in $releasable + if [ -d $fff ]; then + rm -rf ${TARGET}/$fff + cp -rf $fff ${TARGET}/ + else + rm ${TARGET}/$fff + cp -f $fff ${TARGET}/ + fi +done + +echo -e "${BOLD}Override as needed...${NORMAL}" +cp -rf admin/appstarter/* ${TARGET}/ +cp -rf user_guide_src/build/html ${TARGET}/docs + +#--------------------------------------------------- +# And finally, get ready for merging +cd $TARGET +git add . +git commit -S -m "Release ${RELEASE}" +git checkout master +git merge $branch + +cd $CI_DIR + +#--------------------------------------------------- +# Done for now +echo -e "${BOLD}Distributable user guide ready..${NORMAL}" diff --git a/admin/starter/composer.json b/admin/starter/composer.json new file mode 100644 index 000000000000..a1263f38004b --- /dev/null +++ b/admin/starter/composer.json @@ -0,0 +1,36 @@ +{ + "name": "codeigniter4/appstarter", + "type": "project", + "description": "CodeIgniter4 starter app", + "homepage": "https://codeigniter.com", + "license": "MIT", + "require": { + "php": ">=7.1", + "ext-curl": "*", + "ext-intl": "*", + "kint-php/kint": "^2.1", + "zendframework/zend-escaper": "^2.5" + }, + "require-dev": { + "mikey179/vfsStream": "1.6.*", + "phpunit/phpunit": "^7.0", + "squizlabs/php_codesniffer": "^3.3" + }, + "autoload": { + "psr-4": { + "CodeIgniter\\": "system/", + "Psr\\Log\\": "system/ThirdParty/PSR/Log/" + } + }, + "scripts": { + "post-update-cmd": [ + "composer dump-autoload", + "CodeIgniter\\ComposerScripts::postUpdate" + ] + }, + "support": { + "forum": "http://forum.codeigniter.com/", + "source": "https://github.com/codeigniter4/CodeIgniter4", + "slack": "https://codeigniterchat.slack.com" + } +} diff --git a/admin/workflow.md b/admin/workflow.md index 90a71a97f8be..e90eefef6bec 100644 --- a/admin/workflow.md +++ b/admin/workflow.md @@ -5,38 +5,22 @@ There might be other feature branches, but they are not relevant to this process Once "develop" is ready for a new release, the general workflow is to -pre-release... +release prep (`admin/release `)... - create a "release" branch from develop - update version dependencies or constants - generate version(s) of the user guide - move or ignore stuff, distinguishing release from development - test that all is as it should be +- merge the release branch into "master" & "develop" +- prepare the distribution repos -release... -- merge the release branch into "master" -- update the distribution repos -- **manually** create the releases & tag them on github, based on master - -post-release... -- eliminate the build & dist folders used above -- setup substitution variables for the next release -- merge the post-release branch into "master" -- merge the post-release branch into "develop" -- **manually** delete the release branches in the repo +After these have been vetted ... +- push the release to github (`admin/deploy please`) +- **manually** create the releases & tag them on github, based on master + Include any supplementary binaries as part of releases. - **manually** post a sticky announcement thread on the forum - **manually** tweet the release announcement - - This would be manually merged to the `master` and `develop` branches. - Creating a release is done on github.com manually, so that additional - binaries can be added to the release if appropriate. - -Visually: - - develop -> release -> master - post-release -> master - post->release -> develop - ## Assumptions You (a maintainer) have forked the main CodeIgniter4 repo, @@ -57,11 +41,10 @@ as part of a bug fix minor release. Inside a shell prompt, in the project root: - `admin/pre-release version [qualifier]` + `admin/release version [qualifier]` -Nothing is pushed to the repo at this point - -the results are left inside -the release branch in your local clone. +Nothing is pushed to the repo at this point. You have a chance to vet +the repository changes. The "version" should follow semantic versioning, e.g. `4.0.6`, and the version number should be higher than the current released one. @@ -70,22 +53,18 @@ The "qualifier" argument is a suffix to add to the version for a pre-release, e.g. `beta.2` or `rc.41`. Examples: -- `admin/pre-release 4.0.0 alpha.1` would prepare the "4.0.0-alpha.1" pre-release PR -- `admin/pre-release 4.0.0` would prepare the "4.0.0" release PR -- `admin/pre-release peanut butter banana` would complain and tell you to read these directions +- `admin/release 4.0.0 alpha.1` would prepare the "4.0.0-alpha.1" pre-release PR +- `admin/release 4.0.0` would prepare the "4.0.0" release PR +- `admin/release peanut butter banana` would complain and tell you to read these directions Once you have vetted the `dist` folder inside your local repo, you can merge & push everything with - `admin/release` + `admin/release-deploy please` On github.com, create an appropriate release (or pre-release), with any optional files from the root of `dist`. -Once the github releases are done, clean up with: - - `admin/post_release` - ## Release notes On launch of a new release, a release notes post should be made in the @@ -99,4 +78,3 @@ i.e. someone with commit rights on the CI4 repositories. You will be prompted for your github credentials and GPG-signing key as appropriate. - diff --git a/composer.json b/composer.json index d51327b88d76..6748f1c12e82 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "codeigniter4/framework", + "name": "codeigniter4/codeigniter4", "type": "project", "description": "The CodeIgniter framework v4", "homepage": "https://codeigniter.com", From a61c7fd9cd3cca7f77e5f1ffab769a35fd430a35 Mon Sep 17 00:00:00 2001 From: Jim Parry Date: Wed, 28 Nov 2018 21:45:38 -0800 Subject: [PATCH 4/9] Tease apart the release scripts --- README.md | 2 +- .../user_guide_src/source/changelogs/next.rst | 16 ---- admin/framework/README.md | 69 ++++++++++++++ admin/framework/phpunit.xml.dist | 28 ++++++ admin/release | 13 +++ admin/release-appstarter | 6 ++ admin/release-framework | 5 +- admin/release-userguide | 18 +--- admin/starter/README.md | 51 +++++++++++ admin/starter/composer.json | 15 ++-- user_guide_src/source/changelogs/index.rst | 11 ++- user_guide_src/source/changelogs/next.rst | 90 +++++++++++++------ 12 files changed, 253 insertions(+), 71 deletions(-) delete mode 100644 admin/codeigniter4/user_guide_src/source/changelogs/next.rst create mode 100644 admin/framework/README.md create mode 100644 admin/framework/phpunit.xml.dist create mode 100644 admin/starter/README.md diff --git a/README.md b/README.md index 58fdca29e60d..c900a5205bef 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ CodeIgniter is a PHP full-stack web framework that is light, fast, flexible, and secure. More information can be found at the [official site](http://codeigniter.com). -This repository holds the pre-alpha code for CodeIgniter 4 only. +This repository holds the alpha code for CodeIgniter 4 only. Version 4 is a complete rewrite to bring the quality and the code into a more modern version, while still keeping as many of the things intact that has made people love the framework over the years. diff --git a/admin/codeigniter4/user_guide_src/source/changelogs/next.rst b/admin/codeigniter4/user_guide_src/source/changelogs/next.rst deleted file mode 100644 index b8691312bef4..000000000000 --- a/admin/codeigniter4/user_guide_src/source/changelogs/next.rst +++ /dev/null @@ -1,16 +0,0 @@ -########### -Change Logs -########### - -Version |version| -==================================================== - -Release Date: Not Released - -**Next release of CodeIgniter4** - -The list of changed files follows, with PR numbers shown. - -PRs merged: ------------ - diff --git a/admin/framework/README.md b/admin/framework/README.md new file mode 100644 index 000000000000..559185645ec9 --- /dev/null +++ b/admin/framework/README.md @@ -0,0 +1,69 @@ +# CodeIgniter 4 Framework + +## What is CodeIgniter? +CodeIgniter is a PHP full-stack web framework that is light, fast, flexible, and secure. +More information can be found at the [official site](http://codeigniter.com). + +This repository holds the distributable version of the framework, +including the user guide. It has been built from the +[development repository](https://github.com/codeigniter4/CodeIgniter4). + +**This is pre-release code and should not be used in production sites.** + +More information about the plans for version 4 can be found in [the announcement](http://forum.codeigniter.com/thread-62615.html) on the forums. + +The user guide corresponding to this version of the framework can be found +[here](https://codeigniter4.github.io/userguide/). + + +## Important Change with index.php + +`index.php` is no longer in the root of the project! It has been moved inside the *public* folder, +for better security and separation of components. + +This means that you should configure your web server to "point" to your project's *public* folder, and +not to the project root. A better practice would be to configure a virtual host to point there. A poor practice would be to point your web server to the project root and expect to enter *public/...*, as the rest of your logic and the +framework are exposed. + +**Please** read the user guide for a better explanation of how CI4 works! +The user guide updating and deployment is a bit awkward at the moment, but we are working on it! + +## Repository Management +We use Github issues to track **BUGS** and to track approved **DEVELOPMENT** work packages. +We use our [forum](http://forum.codeigniter.com) to provide SUPPORT and to discuss +FEATURE REQUESTS. + +If you raise an issue here that pertains to support or a feature request, it will +be closed! If you are not sure if you have found a bug, raise a thread on the forum first - +someone else may have encountered the same thing. + +Before raising a new Github issue, please check that your bug hasn't already +been reported or fixed. + +We use pull requests (PRs) for CONTRIBUTIONS to the repository. +We are looking for contributions that address one of the reported bugs or +approved work packages. + +Do not use a PR as a form of feature request. +Unsolicited contributions will only be considered if they fit nicely +into the framework roadmap. +Remember that some components that were part of CodeIgniter 3 are being moved +to optional packages, with their own repository. + +## Contributing +We welcome contributions from the community. + +Please read the [*Contributing to CodeIgniter*](https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing.md) section in the development repository. + +## Server Requirements +PHP version 7.1 or higher is required, with the following extensions installed: + +- [intl](http://php.net/manual/en/intl.requirements.php) +- [libcurl](http://php.net/manual/en/curl.requirements.php) if you plan to use the HTTP\CURLRequest library + +Additionally, make sure that the following extensions are enabled in your PHP: + +- json (enabled by default - don't turn it off) +- [mbstring](http://php.net/manual/en/mbstring.installation.php) +- [mysqlnd](http://php.net/manual/en/mysqlnd.install.php) +- xml (enabled by default - don't turn it off) diff --git a/admin/framework/phpunit.xml.dist b/admin/framework/phpunit.xml.dist new file mode 100644 index 000000000000..73d51ffc8dee --- /dev/null +++ b/admin/framework/phpunit.xml.dist @@ -0,0 +1,28 @@ + + + + + ./tests + ./tests/system + + + + + + ./system + + ./system + + + + + diff --git a/admin/release b/admin/release index c092c3267ccd..74afab6e057b 100755 --- a/admin/release +++ b/admin/release @@ -105,6 +105,19 @@ make epub cd ${CI_DIR} +# add changelog preamble +sed '5 i Version |version| +==================================================== + +Release Date: Not Released + +**Next release of CodeIgniter4** + + +:doc:`See all the changes. ` + +' ${TARGET}/user_guide_src/changelogs/index.rst + #--------------------------------------------------- # Build the distributables diff --git a/admin/release-appstarter b/admin/release-appstarter index 5cefb7821aa1..41362a990130 100644 --- a/admin/release-appstarter +++ b/admin/release-appstarter @@ -5,7 +5,9 @@ # Setup variables . admin/release-config TARGET=dist/appstarter +git checkout $branch +#--------------------------------------------------- echo -e "${BOLD}Build the framework distributable${NORMAL}" echo -e "${BOLD}Copy the main files/folders...${NORMAL}" @@ -23,8 +25,12 @@ done echo -e "${BOLD}Override as needed...${NORMAL}" cp -rf admin/starter/* ${TARGET}/ +echo -e "${BOLD}Fix paths...${NORMAL}" +sed -i "/public $systemDirectory = 'system';/s/'system'/'vendor/codeigniter4/framework/system'/" application/Config/Paths.php + #--------------------------------------------------- # And finally, get ready for merging +echo -e "${BOLD}Assemble the pieces...${NORMAL}" cd $TARGET git add . git commit -S -m "Release ${RELEASE}" diff --git a/admin/release-framework b/admin/release-framework index 29845c840f91..8ef709c1a0f2 100755 --- a/admin/release-framework +++ b/admin/release-framework @@ -5,7 +5,9 @@ # Setup variables . admin/release-config TARGET=dist/framework +git checkout $branch +#--------------------------------------------------- echo -e "${BOLD}Build the framework distributable${NORMAL}" echo -e "${BOLD}Copy the main files/folders...${NORMAL}" @@ -23,12 +25,13 @@ done echo -e "${BOLD}Override as needed...${NORMAL}" cp -rf admin/framework/* ${TARGET}/ -# add the docs +echo -e "${BOLD}Bundle the docs...${NORMAL}" rm -rf ${TARGET}/docs cp -rf user_guide_src/build/html ${TARGET}/docs #--------------------------------------------------- # And finally, get ready for merging +echo -e "${BOLD}Assemble the pieces...${NORMAL}" cd $TARGET git add . git commit -S -m "Release ${RELEASE}" diff --git a/admin/release-userguide b/admin/release-userguide index 831dbccdeb11..a8bd612cfc94 100644 --- a/admin/release-userguide +++ b/admin/release-userguide @@ -5,27 +5,17 @@ # Setup variables . admin/release-config TARGET=dist/userguide +git checkout $branch +#--------------------------------------------------- echo -e "${BOLD}Build the user guide distributable${NORMAL}" -echo -e "${BOLD}Copy the main files/folders...${NORMAL}" -releasable='application public writable README.md contributing.md env license.txt spark' -for fff in $releasable - if [ -d $fff ]; then - rm -rf ${TARGET}/$fff - cp -rf $fff ${TARGET}/ - else - rm ${TARGET}/$fff - cp -f $fff ${TARGET}/ - fi -done - -echo -e "${BOLD}Override as needed...${NORMAL}" -cp -rf admin/appstarter/* ${TARGET}/ cp -rf user_guide_src/build/html ${TARGET}/docs +cp -rf user_guide_src/build/epub/* ${TARGET}/ #--------------------------------------------------- # And finally, get ready for merging +echo -e "${BOLD}Assemble the pieces...${NORMAL}" cd $TARGET git add . git commit -S -m "Release ${RELEASE}" diff --git a/admin/starter/README.md b/admin/starter/README.md new file mode 100644 index 000000000000..01c75411c558 --- /dev/null +++ b/admin/starter/README.md @@ -0,0 +1,51 @@ +# CodeIgniter 4 Application Starter + +## What is CodeIgniter? +CodeIgniter is a PHP full-stack web framework that is light, fast, flexible, and secure. +More information can be found at the [official site](http://codeigniter.com). + +This repository holds a composer-installable app starter. +It has been built from the +[development repository](https://github.com/codeigniter4/CodeIgniter4). + +**This is pre-release code and should not be used in production sites.** + +More information about the plans for version 4 can be found in [the announcement](http://forum.codeigniter.com/thread-62615.html) on the forums. + +The user guide corresponding to this version of the framework can be found +[here](https://codeigniter4.github.io/userguide/). + +##Installation & updates + +`composer create-project codeigniter4/appstarter` then `composer update` whenever +there is a new release of the framework. + +##Setup + +Copy `env` to `.env` and tailor for your app, specifically the baseURL +and any database settings. + +## Important Change with index.php + +`index.php` is no longer in the root of the project! It has been moved inside the *public* folder, +for better security and separation of components. + +This means that you should configure your web server to "point" to your project's *public* folder, and +not to the project root. A better practice would be to configure a virtual host to point there. A poor practice would be to point your web server to the project root and expect to enter *public/...*, as the rest of your logic and the +framework are exposed. + +**Please** read the user guide for a better explanation of how CI4 works! +The user guide updating and deployment is a bit awkward at the moment, but we are working on it! + +## Server Requirements +PHP version 7.1 or higher is required, with the following extensions installed: + +- [intl](http://php.net/manual/en/intl.requirements.php) +- [libcurl](http://php.net/manual/en/curl.requirements.php) if you plan to use the HTTP\CURLRequest library + +Additionally, make sure that the following extensions are enabled in your PHP: + +- json (enabled by default - don't turn it off) +- [mbstring](http://php.net/manual/en/mbstring.installation.php) +- [mysqlnd](http://php.net/manual/en/mysqlnd.install.php) +- xml (enabled by default - don't turn it off) diff --git a/admin/starter/composer.json b/admin/starter/composer.json index a1263f38004b..4f250a3812a3 100644 --- a/admin/starter/composer.json +++ b/admin/starter/composer.json @@ -6,26 +6,25 @@ "license": "MIT", "require": { "php": ">=7.1", - "ext-curl": "*", + "codeigniter4/framework": "^4", + "ext-curl": "*", "ext-intl": "*", "kint-php/kint": "^2.1", "zendframework/zend-escaper": "^2.5" }, "require-dev": { - "mikey179/vfsStream": "1.6.*", - "phpunit/phpunit": "^7.0", - "squizlabs/php_codesniffer": "^3.3" + "mikey179/vfsStream": "1.6.*", + "phpunit/phpunit": "^7.0" }, "autoload": { "psr-4": { - "CodeIgniter\\": "system/", - "Psr\\Log\\": "system/ThirdParty/PSR/Log/" + "CodeIgniter\\": "vendor/codeigniter4/framework/system/", + "Psr\\Log\\": "vendor/codeigniter4/framework/system/ThirdParty/PSR/Log/" } }, "scripts": { "post-update-cmd": [ - "composer dump-autoload", - "CodeIgniter\\ComposerScripts::postUpdate" + "composer dump-autoload" ] }, "support": { diff --git a/user_guide_src/source/changelogs/index.rst b/user_guide_src/source/changelogs/index.rst index 914da4fb7768..62270ba87783 100644 --- a/user_guide_src/source/changelogs/index.rst +++ b/user_guide_src/source/changelogs/index.rst @@ -11,12 +11,15 @@ Release Date: Not Released - Numerous bug fixes - Many missing features implemented +- Code coverage is up to 72% - CodeIgniter4 has been promoted to its own github organization. -That is reflected in docs and comments. + 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. + 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 proved passionate, dedicated and thorough :) :doc:`See all the changes. ` diff --git a/user_guide_src/source/changelogs/next.rst b/user_guide_src/source/changelogs/next.rst index 7bc0d6b13fc6..af33a368ebdc 100644 --- a/user_guide_src/source/changelogs/next.rst +++ b/user_guide_src/source/changelogs/next.rst @@ -9,7 +9,7 @@ Release Date: Not Released The list of changed files follows, with PR numbers shown. - admin/ - - post_release #1484 + - release* #1484, - pre-commit #1388 - setup.sh #1388 @@ -17,6 +17,7 @@ The list of changed files follows, with PR numbers shown. - Config/ - Autoload #1396, #1416 - Mimes #1368, #1465 + - Pager #622 - Services #1469 - Filters/Honeypot #1376 - Views/ @@ -27,7 +28,11 @@ The list of changed files follows, with PR numbers shown. - index.php #1388 - system / + - Autoloader/ + - Autoloader #1547 + - FileLocator #1547, #1550 - Cache/Handlers/ + - FileHandler #1547 - MemcachedHandler #1383 - CLI/ - CLI #1432, #1489 @@ -46,60 +51,73 @@ The list of changed files follows, with PR numbers shown. - Mimes #1453 - Services #1180, #1469 - Database/ - - BaseBuilder #1335, #1491 - - BaseConnection #1335, #1407, #1491 + - BaseBuilder #1335, #1491, #1522 + - BaseConnection #1335, #1407, #1491, #1522 - BaseResult #1426 - Config #1465, #1469 - - Forge #1343, #1449, #1470 + - Forge #1343, #1449, #1470, #1530 - MigrationRunner #1371 - MySQLi/Connection #1335, #1449 - - MySQLi/Forge #1343, #1344 + - MySQLi/Forge #1343, #1344, #1530 + - MySQLi/Result #1530 - Postgre/Connection #1335, #1449 + - Postgre/Forge #1530 - SQLite3/Connection #1335, #1449 - - SQLite3/Forge #1470 + - SQLite3/Forge #1470, #1547 - Debug - Exceptions #1500 - - Toolbar #1370, #1465, #1469 + - Toolbar #1370, #1465, #1469, #1547 - Toolbar/Views/toolbar.tpl #1469 - Email/ - - Email #1389, #1413, #1438, #1454, #1465, #1469 + - Email #1389, #1413, #1438, #1454, #1465, #1469, #1547 - Events/ - - Events #1465, #1469 + - Events #1465, #1469, #1547 - Files/ - - File #1399 + - 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 + - Files/UploadedFile #1335, #1399, #1500, #1506, #1547 - IncomingRequest #1445, #1469, #1496 + - Message #1497 - RedirectResponse #1387, #1451, #1464 - - Response #1456, #1472, #1477, #1486, #1504, #1505 + - Response #1456, #1472, #1477, #1486, #1504, #1505, #1497, #622 - ResponseInterface #1384 - UploadedFile #1368, #1456 - URI #1213, #1469, #1508 + - Images/Handlers/ + - ImageMagickHandler #1546 - Language/ - en/Database #1335 - en/Filters #1378 - en/Migrations #1374 - Language #1480, #1489 + - Log/ + - Handlers/FileHandler #1547 - Pager/ - - Pager #1213 - - PagerRenderer #1213 + - 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 + - Router #1523, #1547 - Session/Handlers/ - BaseHandler #1180, #1483 - DatabaseHandler #1180 - - FileHandler #1180 + - FileHandler #1180, #1547 - MemcachedHandler #1180 - RedisHandler #1180 - Test/ @@ -107,17 +125,18 @@ The list of changed files follows, with PR numbers shown. - FeatureTestCase #1427, #1468 - Filters/CITestStreamFilter #1465 - Validation / - - CreditCardRules #1447 + - CreditCardRules #1447, #1529 - FormatRules #1507 - Rules #1345 - Validation #1345 - View/ - Filters #1469 - - Parser #1417 - - View #1357, #1377, #1410 - - CodeIgniter #1465, #1505, #1523, 2047b5a + - Parser #1417, #1547 + - View #1357, #1377, #1410, #1547 + - bootstrao #1547 + - CodeIgniter #1465, #1505, #1523, 2047b5a, #1547 - Common #1486, #1496, #1504, #1513 - - ComposerScripts #1469 + - ComposerScripts #1469, #1547 - Controller #1423 - Entity #1369, #1373 - Model #1345, #1380, #1373, #1440 @@ -127,6 +146,7 @@ The list of changed files follows, with PR numbers shown. - HTTP/MockResponse #1456 - _bootstrap.php #1397, #1443 - Cache/Handlers/ + - FileHandlerTest #1547 - MemcachedHandlerTest #1180, #1383 - RedisHandlerTest #1180, #1481 - CLI/ @@ -136,6 +156,7 @@ The list of changed files follows, with PR numbers shown. - Database/Live/ - ForgeTest #1449, #1470 - HTTP/ + - CURLRequestTest#1498 - Files/FileCOllectionTest #1506 - Files/FileMovingTest #1424 - DownloadResponseTest #1375 @@ -143,7 +164,7 @@ The list of changed files follows, with PR numbers shown. - RedirectResponseTest #1387, #1456 - ResponseCookieTest #1472, #1509 - ResponseSendTest #1477, #1486, #1509 - - ResponseTest #1375, #1456, #1472, #1486 + - ResponseTest #1375, #1456, #1472, #1486, #622 - URITest #1456, #1495 - Helpers/ - DateHelperTest #1479 @@ -154,7 +175,8 @@ The list of changed files follows, with PR numbers shown. - Log/ - FileHandlerTest #1425 - Pager/ - - PagerRendererTest #1213 + - PagerRendererTest #1213, #622 + - PagerTest #622 - Router/ - RouteCollectionTest #1438, #1524 - RouterTest #1438, #1523 @@ -178,6 +200,8 @@ The list of changed files follows, with PR numbers shown. - user_guide_src /source/ - changelogs/ #1385, #1490 - concepts/ + - autoloader #1547 + - security #1540 - services #1469 - structure #1448 - database/ @@ -194,18 +218,19 @@ The list of changed files follows, with PR numbers shown. - index #1388 - libraries/ - pagination #1213 - - validation #27868b + - validation #27868b, #1540 - models/ - - entities #1518 + - entities #1518, #1540 - outgoing/ - response #1472, #1494 - testing/ - overview #1467 - tutorial/ - create_news_item #1442 + - static_pages #1547 - / - - composer.json #1388, #1418 + - composer.json #1388, #1418, #1536 - README.md - spark 2047b5a - .travis.yml #1394 @@ -213,9 +238,18 @@ The list of changed files follows, with PR numbers shown. PRs merged: ----------- +- #1550 remove commented CLI::newLine($tempFiles) at FileLocator +- #1549 use .gitkeep instead of .gitignore in Database/Seeds directory +- #1547 Change file exists to is file +- #1546 ImageMagickHandler::__construct ... +- #1540 Update validation class User Guide +- #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 - #1524 Test routes resource with 'websafe' option - #1523 Check if the matched route regex is filtered +- #1522 add property_exists check on BaseBuilder - #1521 .gitignore clean up - #1518 Small typo: changed setCreatedOn to setCreatedAt - #1517 move .htaccess from per-directory in writable/{directory} to writable/ @@ -229,6 +263,8 @@ PRs merged: - #1504 Revert RedirectResponse changes - #1500 Ignoring errors suppressed by @ - #1499 Fix form_helper's set_value writeup +- #1498 Add CURLRequest helper methods +- #1497 Remove unused RedirectException - #1496 Fix Common::old() - #1495 Add URI segment test - #1494 Method naming in user guide @@ -328,4 +364,4 @@ PRs merged: - #1335 Review and improvements in databases 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 From 8dec1767fa391bb0b95cc23055fdb4b66a4ad26b Mon Sep 17 00:00:00 2001 From: Jim Parry Date: Wed, 28 Nov 2018 22:00:06 -0800 Subject: [PATCH 5/9] Scripts need to be executable --- admin/release-appstarter | 0 admin/release-config | 1 + admin/release-deploy | 0 admin/release-notes.bb | 0 admin/release-revert | 0 admin/release-userguide | 0 6 files changed, 1 insertion(+) mode change 100644 => 100755 admin/release-appstarter mode change 100644 => 100755 admin/release-config mode change 100644 => 100755 admin/release-deploy mode change 100644 => 100755 admin/release-notes.bb mode change 100644 => 100755 admin/release-revert mode change 100644 => 100755 admin/release-userguide diff --git a/admin/release-appstarter b/admin/release-appstarter old mode 100644 new mode 100755 diff --git a/admin/release-config b/admin/release-config old mode 100644 new mode 100755 index 8ff1f746be4e..7a4bf7671d4a --- a/admin/release-config +++ b/admin/release-config @@ -1,6 +1,7 @@ # Variables used for release building if [ "$CI_ORG" ]; then + ; else # Initialize variables diff --git a/admin/release-deploy b/admin/release-deploy old mode 100644 new mode 100755 diff --git a/admin/release-notes.bb b/admin/release-notes.bb old mode 100644 new mode 100755 diff --git a/admin/release-revert b/admin/release-revert old mode 100644 new mode 100755 diff --git a/admin/release-userguide b/admin/release-userguide old mode 100644 new mode 100755 From 3bd01faba13733c2744188aa21e22c1eeb12e1c6 Mon Sep 17 00:00:00 2001 From: Jim Parry Date: Wed, 28 Nov 2018 22:09:14 -0800 Subject: [PATCH 6/9] Fix init block --- admin/release-config | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/admin/release-config b/admin/release-config index 7a4bf7671d4a..f6d118c4afa4 100755 --- a/admin/release-config +++ b/admin/release-config @@ -1,8 +1,6 @@ # Variables used for release building -if [ "$CI_ORG" ]; then - ; -else +if [ -z "$CI_ORG" ]; then # Initialize variables CI_ORG=https://github.com/codeigniter4 From f0ff1e4c3e67d78e105a25cdba75a889bcb59b4a Mon Sep 17 00:00:00 2001 From: Jim Parry Date: Thu, 29 Nov 2018 00:36:57 -0800 Subject: [PATCH 7/9] Tweaks from testing --- admin/README.md | 6 +++-- admin/release | 29 ++++++++++++----------- admin/release-appstarter | 15 +++++------- admin/release-config | 2 +- admin/release-deploy | 10 -------- admin/release-framework | 19 +++++++-------- admin/release-userguide | 6 ++--- admin/workflow.md | 2 +- user_guide_src/source/changelogs/next.rst | 3 ++- 9 files changed, 40 insertions(+), 52 deletions(-) mode change 100755 => 100644 admin/release-appstarter mode change 100755 => 100644 admin/release-config mode change 100755 => 100644 admin/release-framework mode change 100755 => 100644 admin/release-userguide diff --git a/admin/README.md b/admin/README.md index b830e650876f..242793acac61 100644 --- a/admin/README.md +++ b/admin/README.md @@ -62,7 +62,8 @@ scripts used by the release manager: moving or ignoring stuff, distinguishing release from development. If successful, it will update the `config` file, with the version number in it, and it will run the related scripts following, to revise - the release distributions. + the release distributions. + Usage: `admin/release version qualifier` - **release-framework** builds the distributable framework repo. It could be used on its own, but is normally part of `release`. - **release-appstarter** builds the distributable appstarter repo. @@ -70,7 +71,8 @@ scripts used by the release manager: - **release-userguide** builds the distributable userguide repo. It could be used on its own, but is normally part of `release`. - **release-deploy** pushes the release changes to the appropriate github - repositories. Tag & create releases on github. This is not easily reversible! + repositories. Tag & create releases on github. This is not easily reversible! + Usage: `admin/release-deploy version qualifier` - **release-revert** can be used to restore your repositories to the state they were in before you started a release. **IF** you haven't deployed. This is in case you decide not to proceed with the release, for any reason. diff --git a/admin/release b/admin/release index 74afab6e057b..39a32550bced 100755 --- a/admin/release +++ b/admin/release @@ -53,6 +53,7 @@ sed -i "/release =/s/'.*'/'${RELEASE}'/" user_guide_src/source/conf.py # version & date in user_guide_src/source/index.rst sed -i "/|release|/s/|.*|/${RELEASE}/" user_guide_src/source/changelogs/index.rst sed -i "/Release Date/s/Not Released/$(date +'%B %d, %Y')/" user_guide_src/source/changelogs/index.rst +sed -i "/|version|/s/|version|/${RELEASE}/" user_guide_src/source/changelogs/index.rst # version & date in user_guide_src/source/next.rst sed -i "/|release|/s/|.*|/${RELEASE}/" user_guide_src/source/changelogs/next.rst @@ -106,24 +107,24 @@ make epub cd ${CI_DIR} # add changelog preamble -sed '5 i Version |version| -==================================================== - -Release Date: Not Released - -**Next release of CodeIgniter4** - - -:doc:`See all the changes. ` - -' ${TARGET}/user_guide_src/changelogs/index.rst +file=user_guide_src/source/changelogs/index.rst +sed -i "4 a Version |version|" $file +sed -i "5 a ====================================================" $file +sed -i "6 G" $file +sed -i "7 a Release Date: Not Released" $file +sed -i "8 G" $file +sed -i "9 a **Next release of CodeIgniter4**" $file +sed -i "10 G" $file +sed -i "11 G" $file +sed -i "12 a :doc:\`See all the changes. \`" $file +sed -i "13 G" $file #--------------------------------------------------- # Build the distributables -. release-framework -. release-userguide -. release-appstarter +. admin/release-framework +. admin/release-userguide +. admin/release-appstarter #--------------------------------------------------- # Done for now diff --git a/admin/release-appstarter b/admin/release-appstarter old mode 100755 new mode 100644 index 41362a990130..7e72c0797869 --- a/admin/release-appstarter +++ b/admin/release-appstarter @@ -5,6 +5,7 @@ # Setup variables . admin/release-config TARGET=dist/appstarter +cd $TARGET git checkout $branch #--------------------------------------------------- @@ -12,18 +13,15 @@ echo -e "${BOLD}Build the framework distributable${NORMAL}" echo -e "${BOLD}Copy the main files/folders...${NORMAL}" releasable='application public writable README.md contributing.md env license.txt spark' -for fff in $releasable - if [ -d $fff ]; then - rm -rf ${TARGET}/$fff - cp -rf $fff ${TARGET}/ - else - rm ${TARGET}/$fff - cp -f $fff ${TARGET}/ +for fff in $releasable ; do + if [ -d "$fff" ] ; then + rm -rf $fff fi + cp -rf ${CI_DIR}/$fff . done echo -e "${BOLD}Override as needed...${NORMAL}" -cp -rf admin/starter/* ${TARGET}/ +cp -rf ${CI_DIR}/admin/starter/* . echo -e "${BOLD}Fix paths...${NORMAL}" sed -i "/public $systemDirectory = 'system';/s/'system'/'vendor/codeigniter4/framework/system'/" application/Config/Paths.php @@ -31,7 +29,6 @@ sed -i "/public $systemDirectory = 'system';/s/'system'/'vendor/codeigniter4/fra #--------------------------------------------------- # And finally, get ready for merging echo -e "${BOLD}Assemble the pieces...${NORMAL}" -cd $TARGET git add . git commit -S -m "Release ${RELEASE}" git checkout master diff --git a/admin/release-config b/admin/release-config old mode 100755 new mode 100644 index f6d118c4afa4..8a969af81c68 --- a/admin/release-config +++ b/admin/release-config @@ -23,4 +23,4 @@ if [ -z "$CI_ORG" ]; then RELEASE=$version$qualifier branch="release-$RELEASE" -fi \ No newline at end of file +fi diff --git a/admin/release-deploy b/admin/release-deploy index 8c65278c20d5..f4fc8fd51974 100755 --- a/admin/release-deploy +++ b/admin/release-deploy @@ -5,16 +5,6 @@ echo -e "${BOLD}${COLOR}CodeIgniter4 release deployment${NORMAL}" echo '-------------------------------' -# Check for politeness, to avoid inadvertent deployment -if [ $# -lt 2 ]; then - echo "You forgot the magic word" - exit 1 -fi -if [ $1 != 'please' ]; then - echo "What do you say?" - exit 1 -fi - . admin/release-config echo -e "${BOLD}Merge release into master${NORMAL}" diff --git a/admin/release-framework b/admin/release-framework old mode 100755 new mode 100644 index 8ef709c1a0f2..5a3a185a5cc9 --- a/admin/release-framework +++ b/admin/release-framework @@ -5,6 +5,7 @@ # Setup variables . admin/release-config TARGET=dist/framework +cd $TARGET git checkout $branch #--------------------------------------------------- @@ -12,27 +13,23 @@ echo -e "${BOLD}Build the framework distributable${NORMAL}" echo -e "${BOLD}Copy the main files/folders...${NORMAL}" releasable='application docs public system writable README.md composer.json contributing.md env license.txt spark' -for fff in $releasable - if [ -d $fff ]; then - rm -rf ${TARGET}/$fff - cp -rf $fff ${TARGET}/ - else - rm ${TARGET}/$fff - cp -f $fff ${TARGET}/ +for fff in $releasable ; do + if [ -d "$fff" ] ; then + rm -rf $fff fi + cp -rf ${CI_DIR}/$fff . done echo -e "${BOLD}Override as needed...${NORMAL}" -cp -rf admin/framework/* ${TARGET}/ +cp -rf ${CI_DIR}/admin/framework/* . echo -e "${BOLD}Bundle the docs...${NORMAL}" -rm -rf ${TARGET}/docs -cp -rf user_guide_src/build/html ${TARGET}/docs +rm -rf docs +cp -rf ${CI_DIR}/user_guide_src/build/html ./docs #--------------------------------------------------- # And finally, get ready for merging echo -e "${BOLD}Assemble the pieces...${NORMAL}" -cd $TARGET git add . git commit -S -m "Release ${RELEASE}" git checkout master diff --git a/admin/release-userguide b/admin/release-userguide old mode 100755 new mode 100644 index a8bd612cfc94..6a8beb7bcbaf --- a/admin/release-userguide +++ b/admin/release-userguide @@ -5,18 +5,18 @@ # Setup variables . admin/release-config TARGET=dist/userguide +cd $TARGET git checkout $branch #--------------------------------------------------- echo -e "${BOLD}Build the user guide distributable${NORMAL}" -cp -rf user_guide_src/build/html ${TARGET}/docs -cp -rf user_guide_src/build/epub/* ${TARGET}/ +cp -rf ${CI_DIR}/user_guide_src/build/html/* docs +cp -rf ${CI_DIR}/user_guide_src/build/epub/CodeIgniter4.epub ./CodeIgniter${RELEASE}.epub #--------------------------------------------------- # And finally, get ready for merging echo -e "${BOLD}Assemble the pieces...${NORMAL}" -cd $TARGET git add . git commit -S -m "Release ${RELEASE}" git checkout master diff --git a/admin/workflow.md b/admin/workflow.md index e90eefef6bec..825a9c5d67f6 100644 --- a/admin/workflow.md +++ b/admin/workflow.md @@ -15,7 +15,7 @@ release prep (`admin/release `)... - prepare the distribution repos After these have been vetted ... -- push the release to github (`admin/deploy please`) +- push the release(s) to github (`admin/release-deploy `) - **manually** create the releases & tag them on github, based on master Include any supplementary binaries as part of releases. - **manually** post a sticky announcement thread on the forum diff --git a/user_guide_src/source/changelogs/next.rst b/user_guide_src/source/changelogs/next.rst index af33a368ebdc..4dfc9e7d0e75 100644 --- a/user_guide_src/source/changelogs/next.rst +++ b/user_guide_src/source/changelogs/next.rst @@ -25,7 +25,7 @@ The list of changed files follows, with PR numbers shown. - form.php removed #1442 - public / - - index.php #1388 + - index.php #1388, #1457 - system / - Autoloader/ @@ -294,6 +294,7 @@ PRs merged: - #1463 Fix the remaining bcit-ci references - #1461 Typo fix: donload -> download - #1460 remove unneeded ternary check at HoneyPot +- #1457 use $paths->systemDirectory in public/index.php - #1456 Beef up HTTP URI & Response testing - #1455 un-ignore application/Database/Migrations directory - #1454 add missing break; in loop at Email::getEncoding() From ba69972602196e1a1ac1d7d0d32a83b4c5ef4beb Mon Sep 17 00:00:00 2001 From: Jim Parry Date: Fri, 30 Nov 2018 01:36:14 -0800 Subject: [PATCH 8/9] Revise download & install pages in UG --- user_guide_src/source/changelogs/index.rst | 14 +- user_guide_src/source/changelogs/next.rst | 11 +- .../source/installation/downloads.rst | 53 +++++- user_guide_src/source/installation/index.rst | 73 +------- .../source/installation/installing.rst | 174 ++++++++++++++++++ .../source/installation/local_server.rst | 32 ---- .../source/installation/running.rst | 98 ++++++++++ .../source/installation/upgrade_4xx.rst | 8 +- 8 files changed, 340 insertions(+), 123 deletions(-) create mode 100644 user_guide_src/source/installation/installing.rst delete mode 100644 user_guide_src/source/installation/local_server.rst create mode 100644 user_guide_src/source/installation/running.rst diff --git a/user_guide_src/source/changelogs/index.rst b/user_guide_src/source/changelogs/index.rst index 62270ba87783..aacd16d96580 100644 --- a/user_guide_src/source/changelogs/index.rst +++ b/user_guide_src/source/changelogs/index.rst @@ -9,17 +9,17 @@ Release Date: Not Released **Next alpha release of CodeIgniter4** -- Numerous bug fixes -- Many missing features implemented +- 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. + 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. + 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 proved passionate, dedicated and thorough :) + He has proven to be passionate, dedicated and thorough :) :doc:`See all the changes. ` diff --git a/user_guide_src/source/changelogs/next.rst b/user_guide_src/source/changelogs/next.rst index 4dfc9e7d0e75..7a88554f58be 100644 --- a/user_guide_src/source/changelogs/next.rst +++ b/user_guide_src/source/changelogs/next.rst @@ -9,8 +9,12 @@ Release Date: Not Released 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 - application / @@ -198,7 +202,7 @@ The list of changed files follows, with PR numbers shown. - CommonFunctionsTest #1180, #1486, #1496 - user_guide_src /source/ - - changelogs/ #1385, #1490 + - changelogs/ #1385, #1490, #1553 - concepts/ - autoloader #1547 - security #1540 @@ -230,14 +234,15 @@ The list of changed files follows, with PR numbers shown. - static_pages #1547 - / - - composer.json #1388, #1418, #1536 - - README.md + - composer.json #1388, #1418, #1536, #1553 + - README.md #1553 - spark 2047b5a - .travis.yml #1394 PRs merged: ----------- +- #1553 Admin/scripts - #1550 remove commented CLI::newLine($tempFiles) at FileLocator - #1549 use .gitkeep instead of .gitignore in Database/Seeds directory - #1547 Change file exists to is file diff --git a/user_guide_src/source/installation/downloads.rst b/user_guide_src/source/installation/downloads.rst index 5399b30f8b37..cce40bce349d 100644 --- a/user_guide_src/source/installation/downloads.rst +++ b/user_guide_src/source/installation/downloads.rst @@ -2,14 +2,51 @@ Downloading CodeIgniter ####################### -`Git `_ is a distributed version control system. +The CodeIgniter 4 open source project has its own +`Github organization `_. -Public Git access is available at `GitHub `_. -Please note that while every effort is made to keep this code base -functional, we cannot guarantee the functionality of code taken from -the develop branch. +There are a number of repositories there of interest: -Stable versions are available via `GitHub Releases `_. +- `CodeIgniter4 `_ + holds the codebase for the project, including unit testing + and the source from which the user guide is built. + This would be used by contributors to the project. +- `framework `_ + holds the released versions of the framework. + This would be normally be used by developers. +- `appstarter `_ + holds the released application starter, with application + and public folders, but with only a composer + dependency on the framework. + This is meant as the easy way to start a CodeIgniter 4 project. +- `userguide `_ + holds the pre-built user guide. It can be downloaded + on its own, or `viewed online `_. +- `translations `_ + holds translations of the CodeIgniter 4 system messages. + Developers can use this for :doc:`localization `. +- `coding-standard `_ + holds the coding conventions we use for source code that is + part of the framework itself. + It is a dependency of the codebase repository, for contributors. -You can also download a zip of the `development branch `_, -i.e. the upcoming version. +In all the above, the latest version of a repository can be downloaded +by selecting the "releases" link in the secondary navbar inside +the "Code" tab. The current (in development) version of each can +be cloned or downloaded by selecting the "Clone or download" dropdown +button on the right-hand side if the repository homepage. + +Composer Packages +================= + +We also maintain composer-installable packages on `packagist.org `_. +These correspond to the repositories mentioned above: + +- `codeigniter4/framework `_ +- `codeigniter4/appstarter `_ +- `codeigniter4/userguide `_ +- `codeigniter4/translations `_ +- `codeigniter4/CodeIgniter4 `_ +- `codeigniter4/coding-standard `_ + +See the :doc:`Installation ` page for more information. diff --git a/user_guide_src/source/installation/index.rst b/user_guide_src/source/installation/index.rst index 140a8b81a9c1..3e83e2f30081 100644 --- a/user_guide_src/source/installation/index.rst +++ b/user_guide_src/source/installation/index.rst @@ -2,79 +2,14 @@ Installation ############ -CodeIgniter4 can be installed manually, or using Composer. - -.. note:: Before using CodeIgniter, make sure that your server meets the - :doc:`requirements `. - -Manual Installation -=================== - -CodeIgniter is installed via manual download and unzip the package. - -Composer Installation -===================== - -While not required, CodeIgniter can be installed via `composer `_ create-project command. - -:: - - composer create-project codeigniter4/framework - -.. note:: When installing via composer, a pre-commit hook is installed for this repo that automatically runs - PHP Code Sniffer and fixes any fixable issues on commit. - -Running -======= - -#. Upload the CodeIgniter folders and files to your server. The - **index.php** file will be in the **public** folder inside - your project root. -#. Open the **application/Config/App.php** file with a text editor and - set your base URL. If you intend to use encryption or sessions, set - your encryption key. If you need more flexibility, the baseURL may - be set within the .env file as **app.baseURL="http://example.com"**. -#. If you intend to use a database, open the - **application/Config/Database.php** file with a text editor and set your - database settings. - -For the best security, both the system and any application directories -come placed above the web root so that they are not directly accessible -via a browser. By default, **.htaccess** files are included in each directory -to help prevent direct access, but it is best to remove them from public -access entirely in case the web server configuration changes or doesn't -abide by the **.htaccess**. - -If you would like to keep your views public it is also possible to move -the **views** directory out of your **application** directory, to a -corresponding folder inside **public**. If you do this, remember to -open your main index.php file and set the -``$system_path``, ``$application_folder`` and ``$view_folder`` variables, -preferably with a full path, e.g. '*/www/MyUser/system*'. - -One additional measure to take in production environments is to disable -PHP error reporting and any other development-only functionality. In -CodeIgniter, this can be done by setting the ``ENVIRONMENT`` constant, which -is more fully described on the :doc:`environments page `. -By default, the application will run using the "production" environment. To -take advantage of the debugging tools provided, you should set the environment -to "develop". - -.. caution:: Using PHP's built-in web server is likely to cause problems, - as it does not process the `.htaccess` file used to properly handle requests. - -That's it! - -If you're new to CodeIgniter, please read the :doc:`Getting -Started <../intro/index>` section of the User Guide -to begin learning how to build dynamic PHP applications. Enjoy! +There are a number of ways to download, install and run a +CodeIgniter4 app. Read on :) .. toctree:: - :hidden: :titlesonly: downloads - self + installing + running upgrading troubleshooting - local_server diff --git a/user_guide_src/source/installation/installing.rst b/user_guide_src/source/installation/installing.rst new file mode 100644 index 000000000000..e2211e90d76d --- /dev/null +++ b/user_guide_src/source/installation/installing.rst @@ -0,0 +1,174 @@ +############ +Installation +############ + +CodeIgniter4 can be installed in a number of different ways: manually, +using `Composer `_, or even using +`Git `_. This section addresses how to use +each technique, and explains some of the pros and cons of them. + +Once installed, read the next section, :doc:`running your app `. + +.. note:: Before using CodeIgniter 4, make sure that your server meets the + :doc:`requirements `. + +Manual Installation +============================================================ + +Install the framework by downloading the latest version, +and extract it to become your project root. Your document +root will be the ``public`` folder inside here. + +Pros: + +- download and run; this is the installation technique + closest to that described for `CodeIgniter 3 `_. + +Cons: + +- upgrading the framework is done by downloading a new copy + of the framework, and then following the upgrade + directions to merge that with your project (typically + replace the ``system`` folder and inspect designated + ``application/Config`` folders for affected changes). + +Resulting folder structure: + +- application +- public +- system +- writable + +Composer Installation +============================================================ + +Install the latest version of the framework with:: + + > composer create-project codeigniter4/framework PROJECT_ROOT + +Pros: + +- simple installation + +Cons: + +- upgrading the framework is done by:: + + > composer update + + You would then need to resolve merge conflicts for any framework + changes to ``application`` files that you modified for your app. + +Resulting folder structure: + +- application +- public +- system +- writable + + +Codebase Installation +============================================================ + +Install the latest version of the codebase by + +- forking the codebase to your github account +- cloning your forked repository locally + +Pros: + +- you get the latest version of the codebase +- you can propose contributions by creating a feature branch, and then + submitting a pull request to the main repository once you have + pushed your feature branch to your repository +- a pre-commit hook is installed for this repo that binds it to the + coding-standard repo, and then automatically runs + PHP Code Sniffer and fixes any fixable issues whenever you commit. + +Cons: + +- you need to add a git remote alias to your project, so you can + pull codebase changes:: + + > git remote add upstream https://github.com/codeigniter4/CodeIgniter4.git + +- upgrading the framework is done by:: + + > git checkout develop + > git pull upstream develop + > git push origin develop + + You would then need to resolve merge conflicts for any framework + changes that conflict with modifications you have made. + +Resulting folder structure: + +- application +- public +- system +- tests +- user_guide_src +- writable + +App Starter Installation +============================================================ + +Install the latest version of the framework's app starter with:: + + > composer create-project codeigniter4/appstarter PROJECT_ROOT + +Pros: + +- simple installation + +Cons: + +- upgrading the framework is done by:: + + > composer update + + You would then need to resolve merge conflicts for any framework + changes to ``application`` files that you modified for your app. + +Resulting folder structure: + +- application +- public +- writable +- vendor/codeigniter4/framework + + - application + - public + - system + +Translations Installation +============================================================ + +Install the available localizations to an existing CodeIgniter 4 +project with:: + + > composer require codeigniter4/translations + +Update the translations at any time with:: + + > composer update + +When the translations are installed, they are added to the appropriate namespace. +See the :doc:`localization page ` +for guidance. + +Resulting folder structure: + +... + +- vendor + + - codeigniter4 + + - translations + +Coding Standards Installation +============================================================ + +This is bound and installed automatically as part of the +codebase installation. diff --git a/user_guide_src/source/installation/local_server.rst b/user_guide_src/source/installation/local_server.rst deleted file mode 100644 index 397efcbd941b..000000000000 --- a/user_guide_src/source/installation/local_server.rst +++ /dev/null @@ -1,32 +0,0 @@ -######################## -Local Development Server -######################## - -PHP provides a built-in web server that is can be used locally when developing an application without -the need to setup a dedicated web server like MAMP, XAMPP, etc. If you have PHP installed on your -development machine, you can use the ``serve`` script to launch PHP's built-in server and have -it all setup to work with your CodeIgniter application. To launch the server type the following -from the command line in the main directory:: - - > php serve - -This will launch the server and you can now view your application in your browser at http://localhost:8080. - -.. note:: The built-in development server should only be used on local development machines. It should NEVER - be used on a production server. - -Customization -============= - -If you need to run the site on a different host than simply localhost, you'll first need to add the host -to your ``hosts`` file. The exact location of the file varies in each of the main operating systems, though -all *nix-type systems (include OS X) will typically keep the file at **/etc/hosts**. - -Once that is done you can use the ``--host`` CLI option to specify a different host to run the application at:: - - > php serve --host=example.dev - -By default, the server runs on port 8080 but you might have more than one site running, or already have -another application using that port. You can use the ``--port`` CLI option to specify a different one:: - - > php serve --port=8081 diff --git a/user_guide_src/source/installation/running.rst b/user_guide_src/source/installation/running.rst new file mode 100644 index 000000000000..dc86b305d10a --- /dev/null +++ b/user_guide_src/source/installation/running.rst @@ -0,0 +1,98 @@ +################ +Running Your App +################ + +A CodeIgniter 4 app can be run in a number of different ways: using a web server, +using virtualization, or using PHP's built-in server. This section addresses how to use +each technique, and explains some of the pros and cons of them. + +Initial Configuration & Setup +================================================= + +Hosting with Apache +================================================= + +Hosting with NGINX +================================================= + +Hosting with Vagrant +================================================= + +Local Development Server +================================================= + +CodeIgniter 4 comes with a local development server, leveraging PHP's built-in web server +with CodeIgniter routing. You can use the ``serve`` script to launch it, +with the following command line in the main directory:: + + > php spark serve + +This will launch the server and you can now view your application in your browser at http://localhost:8080. + +.. note:: The built-in development server should only be used on local development machines. It should NEVER + be used on a production server. + +Customization +============= + +If you need to run the site on a host other than simply localhost, you'll first need to add the host +to your ``hosts`` file. The exact location of the file varies in each of the main operating systems, though +all *nix-type systems (include OS X) will typically keep the file at **/etc/hosts**. + +Once that is done you can use the ``--host`` CLI option to specify a different host to run the application at:: + + > php spark serve --host=example.dev + +By default, the server runs on port 8080 but you might have more than one site running, or already have +another application using that port. You can use the ``--port`` CLI option to specify a different one:: + + > php spark serve --port=8081 + +You can also specify a specific version of PHP to use, with the ``--php`` CLI option, with its value +set to the path of the PHP executable you want to use:: + + > php spark serve --php=/usr/bin/php7.6.5.4 + +-------------------------------------------------------------------------- + +#. Upload the CodeIgniter folders and files to your server. The + **index.php** file will be in the **public** folder inside + your project root. +#. Open the **application/Config/App.php** file with a text editor and + set your base URL. If you intend to use encryption or sessions, set + your encryption key. If you need more flexibility, the baseURL may + be set within the .env file as **app.baseURL="http://example.com"**. +#. If you intend to use a database, open the + **application/Config/Database.php** file with a text editor and set your + database settings. + +For the best security, both the system and any application directories +come placed above the web root so that they are not directly accessible +via a browser. By default, **.htaccess** files are included in each directory +to help prevent direct access, but it is best to remove them from public +access entirely in case the web server configuration changes or doesn't +abide by the **.htaccess**. + +If you would like to keep your views public it is also possible to move +the **views** directory out of your **application** directory, to a +corresponding folder inside **public**. If you do this, remember to +open your main index.php file and set the +``$system_path``, ``$application_folder`` and ``$view_folder`` variables, +preferably with a full path, e.g. '*/www/MyUser/system*'. + +One additional measure to take in production environments is to disable +PHP error reporting and any other development-only functionality. In +CodeIgniter, this can be done by setting the ``ENVIRONMENT`` constant, which +is more fully described on the :doc:`environments page `. +By default, the application will run using the "production" environment. To +take advantage of the debugging tools provided, you should set the environment +to "develop". + +.. caution:: Using PHP's built-in web server is likely to cause problems, + as it does not process the `.htaccess` file used to properly handle requests. + +That's it! + +If you're new to CodeIgniter, please read the :doc:`Getting +Started <../intro/index>` section of the User Guide +to begin learning how to build dynamic PHP applications. Enjoy! diff --git a/user_guide_src/source/installation/upgrade_4xx.rst b/user_guide_src/source/installation/upgrade_4xx.rst index 740630a22e5d..ca7fe201c658 100644 --- a/user_guide_src/source/installation/upgrade_4xx.rst +++ b/user_guide_src/source/installation/upgrade_4xx.rst @@ -30,7 +30,7 @@ subforum for an uptodate list! **Namespaces** -- CI4 is built for PHP7.1+, and everything in the framework is namespaced, even the helpers +- CI4 is built for PHP7.1+, and everything in the framework is namespaced, except for the helpers. **Application Structure** @@ -61,7 +61,7 @@ subforum for an uptodate list! **Controllers** -- Controllers extend \CodeIgniter\Controller instead of CI_Controller +- Controllers extend \\CodeIgniter\\Controller instead of CI_Controller - They don't use a constructor any more (to invoke CI "magic") unless that is part of a base controller you make - CI provides ``Request`` and ``Response`` objects for you to work with - @@ -72,7 +72,7 @@ subforum for an uptodate list! **Models** -- Models extend \CodeIgniter\Model instead of CI_Model +- Models extend \\CodeIgniter\\Model instead of CI_Model - The CI4 model has much more functionality, including automatic database connection, basic CRUD, in-model validation, and automatic pagination @@ -91,7 +91,7 @@ subforum for an uptodate list! **Libraries** -- Your app classes can still go inside ``application\Libraries``, but they +- Your app classes can still go inside ``application/Libraries``, but they don't have to - Instead of CI3's ``$this->load->library(x);`` you can now use ``$this->x = new X();``, following namespaced conventions for your From 5b67cb57586ce71c2a7d5119503172b274d924e8 Mon Sep 17 00:00:00 2001 From: Jim Parry Date: Fri, 30 Nov 2018 14:48:07 -0800 Subject: [PATCH 9/9] Update changelog; polish docs --- admin/release-framework | 4 - admin/starter/README.md | 7 ++ admin/userguide/README.md | 21 ++++++ admin/userguide/composer.json | 16 ++++ user_guide_src/source/changelogs/next.rst | 16 ++-- .../source/installation/running.rst | 75 +++++++------------ 6 files changed, 84 insertions(+), 55 deletions(-) create mode 100644 admin/userguide/README.md create mode 100644 admin/userguide/composer.json diff --git a/admin/release-framework b/admin/release-framework index 5a3a185a5cc9..31cdb163ef92 100644 --- a/admin/release-framework +++ b/admin/release-framework @@ -23,10 +23,6 @@ done echo -e "${BOLD}Override as needed...${NORMAL}" cp -rf ${CI_DIR}/admin/framework/* . -echo -e "${BOLD}Bundle the docs...${NORMAL}" -rm -rf docs -cp -rf ${CI_DIR}/user_guide_src/build/html ./docs - #--------------------------------------------------- # And finally, get ready for merging echo -e "${BOLD}Assemble the pieces...${NORMAL}" diff --git a/admin/starter/README.md b/admin/starter/README.md index 01c75411c558..7b3d77bd2e9d 100644 --- a/admin/starter/README.md +++ b/admin/starter/README.md @@ -10,6 +10,13 @@ It has been built from the **This is pre-release code and should not be used in production sites.** +--- + +**CAUTION: This app starter is EXPERIMENTAL, and likely to change before +the framework release. We are looking for feedback and suggestions!** + +--- + More information about the plans for version 4 can be found in [the announcement](http://forum.codeigniter.com/thread-62615.html) on the forums. The user guide corresponding to this version of the framework can be found diff --git a/admin/userguide/README.md b/admin/userguide/README.md new file mode 100644 index 000000000000..fc4004e04b32 --- /dev/null +++ b/admin/userguide/README.md @@ -0,0 +1,21 @@ +# CodeIgniter 4 User Guide + +## What is CodeIgniter? +CodeIgniter is a PHP full-stack web framework that is light, fast, flexible, and secure. +More information can be found at the [official site](http://codeigniter.com). + +This repository holds a composer-installable pre-built user guide for the framework. +It has been built from the +[development repository](https://github.com/codeigniter4/CodeIgniter4). + +**This is pre-release code and should not be used in production sites.** + +More information about the plans for version 4 can be found in [the announcement](http://forum.codeigniter.com/thread-62615.html) on the forums. + +##Installation & updates + +`composer require codeigniter4/userguide` will install a copy +of the user guide inside your project, at +`vendor/codeigniter4/userguide`. You can then `composer update` whenever +there is a new release of the framework. + diff --git a/admin/userguide/composer.json b/admin/userguide/composer.json new file mode 100644 index 000000000000..6eb7612d8a1f --- /dev/null +++ b/admin/userguide/composer.json @@ -0,0 +1,16 @@ +{ + "name": "codeigniter4/userguide", + "type": "project", + "description": "CodeIgniter4 user guide", + "homepage": "https://codeigniter.com", + "license": "MIT", + "require": { + "php": ">=7.1", + "codeigniter4/framework": "^4" + }, + "support": { + "forum": "http://forum.codeigniter.com/", + "source": "https://github.com/codeigniter4/CodeIgniter4", + "slack": "https://codeigniterchat.slack.com" + } +} diff --git a/user_guide_src/source/changelogs/next.rst b/user_guide_src/source/changelogs/next.rst index 7a88554f58be..4187dece9be2 100644 --- a/user_guide_src/source/changelogs/next.rst +++ b/user_guide_src/source/changelogs/next.rst @@ -35,9 +35,10 @@ The list of changed files follows, with PR numbers shown. - Autoloader/ - Autoloader #1547 - FileLocator #1547, #1550 - - Cache/Handlers/ - - FileHandler #1547 - - MemcachedHandler #1383 + - Cache/ + - Exceptions/CacheException #1525 + - Handlers/FileHandler #1547, #1525 + - Handlers/MemcachedHandler #1383 - CLI/ - CLI #1432, #1489 - Commands/ @@ -58,7 +59,7 @@ The list of changed files follows, with PR numbers shown. - BaseBuilder #1335, #1491, #1522 - BaseConnection #1335, #1407, #1491, #1522 - BaseResult #1426 - - Config #1465, #1469 + - Config #1465, #1469, #1554 - Forge #1343, #1449, #1470, #1530 - MigrationRunner #1371 - MySQLi/Connection #1335, #1449 @@ -101,6 +102,7 @@ The list of changed files follows, with PR numbers shown. - Images/Handlers/ - ImageMagickHandler #1546 - Language/ + - en/Cache #1525 - en/Database #1335 - en/Filters #1378 - en/Migrations #1374 @@ -150,7 +152,7 @@ The list of changed files follows, with PR numbers shown. - HTTP/MockResponse #1456 - _bootstrap.php #1397, #1443 - Cache/Handlers/ - - FileHandlerTest #1547 + - FileHandlerTest #1547, #1525 - MemcachedHandlerTest #1180, #1383 - RedisHandlerTest #1180, #1481 - CLI/ @@ -158,6 +160,7 @@ The list of changed files follows, with PR numbers shown. - Commands/ - SessionCommandsTest #1455 - Database/Live/ + - ConnectTest #1554 - ForgeTest #1449, #1470 - HTTP/ - CURLRequestTest#1498 @@ -221,6 +224,7 @@ The list of changed files follows, with PR numbers shown. - installation/ - index #1388 - libraries/ + - caching #1525 - pagination #1213 - validation #27868b, #1540 - models/ @@ -242,6 +246,7 @@ The list of changed files follows, with PR numbers shown. PRs merged: ----------- +- #1554 Serviceinstances - #1553 Admin/scripts - #1550 remove commented CLI::newLine($tempFiles) at FileLocator - #1549 use .gitkeep instead of .gitignore in Database/Seeds directory @@ -252,6 +257,7 @@ PRs merged: - 2047b5a Don't run filters when using spark. - #1539 remove mb_* (mb string usage) in CreditCardRules - #1536 ext-json in composer.json +- #1525 remove unneeded try {} catch {} - #1524 Test routes resource with 'websafe' option - #1523 Check if the matched route regex is filtered - #1522 add property_exists check on BaseBuilder diff --git a/user_guide_src/source/installation/running.rst b/user_guide_src/source/installation/running.rst index dc86b305d10a..80bf6f73af33 100644 --- a/user_guide_src/source/installation/running.rst +++ b/user_guide_src/source/installation/running.rst @@ -9,15 +9,37 @@ each technique, and explains some of the pros and cons of them. Initial Configuration & Setup ================================================= +#. Open the **application/Config/App.php** file with a text editor and + set your base URL. If you intend to use encryption or sessions, set + your encryption key. If you need more flexibility, the baseURL may + be set within the .env file as **app.baseURL="http://example.com"**. +#. If you intend to use a database, open the + **application/Config/Database.php** file with a text editor and set your + database settings. + +One additional measure to take in production environments is to disable +PHP error reporting and any other development-only functionality. In +CodeIgniter, this can be done by setting the ``ENVIRONMENT`` constant, which +is more fully described on the :doc:`environments page `. +By default, the application will run using the "production" environment. To +take advantage of the debugging tools provided, you should set the environment +to "develop". + Hosting with Apache ================================================= +Directions coming with the next release. + Hosting with NGINX ================================================= +Directions coming with the next release. + Hosting with Vagrant ================================================= +Directions coming with the next release. + Local Development Server ================================================= @@ -32,66 +54,27 @@ This will launch the server and you can now view your application in your browse .. note:: The built-in development server should only be used on local development machines. It should NEVER be used on a production server. -Customization -============= - If you need to run the site on a host other than simply localhost, you'll first need to add the host to your ``hosts`` file. The exact location of the file varies in each of the main operating systems, though all *nix-type systems (include OS X) will typically keep the file at **/etc/hosts**. -Once that is done you can use the ``--host`` CLI option to specify a different host to run the application at:: +The local development server can be customized with three command line options: + +- Once that is done you can use the ``--host`` CLI option to specify a different host to run the application at:: > php spark serve --host=example.dev -By default, the server runs on port 8080 but you might have more than one site running, or already have -another application using that port. You can use the ``--port`` CLI option to specify a different one:: +- By default, the server runs on port 8080 but you might have more than one site running, or already have + another application using that port. You can use the ``--port`` CLI option to specify a different one:: > php spark serve --port=8081 -You can also specify a specific version of PHP to use, with the ``--php`` CLI option, with its value -set to the path of the PHP executable you want to use:: +- You can also specify a specific version of PHP to use, with the ``--php`` CLI option, with its value + set to the path of the PHP executable you want to use:: > php spark serve --php=/usr/bin/php7.6.5.4 --------------------------------------------------------------------------- - -#. Upload the CodeIgniter folders and files to your server. The - **index.php** file will be in the **public** folder inside - your project root. -#. Open the **application/Config/App.php** file with a text editor and - set your base URL. If you intend to use encryption or sessions, set - your encryption key. If you need more flexibility, the baseURL may - be set within the .env file as **app.baseURL="http://example.com"**. -#. If you intend to use a database, open the - **application/Config/Database.php** file with a text editor and set your - database settings. - -For the best security, both the system and any application directories -come placed above the web root so that they are not directly accessible -via a browser. By default, **.htaccess** files are included in each directory -to help prevent direct access, but it is best to remove them from public -access entirely in case the web server configuration changes or doesn't -abide by the **.htaccess**. - -If you would like to keep your views public it is also possible to move -the **views** directory out of your **application** directory, to a -corresponding folder inside **public**. If you do this, remember to -open your main index.php file and set the -``$system_path``, ``$application_folder`` and ``$view_folder`` variables, -preferably with a full path, e.g. '*/www/MyUser/system*'. - -One additional measure to take in production environments is to disable -PHP error reporting and any other development-only functionality. In -CodeIgniter, this can be done by setting the ``ENVIRONMENT`` constant, which -is more fully described on the :doc:`environments page `. -By default, the application will run using the "production" environment. To -take advantage of the debugging tools provided, you should set the environment -to "develop". - -.. caution:: Using PHP's built-in web server is likely to cause problems, - as it does not process the `.htaccess` file used to properly handle requests. -That's it! If you're new to CodeIgniter, please read the :doc:`Getting Started <../intro/index>` section of the User Guide