Windows environment failed to include files

Permalink
I'm trying to run development on windows10 with xampp and I'm having trouble with hardcoded directory separator so I'm not able to include any files

for instance:
$this->inc('elements/header.php');


Got Error:
include(C:\xampp\htdocs\concrete/themes/edes/elements/header.php): failed to open stream: No such file or directory


Seems that the direcotry separator is not well set for windows enviroment, is there any way to solve this issue?

Thx

 
JohntheFish replied on at Permalink Reply
JohntheFish
Use the c5 autoloader. don't use include.
ramonleenders replied on at Permalink Reply
ramonleenders
I'm assuming this directory does not exist:

concrete/themes/edes

Doesn't it have to look into application/themes/edes? I assume you're running concrete5 5.7 btw. Otherwise it's themes/edes (there is no application folder in 5.6).

Where are you putting this code exactly?
ranostaj replied on at Permalink Reply
I put this code into:

C:\xampp\htdocs\edes\application\themes\edes\full.php

anyway I've solved this using:

require('elements/header.php')

Now its loading files just fine
ramonleenders replied on at Permalink Reply
ramonleenders
If you compare

C:\xampp\htdocs\concrete/themes/edes/elements/header.php

With

C:\xampp\htdocs\edes\application\themes\edes\full.php

You will see the "edes" is missing in the first one (that's the path that gave you the error). So for some reason, your installation thinks your root website is located under "C:\xampp\htdocs", which it is not. So if you can fix that, you don't have to require or include the file, but use $this->inc() instead like you should.