Skip to content

Commit c802432

Browse files
authored
Merge pull request #38 from kenjis/update-Vagrantfile.dist
Copy the latest Vagrantfile.dist in CodeIgniter4 repository
2 parents 96f2d4e + b9e67ea commit c802432

File tree

2 files changed

+42
-3
lines changed

2 files changed

+42
-3
lines changed

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# CodeIgniter DevKit
2+
23
Development toolkit for CodeIgniter libraries and projects
34

45
## Installation
@@ -145,6 +146,44 @@ Composer Unused does one thing: checks that your code actually uses the dependen
145146
have included via Composer. It can be easy to forget to update your **composer.json** when
146147
your code drops a dependency, so this workflow will help track those down.
147148

149+
### Hosting with Vagrant
150+
151+
> **Note**
152+
> The `Vagrantfile.dist` is unmaintained. It might not work now.
153+
> Contributions are welcome.
154+
155+
Virtualization is an effective way to test your webapp in the environment you
156+
plan to deploy on, even if you develop on a different one.
157+
Even if you are using the same platform for both, virtualization provides an
158+
isolated environment for testing.
159+
160+
The codebase comes with a **src/Template/Vagrantfile.dist**, that can be copied to **Vagrantfile**
161+
and tailored for your system, for instance enabling access to specific database or caching engines.
162+
163+
#### Setting Up
164+
165+
It assumes that you have installed [VirtualBox](https://www.virtualbox.org/wiki/Downloads) and
166+
[Vagrant](https://www.vagrantup.com/downloads.html)
167+
for your platform.
168+
169+
The Vagrant configuration file assumes you have set up a [ubuntu/bionic64 Vagrant box](https://app.vagrantup.com/ubuntu/boxes/bionic64) on your system:
170+
171+
```console
172+
> vagrant box add ubuntu/bionic64
173+
```
174+
175+
#### Testing
176+
177+
Once set up, you can then launch your webapp inside a VM, with the command:
178+
179+
```console
180+
> vagrant up
181+
```
182+
183+
Your webapp will be accessible at http://localhost:8080, with the code coverage
184+
report for your build at http://localhost:8081 and the user guide for
185+
it at http://localhost:8082.
186+
148187
## Example Files
149188

150189
Besides the template files, this repo includes some examples for integrating CodeIgniter

src/Vagrantfile.dist renamed to src/Template/Vagrantfile.dist

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Vagrant.configure("2") do |config|
5050
PGSQL_ROOT_PASS="password"
5151
VIRTUALHOST="localhost"
5252
CODEIGNITER_PATH="/var/www/codeigniter"
53-
PHP_VERSION=7.3
53+
PHP_VERSION=7.4
5454
PGSQL_VERSION=10
5555
#APT_PROXY="192.168.10.1:3142"
5656
@@ -166,8 +166,8 @@ Vagrant.configure("2") do |config|
166166
sed -i "s/APACHE_RUN_USER=www-data/APACHE_RUN_USER=vagrant/" /etc/apache2/envvars
167167
sed -i "s/APACHE_RUN_GROUP=www-data/APACHE_RUN_GROUP=vagrant/" /etc/apache2/envvars
168168
grep -q "Listen 81" /etc/apache2/ports.conf || sed -i "s/^Listen 80/Listen 80\\nListen 81\\nListen 82/" /etc/apache2/ports.conf
169-
sed -i "s/^display_errors = Off/display_errors = On/" /etc/php/7.3/apache2/php.ini
170-
sed -i "s/^display_startup_errors = Off/display_startup_errors = On/" /etc/php/7.3/apache2/php.ini
169+
sed -i "s/^display_errors = Off/display_errors = On/" /etc/php/7.4/apache2/php.ini
170+
sed -i "s/^display_startup_errors = Off/display_startup_errors = On/" /etc/php/7.4/apache2/php.ini
171171
172172
echo "ServerName ${VIRTUALHOST}
173173
<Directory ${CODEIGNITER_PATH}>

0 commit comments

Comments
 (0)