Thursday, 12 September 2013

Confusion about include_once in php

Confusion about include_once in php

Let's say I have the following files:
class/
|-- A.Class.php
|-- FactoryA.php
|-- Database.php
|-- Log.php
index.php
Which FactoryA.php is a Factory Class that creates obj A and can
create/read/update/delete A from database. While log.php is a class that
can simply creates log in a text file (ie output debug statement in
log.txt)
So, obviously FactoryA will require A.Class (to create the instance) and
Database (to interact with the mySQL database)
All classes need to access Log.php (for debugging purpose) and last but
not least index.php will create FactoryA instance.
So how am I going to include all files? should I:
do it in class? or
I should simply include files ONLY in index.php?

No comments:

Post a Comment