48
Copyright © 2007, Zend Technologies Inc. ‘The ZF 1.5 Traveling Roadshow’ Wil Sinclair, Zend Development Manager – wil /at/ zend /dot/ com Bradford Cottel, Zend Evangelist – brad /at/ zend /dot/ com ZEND FRAMEWORK 1.5 LATEST FEATURES

San Francisco PHP Meetup Presentation on Zend Framework

  • Upload
    zend

  • View
    40.179

  • Download
    1

Embed Size (px)

Citation preview

Page 1: San Francisco PHP Meetup Presentation on Zend Framework

Copyright © 2007, Zend Technologies Inc.

‘The ZF 1.5Traveling Roadshow’

Wil Sinclair, Zend Development Manager – wil /at/ zend /dot/ com

Bradford Cottel, Zend Evangelist – brad /at/ zend /dot/ com

ZEND FRAMEWORK 1.5 LATEST FEATURES

Page 2: San Francisco PHP Meetup Presentation on Zend Framework

Zend Framework 1.5 Latest Features | 2

ZEND FRAMEWORK 1.5

• Why Zend Framework?

• Users, press, books: media coverage

• Downloads / distribution of your APIs

• Want to contribute to Zend Framework?

• Other contributors

• Major features & benefits for ZF 1.5 and let’s code w/it (Wil)

Page 3: San Francisco PHP Meetup Presentation on Zend Framework

Copyright © 2007, Zend Technologies Inc.

WHYZEND

FRAMEWORK?

COLLABORATIONPROJECTHISTORY

Page 4: San Francisco PHP Meetup Presentation on Zend Framework

Zend Framework 1.5 Latest Features | 4

PHP Collaboration Project—genesis of ZF +

SOA,Web

Services,etc.

SOA,Web

Services,etc.

OpenSourceOpen

Source

CommunityCommunity

PHPLanguage

PHPLanguage

OpenIDE

OpenIDE

BestPractices

BestPractices

PHP Framework

PHP Framework

Page 5: San Francisco PHP Meetup Presentation on Zend Framework

Zend Framework—In a nutshell

The leading open-source PHP framework has a flexible architecture that lets you easily build modern web

applications and web services

Zend Framework 1.5 Latest Features

Page 6: San Francisco PHP Meetup Presentation on Zend Framework

| 6

ZEND FRAMEWORK ADVANTAGES

• Best Practices—As an exemplar ZF is best practice.

• Productive—reuse code quickly and often.

• Simple & Easy—just like PHP, ZF is easy to adopt.

• Extensible & Flexible—customize & add your value.

• High Quality—rigorously tested + built-in tests to use.

• Friendly License—new BSD = reuse code however you like; Apache-like CLA = safety for corporations.

• Modern—web services, syndication, AJAX, search, +

Zend Framework 1.5 Latest Features

Page 7: San Francisco PHP Meetup Presentation on Zend Framework

| 7

ZEND FRAMEWORK FACTS

• 400+ registered contributors• Large enterprise contributors• 140,000 lines of PHP code• 87,000 words of documentation

translated into 5 major languages• Over 500 code examples in ZF Reference Guide• As of 01-Mar-2008:

4,000,000+ raw downloads, 500,000+ uniques

Zend Framework 1.5 Latest Features

Page 8: San Francisco PHP Meetup Presentation on Zend Framework

Copyright © 2007, Zend Technologies Inc.

USERS, PRESS, AND BOOKS:ZF NEWS

Page 9: San Francisco PHP Meetup Presentation on Zend Framework

Others:

| 9

SELECTED ZEND FRAMEWORK USERS

Zend Framework 1.5 Latest Features

Page 10: San Francisco PHP Meetup Presentation on Zend Framework

| 10

PRESS COVERAGE

Zend Framework 1.5 Latest Features

Page 11: San Francisco PHP Meetup Presentation on Zend Framework

| 11

ZEND FRAMEWORK BOOKS

Zend Framework 1.5 Latest Features

Page 12: San Francisco PHP Meetup Presentation on Zend Framework

Copyright © 2007, Zend Technologies Inc.

DOWNLOAD TRENDS & FRAMEWORK COMPONENTS

