Skip to content

Copy the latest Vagrantfile.dist in CodeIgniter4 repository #38

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# CodeIgniter DevKit

Development toolkit for CodeIgniter libraries and projects

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

### Hosting with Vagrant

> **Note**
> The `Vagrantfile.dist` is unmaintained. It might not work now.
> Contributions are welcome.
Virtualization is an effective way to test your webapp in the environment you
plan to deploy on, even if you develop on a different one.
Even if you are using the same platform for both, virtualization provides an
isolated environment for testing.

The codebase comes with a **src/Template/Vagrantfile.dist**, that can be copied to **Vagrantfile**
and tailored for your system, for instance enabling access to specific database or caching engines.

#### Setting Up

It assumes that you have installed [VirtualBox](https://www.virtualbox.org/wiki/Downloads) and
[Vagrant](https://www.vagrantup.com/downloads.html)
for your platform.

The Vagrant configuration file assumes you have set up a [ubuntu/bionic64 Vagrant box](https://app.vagrantup.com/ubuntu/boxes/bionic64) on your system:

```console
> vagrant box add ubuntu/bionic64
```

#### Testing

Once set up, you can then launch your webapp inside a VM, with the command:

```console
> vagrant up
```

Your webapp will be accessible at http://localhost:8080, with the code coverage
report for your build at http://localhost:8081 and the user guide for
it at http://localhost:8082.

## Example Files

Besides the template files, this repo includes some examples for integrating CodeIgniter
Expand Down
6 changes: 3 additions & 3 deletions src/Vagrantfile.dist → src/Template/Vagrantfile.dist
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Vagrant.configure("2") do |config|
PGSQL_ROOT_PASS="password"
VIRTUALHOST="localhost"
CODEIGNITER_PATH="/var/www/codeigniter"
PHP_VERSION=7.3
PHP_VERSION=7.4
PGSQL_VERSION=10
#APT_PROXY="192.168.10.1:3142"
Expand Down Expand Up @@ -166,8 +166,8 @@ Vagrant.configure("2") do |config|
sed -i "s/APACHE_RUN_USER=www-data/APACHE_RUN_USER=vagrant/" /etc/apache2/envvars
sed -i "s/APACHE_RUN_GROUP=www-data/APACHE_RUN_GROUP=vagrant/" /etc/apache2/envvars
grep -q "Listen 81" /etc/apache2/ports.conf || sed -i "s/^Listen 80/Listen 80\\nListen 81\\nListen 82/" /etc/apache2/ports.conf
sed -i "s/^display_errors = Off/display_errors = On/" /etc/php/7.3/apache2/php.ini
sed -i "s/^display_startup_errors = Off/display_startup_errors = On/" /etc/php/7.3/apache2/php.ini
sed -i "s/^display_errors = Off/display_errors = On/" /etc/php/7.4/apache2/php.ini
sed -i "s/^display_startup_errors = Off/display_startup_errors = On/" /etc/php/7.4/apache2/php.ini
echo "ServerName ${VIRTUALHOST}
<Directory ${CODEIGNITER_PATH}>
Expand Down