What's for you need OOP here?
Only if it's a selfeducational project. I think you should use something like MVC pattern, there is a lot of documentation out there, simply (here) translate that model into OOP php classes, and than put it into some way like this:
- lib/
- core/ - the core classes such as controller, request, response, e.t.c.
- hepler/ - where the hepler's functions files are allocated
- config/ - configuration for your DB connection, and other
- model/ - you OOP model
- view/ - the html templates
- web/ - DOCUMENT_ROOT, where css, js, image, and your's controller access point in allocated
- log/ - log dir, if you need one
- cache/ although, if you need that.
Files, for easy explore should be named as *.class.php, if there any inheritance, it would be *.base.class.php, or *.module.class.php
Basic rules are:
- One class per file
- If you are using namespaces (recommended), then you shoul allocate files in the same way as namesapces, to easy autoload (spl_register_autoload())
- Separate lib for each functionality
In your index file there would be only 3-4 lines, where you construct you project root class (controller), and then inside your controller you handle request, then going to the module, which you requested, and then to the view, where your system outputs the result.
OOP is greatly covered in MVC frameworks such as Symfony, you should look there.