万本电子书0元读

万本电子书0元读

顶部广告

PHP 5 CMS Framework Development - 2nd Edition电子书

售       价:¥

2人正在读 | 0人评论 9.8

作       者:Martin Brampton

出  版  社:Packt Publishing

出版时间:2010-08-17

字       数:589.2万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
The book includes extensive discussion of the design issues, and how to overcome them in the framework. Each chapter of the book focuses on a particular requirement of the framework. The book will not present the total code for a framework, which requires many thousands of lines. But it does show the parts that raise critical design or implementation issues. For these, detailed explanation is given, leaving the less problematic parts to the code download itself. If you are a professional PHP developer who wants to know more about web oriented frameworks and content management systems, this book is for you. Whether you already use an in-house developed framework or are developing one, or if you are simply interested in the issues involved in this demanding area, you will find discussion ranging from design issues to detailed coding solutions in this book. You are expected to have experience working with PHP 5 object-oriented programming. Examples in the book will run on any recent version of PHP 5, including 5.3.
目录展开

PHP 5 CMS Framework Development

Table of Contents

PHP 5 CMS Framework Development

Credits

About the Author

Acknowledgement

About the Reviewers

Preface

What this book covers

What you need for this book

Who this book is for

Conventions

Reader feedback

Customer support

Errata

Piracy

Questions

1. CMS Architecture

The idea of a CMS

Critical CMS features

Desirable CMS features

System management

Technology for CMS building

Leveraging PHP5

Some PHP policies

Globalness in PHP

Classes and objects

Objects, patterns, and refactoring

The object-relational compromise

Basics of combining PHP and XHTML

Model, view, and controller

The CMS environment

Hosting the CMS

Basic browser matters

Security of a CMS

Some CMS terminology

Summary

2. Organizing Code

The problem

Discussion and considerations

Security

Methods of code inclusion

Practicality in coding

Exploring PHP and object design

Autoloading

Namespaces and class visibility

Singletons

Objections to use of singletons

Framework solution

Autoloading

The smart class mapper

Finding a path to the class

Populating the dynamic class map

Saving map elements

Obtaining class information

Summary

3. Database and Data Objects

The problem

Discussion and considerations

Database dependency

The role of the database

Level of database abstraction

Ease of development

Keeping up with change

Database security

Pragmatic error handling

Exploring PHP—indirect references

Framework solution

Class structure

Connecting to a database

Handling databases easily

Prefixing table names in SQL

Making the database work

Getting hold of data

Higher level data access

Assisted update and insert

What happened?

Database extended services

Getting data about data

Easier data about data

Aiding maintenance

Data objects

Rudimentary data object methods

Data object input and output

Setting data in data objects

Sequencing database rows

Database maintenance utility

Summary

4. Administrators, Users, and Guests

The problem

Discussion and considerations

Who needs users?

Secure authentication

Secure storage of passwords

Blocking SQL injection

Login

Managing user data

User self service

Customizing for users

Extended user information

Exploring PHP—arrays and SQL

Framework solution

The user database table

Indexes on users

Keeping user tables in step

Achieving login

Administering users

Generating passwords

Summary

5. Sessions and Users

The problem

Discussion and considerations

Why sessions?

How sessions work

Avoiding session vulnerabilities

Search engine bots

Session data and scalability

Exploring PHP—frameworks of classes

Framework solution

Building a session handler

Creating a session

Finding the IP address

Validating a session

Remembering users

Completing session handling

Session data

Session data and bots

Retrieving session data

Keeping session data tidy

Summary

6. Caches and Handlers

The problem

Discussion and considerations

Why build information handlers?

The singleton cache

The disk cache

Scalability and database cache

The XHTML cache

Other caches

Exploring PHP—static elements and helpers

Framework solution

Abstract cache class

Singleton object cache manager

Creating the base class cached singleton

Generalized cache

Summary

7. Access Control

The problem

Discussion and considerations

