From 9113aa33ce0f1ebafcefc5218b44b21ec8c1eb2d Mon Sep 17 00:00:00 2001 From: pkowalczyk <11366345+PabloKowalczyk@users.noreply.github.com> Date: Sat, 21 Apr 2018 11:07:28 +0200 Subject: [PATCH 1/4] Test autoload from src and bin perspective. --- crunz | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/crunz b/crunz index 684a0063..dd6dd052 100755 --- a/crunz +++ b/crunz @@ -13,7 +13,7 @@ | */ -$autoloadFile = \implode( +$autoloadSrc = \implode( DIRECTORY_SEPARATOR, [ __DIR__, @@ -22,12 +22,28 @@ $autoloadFile = \implode( ] ); -require $autoloadFile; +$autoloadBin = \implode( + DIRECTORY_SEPARATOR, + [ + __DIR__, + '..', + '..', + 'autoload.php' + ] +); + +$hasBinAutoloader = \file_exists($autoloadBin); + +if ($hasBinAutoloader) { + require_once $autoloadBin; +} else { + require_once $autoloadSrc; +} define('CRUNZ_ROOT', __DIR__); // Setting the base directory as an environment variable -setbase(getroot($autoloadFile)); +setbase(getroot($hasBinAutoloader ? $autoloadBin : $autoloadSrc)); // Setting the handler for catching/logging fatal and parse errors. Crunz\ErrorHandler::getInstance()->set(); From 23030174781d0dd7efaf9ac7a006c89ba7be740f Mon Sep 17 00:00:00 2001 From: pkowalczyk <11366345+PabloKowalczyk@users.noreply.github.com> Date: Sat, 21 Apr 2018 12:07:10 +0200 Subject: [PATCH 2/4] Added Vagrant as a development environment. --- .gitignore | 1 + Vagrantfile | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 Vagrantfile diff --git a/.gitignore b/.gitignore index 24e4a14f..59dbfc3f 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ composer.lock *.log .idea/ var/ +.vagrant/ diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 00000000..ea63b6df --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,63 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +$script = <