|
| 1 | +############ |
| 2 | +Installation |
| 3 | +############ |
| 4 | + |
| 5 | +CodeIgniter4 can be installed in a number of different ways: manually, |
| 6 | +using `Composer <https://getcomposer.org>`_, or even using |
| 7 | +`Git <https://git-scm.com/>`_. This section addresses how to use |
| 8 | +each technique, and explains some of the pros and cons of them. |
| 9 | + |
| 10 | +Once installed, read the next section, :doc:`running your app </installation/running>`. |
| 11 | + |
| 12 | +.. note:: Before using CodeIgniter 4, make sure that your server meets the |
| 13 | + :doc:`requirements </intro/requirements>`. |
| 14 | + |
| 15 | +Manual Installation |
| 16 | +============================================================ |
| 17 | + |
| 18 | +Install the framework by downloading the latest version, |
| 19 | +and extract it to become your project root. Your document |
| 20 | +root will be the ``public`` folder inside here. |
| 21 | + |
| 22 | +Pros: |
| 23 | + |
| 24 | +- download and run; this is the installation technique |
| 25 | + closest to that described for `CodeIgniter 3 <https://www.codeigniter.com/user_guide/installation/index.html>`_. |
| 26 | + |
| 27 | +Cons: |
| 28 | + |
| 29 | +- upgrading the framework is done by downloading a new copy |
| 30 | + of the framework, and then following the upgrade |
| 31 | + directions to merge that with your project (typically |
| 32 | + replace the ``system`` folder and inspect designated |
| 33 | + ``application/Config`` folders for affected changes). |
| 34 | + |
| 35 | +Resulting folder structure: |
| 36 | + |
| 37 | +- application |
| 38 | +- public |
| 39 | +- system |
| 40 | +- writable |
| 41 | + |
| 42 | +Composer Installation |
| 43 | +============================================================ |
| 44 | + |
| 45 | +Install the latest version of the framework with:: |
| 46 | + |
| 47 | + > composer create-project codeigniter4/framework PROJECT_ROOT |
| 48 | + |
| 49 | +Pros: |
| 50 | + |
| 51 | +- simple installation |
| 52 | + |
| 53 | +Cons: |
| 54 | + |
| 55 | +- upgrading the framework is done by:: |
| 56 | + |
| 57 | + > composer update |
| 58 | + |
| 59 | + You would then need to resolve merge conflicts for any framework |
| 60 | + changes to ``application`` files that you modified for your app. |
| 61 | + |
| 62 | +Resulting folder structure: |
| 63 | + |
| 64 | +- application |
| 65 | +- public |
| 66 | +- system |
| 67 | +- writable |
| 68 | + |
| 69 | + |
| 70 | +Codebase Installation |
| 71 | +============================================================ |
| 72 | + |
| 73 | +Install the latest version of the codebase by |
| 74 | + |
| 75 | +- forking the codebase to your github account |
| 76 | +- cloning your forked repository locally |
| 77 | + |
| 78 | +Pros: |
| 79 | + |
| 80 | +- you get the latest version of the codebase |
| 81 | +- you can propose contributions by creating a feature branch, and then |
| 82 | + submitting a pull request to the main repository once you have |
| 83 | + pushed your feature branch to your repository |
| 84 | +- a pre-commit hook is installed for this repo that binds it to the |
| 85 | + coding-standard repo, and then automatically runs |
| 86 | + PHP Code Sniffer and fixes any fixable issues whenever you commit. |
| 87 | + |
| 88 | +Cons: |
| 89 | + |
| 90 | +- you need to add a git remote alias to your project, so you can |
| 91 | + pull codebase changes:: |
| 92 | + |
| 93 | + > git remote add upstream https://github.com/codeigniter4/CodeIgniter4.git |
| 94 | + |
| 95 | +- upgrading the framework is done by:: |
| 96 | + |
| 97 | + > git checkout develop |
| 98 | + > git pull upstream develop |
| 99 | + > git push origin develop |
| 100 | + |
| 101 | + You would then need to resolve merge conflicts for any framework |
| 102 | + changes that conflict with modifications you have made. |
| 103 | + |
| 104 | +Resulting folder structure: |
| 105 | + |
| 106 | +- application |
| 107 | +- public |
| 108 | +- system |
| 109 | +- tests |
| 110 | +- user_guide_src |
| 111 | +- writable |
| 112 | + |
| 113 | +App Starter Installation |
| 114 | +============================================================ |
| 115 | + |
| 116 | +Install the latest version of the framework's app starter with:: |
| 117 | + |
| 118 | + > composer create-project codeigniter4/appstarter PROJECT_ROOT |
| 119 | + |
| 120 | +Pros: |
| 121 | + |
| 122 | +- simple installation |
| 123 | + |
| 124 | +Cons: |
| 125 | + |
| 126 | +- upgrading the framework is done by:: |
| 127 | + |
| 128 | + > composer update |
| 129 | + |
| 130 | + You would then need to resolve merge conflicts for any framework |
| 131 | + changes to ``application`` files that you modified for your app. |
| 132 | + |
| 133 | +Resulting folder structure: |
| 134 | + |
| 135 | +- application |
| 136 | +- public |
| 137 | +- writable |
| 138 | +- vendor/codeigniter4/framework |
| 139 | + |
| 140 | + - application |
| 141 | + - public |
| 142 | + - system |
| 143 | + |
| 144 | +Translations Installation |
| 145 | +============================================================ |
| 146 | + |
| 147 | +Install the available localizations to an existing CodeIgniter 4 |
| 148 | +project with:: |
| 149 | + |
| 150 | + > composer require codeigniter4/translations |
| 151 | + |
| 152 | +Update the translations at any time with:: |
| 153 | + |
| 154 | + > composer update |
| 155 | + |
| 156 | +When the translations are installed, they are added to the appropriate namespace. |
| 157 | +See the :doc:`localization page </outgoing/localization>` |
| 158 | +for guidance. |
| 159 | + |
| 160 | +Resulting folder structure: |
| 161 | + |
| 162 | +... |
| 163 | + |
| 164 | +- vendor |
| 165 | + |
| 166 | + - codeigniter4 |
| 167 | + |
| 168 | + - translations |
| 169 | + |
| 170 | +Coding Standards Installation |
| 171 | +============================================================ |
| 172 | + |
| 173 | +This is bound and installed automatically as part of the |
| 174 | +codebase installation. |
0 commit comments