Hi all, long time no visit however now that I’ve dusted off the old coding skills I need some help please.
I am having a world of trouble getting my head around PHP relative paths. Below is my folder structure:
myProject.com
/src
/app
/classes
/config
/controllers
/lib
/Doctrine
/DBAL
/models
/tests
/views
/public
/index.php
/.htaccess
/build.xml
In my index.php if I want to include a class I am using:
require '../app/classes/Loader.php';
Which is not elegant, but it’s working.
My trouble is in trying to reference the Doctrine DBAL library. I have tried the following and nothing seems to work!
use Doctrine\\DBAL;
use \\Doctrine\\DBAL;
use \\lib\\Doctrine\\DBAL;
I have tried setting the include_path as follows:
$path = dirname(__FILE__).'\\..\\app\\lib';
set_include_path(get_include_path() . PATH_SEPARATOR . $path);
I know I am missing something fundamental here but I can’t wrap my head around it. Really appreciate any pointers.