OUR FOCUS:WEB SERVICES

Page 13: San Francisco PHP Meetup Presentation on Zend Framework

| 13

ZEND FRAMEWORK — DOWNLOADS

Total (raw) downloads 4.1 million+ Total (net) “uniques”

506,000+Zend Framework Downloads

(Q1 2008 projected: Jan-Feb x 1.5)

0

25,000

50,000

75,000

100,000

125,000

Q1-2006 Q2-2006 Q3-2006 Q4-2006 Q1-2007 Q2-2007 Q3-2007 Q4-2007 Q1-2008

Quarter

Net

Do

wn

load

s

0

250,000

500,000

750,000

1,000,000

1,250,000

Raw

Do

wn

load

s

Net

Raw

Zend Framework 1.5 Latest Features

Page 14: San Francisco PHP Meetup Presentation on Zend Framework

| 14

ZEND FRAMEWORK – COMPONENTS

Zend Framework 1.5 Latest Features

Page 15: San Francisco PHP Meetup Presentation on Zend Framework

Copyright © 2007, Zend Technologies Inc.

WOULD YOU LIKE TO CONTRIBUTE TO

ZEND FRAMEWORK?

Page 16: San Francisco PHP Meetup Presentation on Zend Framework

| 16

CONTRIBUTION PROCESS

•Community member contributes to Zend Framework

•Community-at-large and core team review contribution

•Revised, taken into “lab,” or OK’d for “incubator”

•Code is integrated & tested with Zend Framework

•Code is built into Zend Framework and becomes a part of core

Zend Framework 1.5 Latest Features

Page 17: San Francisco PHP Meetup Presentation on Zend Framework

| 17

BSD LICENSE ~ That’s it, the whole thing

New BSD License

Copyright (c) 2006-2007, Zend Technologies USA, Inc.All rights reserved.

Redistribution and use in source and binary forms, with or without modification,are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

* Neither the name of Zend Technologies USA, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ANDANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIEDWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AREDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FORANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ONANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THISSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Zend Framework 1.5 Latest Features

Page 18: San Francisco PHP Meetup Presentation on Zend Framework

| 18

CONTRIBUTOR LICENSE AGREEMENTApache-like ~ well-respected

• You retain rights to other uses - This license is for your protection as a Contributor as well as the protection of Zend and its users; it does not change your rights to use your own Contributions for any other purpose. You reserve all right, title, and interest in and to Your Contributions.

• This is your original contribution - You represent that each of Your Contributions is Your original creation

• You can submit other open-source code, but must justify - Should You wish to submit work that is not Your original creation, You may submit it to the Company separately from any Contribution, identifying the complete details of its source and of any license or other restriction (patents or copyright).

• You don’t have to provide support for your contribution, but you can, if you wish -You are not expected to provide support for Your Contributions, except to the extent You desire to provide support. You may provide support for free, for a fee, or not at all.

Zend Framework 1.5 Latest Features

Page 19: San Francisco PHP Meetup Presentation on Zend Framework

Copyright © 2007, Zend Technologies Inc.

OTHERCURRENTPARTNERS

Page 20: San Francisco PHP Meetup Presentation on Zend Framework

| 20

CURRENT APIs & WEB SERVICES

“We have created a StrikeIron API in Zend Framework because of its Web services consumption capabilities and the momentum it is experiencing as a platform for developing Web applications. This makes it extremely easy for PHP developers to access multiple StrikeIron services in a consistent way, greatly extending the capabilities of Web apps that utilize Zend Framework.”

— Bob Brauer, CEO StrikeIron

Web Services we include as a part of Zend Framework:

simpy del.icio.us

Our Technology Partners:

Zend Framework 1.5 Latest Features

Page 21: San Francisco PHP Meetup Presentation on Zend Framework

| 21

VENDOR APIs IN ZEND FRAMEWORK

Zend Framework 1.5 Latest Features

Page 22: San Francisco PHP Meetup Presentation on Zend Framework

Copyright © 2007, Zend Technologies Inc.

THE DEVELOPER’S FRAMEWORK

THINGS YOU SHOULD KNOW +

LET’S LOOK AT SOME CODE

