Chapter Ideas ============= Rails 3 ------- 1. Building Your First Rails 3.0 Application 2. Overview of the Rails stack(s) + architecture 3. Creating Rails Applications 4. Using DataMapper for Models 5. Using ActiveRecord for Models 6. Other Choices for Models 7. Processing Requests 8. Routing in Rails 3 9. Customizing Views 10. Working on the Client Side 11. Supporting Characters 12. Using the Plugin API 13. Testing Your Applications 14. Deploying a Rails Application 15. Scaling Rails Django 1 -------- # Chapter 1: Introduction to Django # Chapter 2: Getting Started # Chapter 3: The Basics of Dynamic Web Pages # Chapter 4: The Django Template System # Chapter 5: Interacting with a Database: Models # Chapter 6: The Django Administration Site # Chapter 7: Form Processing # Chapter 8: Advanced Views and URLconfs # Chapter 9: Generic Views # Chapter 10: Extending the Template Engine # Chapter 11: Generating Non-HTML Content # Chapter 12: Sessions, Users, and Registration # Chapter 13: Caching # Chapter 14: Other Contributed Subframeworks # Chapter 15: Middleware # Chapter 16: Integrating with Legacy Databases and Applications # Chapter 17: Extending Django's Admin Interface # Chapter 18: Internationalization # Chapter 19: Security # Chapter 20: Deploying Django # Appendix A: Case Studies # Appendix B: Model Definition Reference # Appendix C: Database API Reference # Appendix D: Generic View Reference # Appendix E: Settings # Appendix F: Built-in Template Tags and Filters # Appendix G: The django-admin Utility # Appendix H: Request and Response Objects Django 2 -------- # Chapter 1: Introduction to Django # Chapter 2: Getting Started # Chapter 3: Views and URLconfs # Chapter 4: Templates # Chapter 5: Models # Chapter 6: The Django Admin Site # Chapter 7: Forms # Chapter 8: Advanced Views and URLconfs # Chapter 9: Advanced Templates # Chapter 10: Advanced Models # Chapter 11: Generic Views # Chapter 12: Deploying Django # Chapter 13: Generating Non-HTML Content # Chapter 14: Sessions, Users, and Registration # Chapter 15: Caching # Chapter 16: django.contrib # Chapter 17: Middleware # Chapter 18: Integrating with Legacy Databases and Applications # Chapter 19: Internationalization # Chapter 20: Security Zend Framework: Surviving The Deep End -------------------------------------- 1. Introduction 1.1. The Zend Framework 1.2. About This Book 1.2.1. Obtaining The Source Code For Chapters 1.3. Me, Me, Me! 1.4. You, You, You! 2. The Architecture of Zend Framework Applications 2.1. Introduction 2.2. The Model-View-Controller 2.2.1. The View 2.2.2. The Controller 2.2.3. The Model 2.3. In Review 2.4. Conclusion 3. The Model 3.1. Introduction 3.2. Clarifying The Model 3.3. In Programming, Fat Models Are Preferable To Size Zero Models 3.4. The Fat Stupid Ugly Controller 3.5. Controllers Are Not The Data Police 3.6. Conclusion 4. Installing The Zend Framework 4.1. Introduction 4.2. Before You Install The Framework 4.3. Getting The Zend Framework 4.3.1. Download As Compressed Archive File 4.3.2. Checkout From Subversion 4.3.3. Download As A Linux Distribution Package 4.3.4. Nightly Build Download 4.4. Post Installation 5. A Not So Simple Hello World Tutorial 5.1. Introduction 5.2. Step 1: Creating A New Local Domain 5.3. Step 2: Creating A Project Directory Structure 5.4. Step 3: Implement Application Bootstrapping 5.5. Step 4: The Only Way In, The Index File 5.6. Step 5: Adding A Default Controller and View 5.7. Conclusion 6. Standardise The Bootstrap Class With Zend_Application 6.1. Introduction 6.2. Step 1: Editing the ZFExt_Bootstrap Class 6.3. Step 2: Editing The Index and htaccess Files 6.4. Step 3: Adding The Application Configuration File 6.5. Step 4: Handling Setting Of Standard Component Defaults 6.6. Step 5: Fixing ZFExt_Bootstrap 6.7. Step 6: Integrating Application Configuration Into Resource Methods 6.8. Step 7: Optimising Autoloading Code 6.9. Allowing Zend_Loader_Autoload Load Namespaced Classes 6.10. Conclusion 7. Handling Application Errors Gracefully 7.1. Introduction 7.2. The ErrorController and Error View 7.3. Well, That Didn't Work... 7.4. Not All Errors Are Equal 7.5. Conclusion 8. Developing A Blogging Application 8.1. Introduction 8.2. Planning 8.3. Incremental Development and YAGNI 8.4. Checking Our Toolbox 8.5. This Is Not The Reference Guide 9. Implementing The Domain Model: Entries and Authors 9.1. Introduction 9.2. The Domain Model and Database Access Patterns 9.3. Exploring The Domain Objects 9.4. Exploring The Entry Data Mapper 9.5. Assessing Implementation Tools 9.5.1. Domain Objects 9.5.2. Validation And Filtering Rules 9.5.3. Database Access 9.6. Implementation 9.6.1. Adding Unit Tests For Execution 9.6.2. The Domain Objects 9.6.3. The Data Mappers 9.6.4. Lazy Loading Domain Objects 9.6.5. Preventing Duplicate Entities With An Identity Map 9.7. Conclusion 10. Setting The Design With Zend_View, Zend_Layout, HTML 5, and Yahoo! User Interface Library 10.1. Introduction 10.2. Zend_View: Object Oriented Templating 10.2.1. Layouts 10.2.2. Partials 10.2.3. View Helpers 10.2.4. Placeholders 10.2.5. Short Tags vs Full Tags 10.3. The ZFBlog Application Setup 10.4. Creating An Index Page With HTML 5 10.5. Extracting Static Markup Into A Layout 10.6. Replacing Changeable Elements With Placeholders 10.7. Improving HTML 5 Support With Custom View Helpers 10.8. Adding A Link To A Custom Stylesheet 10.9. Customising The Style 10.10. Conclusion A. Creating A Local Domain Using Apache Virtual Hosts A.1. Introduction A.2. Configuring Apache With Virtual Hosts A.3. Configuring Local HOSTS File A.4. Conclusion B. Performance Optimisation For Zend Framework Applications B.1. Introduction B.2. Avoid Premature Optimisation B.3. Measuring Performance B.3.1. Memory and CPU Measurement B.3.2. Requests Per Second B.4. Pinpointing The Cause Of Poor Performance B.4.1. Code Profiling B.4.2. Database Operations Analysis B.5. General PHP Optimisation B.5.1. Opcode Caching B.5.2. Realpath Cache B.6. General Zend Framework Optimisation B.6.1. Class Loading Optimisation B.6.2. Configuring Default Caches B.6.3. Cache At The Right Level B.6.4. Minimising Include Paths B.7. HTTP Server Optimisation B.7.1. Optimising Apache's Configuration B.7.2. Avoiding Apache Completely B.8. Conclusion C. Copyright Information C.1. Copyright C.2. Licensing Zend Framework In Action ------------------------ Preface Acknowledgments About this book About the cover illustration Part 1: The essentials Chapter 1. Introducing Zend Framework Section 1.1. Introducing Structure to PHP Websites Section 1.2. Why Use Zend Framework? Section 1.3. What is Zend Framework? Section 1.4. Zend Framework Design Philosophy Section 1.5. Alternative PHP Frameworks Section 1.6. Summary Chapter 2. Hello Zend Framework! Section 2.1. The Model-View-Controller Design Pattern Section 2.2. The Anatomy of a Zend Framework Application Section 2.3. Hello World: File by File Section 2.4. How MVC Applies to Zend Framework Section 2.5. Summary Part 2: A Core Application Chapter 3. Building a website with Zend Framework Section 3.1. Initial Planning of a Website Section 3.2. Initial Coding Section 3.3. The Home Page Section 3.4. Summary Chapter 4. Managing the view Section 4.1. Introducing the Two Step View and Composite View Patterns Section 4.2. View Handling with Zend_Layout Section 4.3. Integrating Zend_Layout into Places Section 4.4. Advanced View Helpers Section 4.5. Summary Chapter 5. Ajax Section 5.1. Introducing Ajax Section 5.2. A simple Ajax Example Section 5.3. Using Ajax Client Libraries Section 5.4. Using Ajax with Zend Framework Section 5.5. Integrating into a Zend Framework Application Section 5.6. Summary Chapter 6. Managing the database Section 6.1. Database Abstraction with Zend_Db_Adapter Section 6.2. Table Abstraction with Zend_Db_Table Section 6.3. Using Zend_Db_Table as a Model Section 6.4. Summary Chapter 7. User authentication and access control Section 7.1. Introducing Authentication and Access Control Section 7.2. Implementing Authentication Section 7.3. Using Zend_Auth in a Real Application Section 7.4. Implementing Access Control Section 7.5. Summary Chapter 8. Forms Section 8.1. Introducing Zend_Form Section 8.2. Building a Login Form Section 8.3. Filtering and Validation Section 8.4. Decorating Our Login Form Section 8.5. Summary Chapter 9. Searching Section 9.1. Benefits of Search Section 9.2. Introducing Zend_Search_Lucene Section 9.3. Adding Search to Places Section 9.4. Summary Chapter 10. Email Section 10.1. The Basics of Email Section 10.2. Introducing Zend_Mail Section 10.3. Building a Support Tracker for Places Section 10.4. Reading Email Section 10.5. Summary Chapter 11. Deployment Section 11.1. Setting up the Server Section 11.2. Version Control with Subversion Section 11.3. Functional Testing Section 11.4. Scripting the deployment Section 11.5. Summary Part 3: More Power to Your Application Chapter 12. Talking with other applications Section 12.1. Integrating Applications Section 12.2. Producing and Consuming Feeds with Zend_Feed Section 12.3. Making RPCs with Zend_XmlRpc Section 12.4. Using REST Web Services with Zend_Rest Section 12.5. Summary Chapter 13. Mashups with public web services Section 13.1. Accessing Public Web Services Section 13.2. Displaying ads with Amazon Web Services Section 13.3. Displaying Pictures from Flickr Section 13.4. Using Zend_Gdata for Google Access Section 13.5. Summary Chapter 14. Caching: making it faster Section 14.1. Benefits of Caching Section 14.2. How Caching Works Section 14.3. Implementing Zend_Cache Section 14.4. Caching at Different Application Levels Section 14.5. Cache Tags Section 14.6. Summary Chapter 15. Internationalization and localization Section 15.1. Translating Languages and Idioms Section 15.2. Using Zend_Locale and Zend_Translate Section 15.3. Adding a Second Language to the Places Application Section 15.4. Summary Chapter 16. Creating PDFs Section 16.1. Zend_Pdf Basics Section 16.2. Building a PDF Report Generator Section 16.3. Drawing Text on the Page Section 16.4. Working with Color Section 16.5. Using Styles Section 16.6. Drawing Shapes Section 16.7. Rotating Objects Section 16.8. Adding Images to the Page Section 16.9. Drawing Objects within Clipping Masks Section 16.10. Generating PDF Reports Section 16.11. Summary Apppendices Appendix A. A whistle-Stop Tour of PHP Syntax Section A.1. PHP Fundamentals Section A.2. Variables and Types Section A.3. Conditionals and Loops Section A.4. Functions Section A.5. Summary Appendix B. Object-Oriented PHP Section B.1. Object Orientation in PHP Section B.2. The SPL Section B.3. PHP4 Section B.4. Software Design Patterns Section B.5. Summary Appendix C. Tips and tricks C.1 MVC Tips and Tricks C.2 Diagnostics with Zend_Log and Zend_Debug C.3 Zend_Db_Profiler C.4 Summary