Book Image

PHP 5 CMS Framework Development - 2nd Edition

By : Martin Brampton
Book Image

PHP 5 CMS Framework Development - 2nd Edition

By: Martin Brampton

Overview of this book

If you want an insight into the critical design issues and programming techniques required for a web oriented framework in PHP5, this book will be invaluable. Whether you want to build your own CMS style framework, want to understand how such frameworks are created, or simply want to review advanced PHP5 software development techniques, this book is for you.As a former development team leader on the renowned Mambo open-source content management system, author Martin Brampton offers unique insight and practical guidance into the problem of building an architecture for a web oriented framework or content management system, using the latest versions of popular web scripting language PHP.The scene-setting first chapter describes the evolution of PHP frameworks designed to support web sites by acting as content management systems. It reviews the critical and desirable features of such systems, followed by an overview of the technology and a review of the technical environment.Following chapters look at particular topics, with:• A concise statement of the problem • Discussion of the important design issues and problems faced • Creation of the framework solution At every point, there is an emphasis on effectiveness, efficiency and security – all vital attributes for sound web systems. By and large these are achieved through thoughtful design and careful implementation. Early chapters look at the best ways to handle some fundamental issues such as the automatic loading of code modules and interfaces to database systems. Digging deeper into the problems that are driven by web requirements, following chapters go deeply into session handling, caches, and access control. New for this edition is a chapter discussing the transformation of URLs to turn ugly query strings into readable strings that are believed to be more “search engine friendly” and are certainly more user friendly. This topic is then extended into a review of ways to handle “friendly” URLs without going through query strings, and how to build RESTful interfaces. The final chapter discusses the key issues that affect a wide range of specific content handlers and explores a practical example in detail.
Table of Contents (24 chapters)
PHP 5 CMS Framework Development
Second Edition
Credits
About the Author
Acknowledgement
About the Reviewers
Preface
Packaging Extensions
Packaging XML Example

Appendix B. Packaging XML Example

