diff --git a/README.md b/README.md index a5509af..b8dba6b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # CodeIgniter DevKit + Development toolkit for CodeIgniter libraries and projects ## Installation @@ -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 diff --git a/src/Vagrantfile.dist b/src/Template/Vagrantfile.dist similarity index 99% rename from src/Vagrantfile.dist rename to src/Template/Vagrantfile.dist index 857f923..e85393f 100644 --- a/src/Vagrantfile.dist +++ b/src/Template/Vagrantfile.dist @@ -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" @@ -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}