Page 23: San Francisco PHP Meetup Presentation on Zend Framework

| 23

10 Things Every Developer Should Know about Zend Framework

1. Use-at-will architecture2. Convention AND configuration3. Object Oriented, and not ashamed of it4. Web Services are first-class citizens5. It’s backed by Zend (well, duh!)6. Ajax is not an afterthought7. Only pure PHP implementation of Lucene8. A huge community that is just an email away9. Identity 2.010.Documentation up the wazoo

And just in case you forget one of those. . .

• Hosting will not be a problem• We would never force a technology down your

throat

Zend Framework 1.5 Latest Features

Page 24: San Francisco PHP Meetup Presentation on Zend Framework

| 24

How to Convince your Boss

• License and CLA policy couldn’t be more business-friendly

• Training• Support• Certification• Enterprise features like LDAP and SOAP• It’s used by gi-normous multi-national

corporations, so it must be good enough for us

• PHP has been proven to reduce stress• It’s not just backed by Zend, it’s backed by

a who’s-who of technology partners

Zend Framework 1.5 Latest Features

Page 25: San Francisco PHP Meetup Presentation on Zend Framework

| 25

New Features in 1.5

• Zend_Form• Zend_Layout• LDAP Authentication• Open ID• Infocard• Advanced Lucene Queries• UTF-8 Support in Zend_Pdf• New Gdata API’s for YouTube, GBase, etc.• Zend_Build and CLI Tooling?• Take a Look for Yourself:

http://framework.zend.com/issues/secure/IssueNavigator.jspa?requestId=10661

Zend Framework 1.5 Latest Features

Page 26: San Francisco PHP Meetup Presentation on Zend Framework

| 26

Zend_Form Teaser

Zend Framework 1.5 Latest Features

• Base classes forms elements display groups sub forms

• Plugins filters validators decorators elements

• Utilities plugin loaders translators

Architecture

Page 27: San Francisco PHP Meetup Presentation on Zend Framework

| 27

Zend_Form Teaser

Zend Framework 1.5 Latest Features

Zend_Form

• Model Forms Store and manipulate collections of elements and

groups of elements Validate attached elements and sub forms Store and manipulate decorators for rendering the

form

Page 28: San Francisco PHP Meetup Presentation on Zend Framework

| 28

Zend_Form Teaser

Zend Framework 1.5 Latest Features

• Store and manipulate element metadata

• Store and manipulate validator chains

• Store and manipulate filter chains

• Store and manipulate decorators for rendering element

• Base class: Zend_Form_Element

• Element types: Button Checkbox Hash (CSRF protection) Hidden Image MultiCheckbox Multiselect Password Radio Reset Select Submit Text Textarea

Zend_Form_Element

Page 29: San Francisco PHP Meetup Presentation on Zend Framework

| 29

Zend_Form Teaser

Zend Framework 1.5 Latest Features

• Group elements visually when rendering• Collection of one or more elements• Order display group in form, and elements

within display group

Zend_Form_DisplayGroup

Page 30: San Francisco PHP Meetup Presentation on Zend Framework

| 30

Zend_Form Teaser

Zend Framework 1.5 Latest Features

• Group elements logically For display purposes For validation purposes

