Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
PHP 5 CMS Framework Development - 2nd Edition

You're reading from   PHP 5 CMS Framework Development - 2nd Edition For professional PHP developers, this is the perfect guide to web-oriented frameworks and content management systems. Covers all the critical design issues and programming techniques in an easy-to-follow style and structure.

Arrow left icon
Product type Paperback
Published in Aug 2010
Publisher Packt
ISBN-13 9781849511346
Length 416 pages
Edition 1st Edition
Languages
Tools
Concepts
Arrow right icon
Author (1):
Arrow left icon
Martin Brampton Martin Brampton
Author Profile Icon Martin Brampton
Martin Brampton
Arrow right icon
View More author details
Toc

Table of Contents (24) Chapters Close

PHP 5 CMS Framework Development
Second Edition
Credits
About the Author
1. Acknowledgement
About the Reviewers
2. Preface
1. CMS Architecture FREE CHAPTER 2. Organizing Code 3. Database and Data Objects 4. Administrators, Users, and Guests 5. Sessions and Users 6. Caches and Handlers 7. Access Control 8. Handling Extensions 9. Menus 10. Languages 11. Presentation Services 12. Other Services 13. SEF and RESTful Services 14. Error Handling 15. Real Content Packaging Extensions
Packaging XML Example

Chapter 2. Organizing Code

Before we go further with CMS development, let's look at a problem that can be neatly solved using PHP5. Substantial systems do not consist of a single file of code. Whatever our exact design, a large system should be broken down into smaller elements, and it makes sense to keep them in separate files, if the language supports it. Code is more manageable this way, and systems can be made more efficient.

As we are considering only PHP implementations, the source code files are used at runtime. PHP is an interpreted language and, at least in principle, runs the actual source code. So we need a good technique for handling many source files at runtime.

This creates issues; a paramount one is security. Another is ease of coding, where it is tedious and cumbersome to have to repeatedly include code to load other files. Yet another is efficiency, as we do not want to load code that is not needed for a particular request.

The problem

Ideally we want an automated system for...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image