Adding hierarchy

Adding constraints

Avoiding unnecessary restrictions

Some special roles

Implementation efficiency

Where are the real difficulties?

Exploring SQL—MySQL and PHP

Framework solution

Database for RBAC

Administering RBAC

The general RBAC cache

Asking RBAC questions

Summary

8. Handling Extensions

The problem

Discussion and considerations

An extension ecosystem

Templates in the ecosystem

Modules in the ecosystem

Components in the ecosystem

Component templates

Modules everywhere

More on extensions

Templates

Modules

Components

Component for the administrator

Component for the user

Component standard structure

Plugins

Extension parameters

Exploring PHP—XML handling

Framework solution

Packaging extensions

Module interface and structure

The logic of module activation

Component interface and structure

A standardized component structure

Plugin interface and structure

Invoking plugins

Applications

Installing and managing extensions

Structuring installer tasks

Putting extension files in place

Extensions and the database

Knowing about extension classes

Summary

9. Menus

The problem

Discussion and considerations

Page management by URI

Menu database requirements

Menu management

Menu construction

Menu presentation

Exploring PHP—array functions

Framework solution

Building the menu handler

Interfacing to components

The menu creator

An example of a menu module

Summary

10. Languages

The problem

Discussion and considerations

Character sets

UTF-8 and XHTML

Specifying languages

Handling multiple languages in code

Languages in CMS extensions

Handling languages in data

Exploring PHP—character sets

Framework solution

The gettext implementation

File formats for gettext

Functions for gettext

The PHPgettext classes

The language class

Administrator language application

Language details

Translation

Handling extensions

Managing extension translations

Installing translations with CMS extensions

Handling multilingual data

Summary

11. Presentation Services

The problem

Discussion and considerations

Differing points of view

Model View Controller

XHTML, CSS, and themes

PHP for XHTML creation

GUI widgets and XHTML

Page control and navigation

WYSIWYG editors

XHTML cleaning

The administrator interface

Exploring PHP—clarity and succinctness

Framework solution

Using "heredoc" to define XHTML

Using templating engines

Some widgets

Building page control

Supporting editors

Cleaning up XHTML

Administrator database management

Customization through subclassing

Summary

12. Other Services

The problem

Discussion and considerations

Parsing XML

Configuration handling

WYSIWYG editing

File and directory handling

Sending mail

Parameter objects

Administrator ready-made functionality

Exploring PHP—file issues in web hosting

Basic file and directory permissions

Hosting and ownership

Living with split ownership

Avoiding split ownership

Framework solution

Reading XML files easily

Storing configuration data

Incorporating a WYSIWYG editor

Dealing with files and directories

Compound parameter objects

Administrator ready-made table handlers

Summary

13. SEF and RESTful Services

The problem

Discussion

Transforming query strings

Direct URI handling and REST

Mechanics of URI handling

Essential HTTP result codes

The importance of metadata

Exploring PHP—PHP and HTTP

Framework solution

Efficient lookup of very long keys

Cache and database transformation

Looking at SEF transformation code

Decoding an incoming URI

Encoding an outgoing URI

Direct URI handling

The future of direct URIs

Summary

14. Error Handling

The problem

Discussion

PHP error handling

Database errors

Application errors

Exploring PHP—error handling

Framework solution

Handling database errors

404 and 403 errors

Summary

15. Real Content

The problem

Discussion and considerations

Articles, blogs, magazines, and FAQ

Comments and reviews

Forums

Galleries, repositories, and streaming

E-commerce and payments

Forms

Calendars

Integrators

RSS readers

Other categories

Exploring technology—accessibility

General good practice

Use of JavaScript

Validation

Framework solution

A simple blog application

The database table for blog

A blog data object

Administering blog items—controller

Administering blog items—viewer

Showing blogs to visitors

Menu building

Summary

A. Packaging Extensions

The XML setup file

Parameters

Parameter types

B. Packaging XML Example

Index

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部