• Potential uses Multi-page forms (each sub form used per page) Dynamic forms (e.g., todo list, where each todo

item is it's own mini-form)

Zend_Form_SubForm

Page 31: San Francisco PHP Meetup Presentation on Zend Framework

| 31

Zend_Form Teaser

Zend Framework 1.5 Latest Features

• Utilizes Zend_Loader_PluginLoader for loading plugin classes

• Specify alternate class prefixes and paths to load: new plugins alternate versions of standard plugins

• Powerful and easy way to extend Zend_Form functionality

Plugins

Page 32: San Francisco PHP Meetup Presentation on Zend Framework

| 32

Zend_Form Teaser

Zend Framework 1.5 Latest Features

• Normalize or filter input prior to validation

• Uses Zend_Filter classes by default

• Some available filters: Alnum Alpha Digits HtmlEntities StringToLower StringToUpper StringTrim StripTags

Plugins: Filters

Page 33: San Francisco PHP Meetup Presentation on Zend Framework

| 33

Zend_Form Teaser

Zend Framework 1.5 Latest Features

• Validate input against one or more rules

• Uses Zend_Validate classes by default

• Some available validators: Alnum Alpha Date EmailAddress InArray Int Regex StringLength

Plugins: Validators

Page 34: San Francisco PHP Meetup Presentation on Zend Framework

| 34

Zend_Form Teaser

Zend Framework 1.5 Latest Features

• Render elements and forms by decorating them

• Uses pseudo-Decorator pattern

• More later...

• Some available decorators: Callback Description Errors Fieldset Form HtmlTag Label ViewHelper ViewScript

Plugins: Decorators

Page 35: San Francisco PHP Meetup Presentation on Zend Framework

| 35

Zend_Form Teaser

Zend Framework 1.5 Latest Features

• Elements are loaded as plugins in Zend_Form• You can create your own versions of standard

elements, and still utilize Zend_Form's element factory methods

Plugins: Elements!

Page 36: San Francisco PHP Meetup Presentation on Zend Framework

| 36

Zend_Form Teaser

Zend Framework 1.5 Latest Features

• Plugin Loaders Load plugins Register class prefixes and paths

• Translators Zend_Translate and its adapters Translate error messages and other translatable

items

Utilities

Page 37: San Francisco PHP Meetup Presentation on Zend Framework

| 37

Zend_Form Teaser

Zend Framework 1.5 Latest Features

The Login Form

Page 38: San Francisco PHP Meetup Presentation on Zend Framework

| 38

Zend_Form Teaser

Zend Framework 1.5 Latest Features

Create elements: Username:

• Multiple filters (filter chain!)• Multiple validators (validator chain!)• Required• Don't forget the label!

Page 39: San Francisco PHP Meetup Presentation on Zend Framework

| 39

Zend_Form Teaser

Zend Framework 1.5 Latest Features

Create elements: Password

• Single filter• Single validator• Required• Don't forget the label!

Page 40: San Francisco PHP Meetup Presentation on Zend Framework

| 40

Zend_Form Teaser

Zend Framework 1.5 Latest Features

Create elements: the Login button

• Need to display the button• But we don't want to validate it or

include it when pulling values

Page 41: San Francisco PHP Meetup Presentation on Zend Framework

| 41

Zend_Form Teaser

Zend Framework 1.5 Latest Features

Create the Form object:

• Attach elements• Check if valid – does all input

filtering• Pass it to the view

Page 42: San Francisco PHP Meetup Presentation on Zend Framework

| 42

Zend_Form Teaser

Zend Framework 1.5 Latest Features

Create the view script:

• Much shorter!

Page 43: San Francisco PHP Meetup Presentation on Zend Framework

| 43

Zend_Form Teaser

Zend Framework 1.5 Latest Features

And. . . Viola!

Page 44: San Francisco PHP Meetup Presentation on Zend Framework

| 44

Zend_Form Teaser

Zend Framework 1.5 Latest Features

Results when submitting empty values:

• Note: required flag has a correlation with the errors reported

Page 45: San Francisco PHP Meetup Presentation on Zend Framework

| 45

Zend_Form Teaser

Zend Framework 1.5 Latest Features

Results when submitting invalid values:

• Note: errors are reported!

Page 46: San Francisco PHP Meetup Presentation on Zend Framework

| 46

What the Future Holds for ZF

• We go medieval on the documentation• Zend_Build and CLI• Ajax like you’ve never seen before• Deep integration with all your favorite tools

and platforms, starting with Zend Studio, Platform, and Core

• Developer tools and packaging for distributing 3rd party components

• More partnerships to bring the latest must-have technology to you straight from the horse’s mouth

• Improved proposal process and even more transparency for our community

• More best practices, more features, more fun!

Zend Framework 1.5 Latest Features

Page 47: San Francisco PHP Meetup Presentation on Zend Framework

| 47

Want to Know More?

Zend Framework 1.5 Latest Features

Keep your eye on:

http://framework.zend.com/

Page 48: San Francisco PHP Meetup Presentation on Zend Framework

Copyright © 2007, Zend Technologies Inc.

THANKS !