Basically, I have 3 files located in different directories:
diretorio_do_projeto/classes/config.php
diretorio_do_projeto/classes/abstract/abstract-dao.php
diretorio_do_projeto/classes/dao/modelo-dao.php
The config.php
file defines constants for database access, and is included in the abstract-dao.php
file, which in turn is included in the modelo-dao.php
file.
The problem occurs when I include the modelo-dao.php
file on some page that is not in a /classes
subdirectory, the abstract-dao.php
file is not found.
Is there a different way to import a class other than the require
or include
?
The only solutions I could think of were to remove imports into classes and import them one by one on the page where I will use them, or leave them in the same directory as the page.