The following is the packaging XML for the Aliro login component, which includes user management:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE extinstall SYSTEM “http://aliro.org/xml/extinstall.dtd">
<extinstall type="application" version="2.0" userclass="loginUser" adminclass="loginAdmin">
<name>Aliro Login Application</name>
<formalname>com_login</formalname>
<version>2.0</version>
<description>This component provides user login</description>
<creationdate>2 January 2010</creationdate>
<author>Martin Brampton</author>
<authorurl>www.aliro.org</authorurl>
<authoremail>[email protected]</authoremail>
<copyright>Copyright (C) 2007 Martin Brampton</copyright>
<license>http://www.gnu.org/copyleft/gpl.html GNU/GPL</license>
<module userclass="loginServices,loginStrip">
<name>Minimal Login Strip Module</name>
<formalname>mod_login_strip</formalname>
<description>Provides a simple login strip with links to actions</description>
</module>
<module userclass="loginServices,loginBox">
<name>Login Box Module</name>
<formalname>mod_login_box</formalname>
<description>Provides a traditional login box</description>
<params>
<param name="pretext" type="textarea" cols="20" rows="5" default="" label="Pre-text" description="This is the Text or HTML that is displayed above the login form" />
<param name="posttext" type="textarea" cols="20" rows="5" label="Post-text" description="This is the Text or HTML that is displayed below the login form" />
<param name="login" type="text" default="" label="Login Redirection URL" description="What page will the login redirect to after login, if let blank will load front page" />
<param name="logout" type="text" default="" label="Logout Redirection URL" description="What page will the login redirect to after login, if let blank will load front page" />
<param name="login_message" type="radio" default="0" label="Login Message" description="Show/Hide the javascript Pop-up indicating Login Success">
<option value="0">Hide</option>
<option value="1">Show</option>
</param>
<param name="logout_message" type="radio" default="0" label="Logout Message" description="Show/Hide the javascript Pop-up indicating Logout Success">
<option value="0">Hide</option>
<option value="1">Show</option>
</param>
<param name="remember_me" type="radio" default="0" label="Remember Me" description="Show/Hide the Remember Me check box">
<option value="0">No</option>
<option value="1">Yes</option>
</param>
<param name="greeting" type="radio" default="1" label="Greeting" description="Show/Hide the simple greeting text">
<option value="0">No</option>
<option value="1">Yes</option>
</param>
<param name="name" type="list" default="0" label="Name/Username">
<option value="0">Username</option>
<option value="1">Name</option>
</param>
</params>
</module>
<module userclass="loginServices,whosonline">
<name>Who is online Module</name>
<formalname>mod_whosonline</formalname>
<description>Provides a display of who is currently online</description>
<params>
<param name="showmode" type="radio" default="0" label="Display" description="Select what shall be shown">
<option value="0"># of Guests/Members&lt;br&gt;</option>
<option value="1">Member Names&lt;br&gt;</option>
<option value="2">Both</option>
</param>
XMLpackaging, for Aliro login component<param name="moduleclass_sfx" type="text" default="" label="Module Class Suffix" description="A suffix to be applied to the css class of the module (table.moduletable), this allows individual module styling" />
</params>
</module>
<plugin userclass="loginPlugins" triggers="requiredLogin" published="yes">
<name>User Validationi</name>
<formalname>bot_uservalidation</formalname>
<description>Assists user authentication by validating user and password</description>
</plugin>
<urilink class="loginServices, avatar" published="yes" template="no" html="no">
<name>Provide avatar image</name>
<description>Behaves like an image</description>
<uri>users/[0-9]+/avatar</uri>
</urilink>
<urilink class="login_login_Controller, login" published="yes" template="yes" html="yes">
<name>Provide current user profile</name>
<description>Shows the user profile for the person logged on</description>
<uri>profile</uri>
</urilink>
<urilink class="login_loginpage_Controller, loginpage" published="yes" template="yes" html="yes">
<name>Provide a login or logout page</name>
<description>Shows the login page if not logged in, logout page if already logged in</description>
<uri>login</uri>
</urilink>
<urilink class="loginServices, logout" published="yes" template="yes" html="yes">
<name>Provide an immediate logout page</name>
<description>Shows the login page if not logged in, logout page if already logged in</description>
<uri>logout</uri>
</urilink>
<urilink class="login_profile_Controller, profile" published="yes" template="yes" html="yes">
<name>Provide any user profile</name>
<description>Shows the specified user profile</description>
<uri>profile/[0-9]+</uri>
</urilink>
<files>
XMLpackaging, for Aliro login component<filename>login.css</filename>
<filename>install_settings.php</filename>
</files>
<classfiles>
<filename classes="loginUser,loginUserControllers">
login.php</filename>
<filename classes="loginServices,loginPlugins,loginAPI">
login.services.php</filename>
<filename classes="login_Viewers">login.html.php</filename>
<filename classes="login_login_Controller">
c-classes/login_login_Controller.php</filename>
<filename classes="login_profile_Controller">
c-classes/login_profile_Controller.php</filename>
<filename classes="login_loginpage_Controller">
c-classes/login_loginpage_Controller.php</filename>
<filename classes="login_login_HTML">
v-classes/login_login_HTML.php</filename>
<filename classes="login_profile_HTML">
v-classes/login_profile_HTML.php</filename>
<filename classes="login_loginpage_HTML">
v-classes/login_loginpage_HTML.php</filename>
</classfiles>
<administration>
<classfiles>
<filename classes="loginAdmin">admin.login.php</filename>
<filename classes="loginAdminLogin">
c-admin-classes/loginAdminLogin.php</filename>
<filename classes="loginAdminConfig">
c-admin-classes/loginAdminConfig.php</filename>
<filename classes="loginAdminListHTML">
v-admin-classes/loginAdminListHTML.php</filename>
<filename classes="loginAdminEditHTML">
v-admin-classes/loginAdminEditHTML.php</filename>
<filename classes="loginAdminConfigHTML">
v-admin-classes/loginAdminConfigHTML.php</filename>
</classfiles>
<menu>Users</menu>
<submenu>
<menu act="config">Configure</menu>
</submenu>
XMLpackaging, for Aliro login component</administration>
</extinstall>