0

Following is the app architecture:

application
  |-config
    |-config.inc.php  (contains definition of App ROOT)
library
  |-autoload.class.php
public
  |-css
  |-img
index.php

Problem: I am not understanding how to call config file so as to set and access App Root.

In Config File - I have defined Constant -> MY_APP_ROOT

Now, I wish to access all Application Folders with the help of MY_APP_ROOT.

Could you please help?
Thank you friends.

4
Contributors
3
Replies
21
Views
3 Years
Discussion Span
Last Post by diafol
0

I'm assuming there is nothing fancy going on here. Frameworks like CI, laravel probably just access the config file as you would normally, so you would pass in the path to the directory relative or absolute... take your pick.

0

Include or required the config file where ever you need it. require($_SERVER['DOCUMENT_ROOT'] . '/application/config/config.inc.php');

Edited by gabrielcastillo

1

So accessing application folders thereafter...
If using Gabriel's require...
e.g.

$library = MY_APP_ROOT. '/library/'; 

Is that what you're looking for?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.