php and zend framework on windows

29
© All rights reserved. Zend Technologies, Inc . PHP Development & Deployment with Zend and Microsoft Roy Ganor Zend Studio Project Leader, Zend Technologies Shahar Evron Technical Product Manager, Zend Technologies

Upload: shahar-evron

Post on 12-May-2015

8.759 views

Category:

Technology


5 download

DESCRIPTION

A presentation given by Roy Ganor and myself at local Microsoft PHP developer day in Microsoft Israel, covering some general Zend info, Zend Framework, some Zend Studio and a bit about Windows Azure. The talk also included a lot of live demo and code review

TRANSCRIPT

Page 1: PHP and Zend Framework on Windows

©All rights reserved. Zend Technologies, Inc.

PHP Development & Deploymentwith Zend and Microsoft

Roy GanorZend Studio Project Leader, Zend Technologies

Shahar EvronTechnical Product Manager, Zend Technologies

Page 2: PHP and Zend Framework on Windows

©All rights reserved. Zend Technologies, Inc.2 PHP on Windows

Welcome!

• Agenda

Introductions

An Overview of the Zend Stack

Rapid Development with Zend Framework and Zend Studio

Running on Windows Platforms with Zend Server

A little bit of Cloud for dessert

Page 3: PHP and Zend Framework on Windows

©All rights reserved. Zend Technologies, Inc.3 PHP on Windows

Who are we?

• Shahar Evron

A PHP programmer since 2002

▶ At Zend since 2005

▶ A Zend Framework contributor since 2006▶ Maintain Zend_Http_Client

▶ Technical Product Manager for Zend Server▶ The marketing department’s pet geek :)

Page 4: PHP and Zend Framework on Windows

©All rights reserved. Zend Technologies, Inc.4 PHP on Windows

Who are we?

• Roy Ganor

Project Lead at Zend/Eclipse

Contributing to the following projects:• PHP Development Tools

• Ajax Tools

• Data Tools

• Dynamic Languages Tools

Tools Matter!

Page 5: PHP and Zend Framework on Windows

©All rights reserved. Zend Technologies, Inc.

Introducing Zend’s PHP StackWIMP? WAMP? LAMP? MAMP? Zend!

Page 6: PHP and Zend Framework on Windows

©All rights reserved. Zend Technologies, Inc.9 PHP on Windows

An Integrated, Heterogeneous Stack

Page 7: PHP and Zend Framework on Windows

©All rights reserved. Zend Technologies, Inc.

A Complete Solution

Page 8: PHP and Zend Framework on Windows

©All rights reserved. Zend Technologies, Inc.

The Production Side…

Clustering supportAggregated app monitoring

Cross-server job queuing

App monitoring & diagnosticsPage caching, job queuing

Support, updates and hot fixes

Data caching and opcode accelerationIntegrated, native installers

Web admin console

Page 9: PHP and Zend Framework on Windows

©All rights reserved. Zend Technologies, Inc.

And the Development Side

Zend Server integrationZend Framework integrationTeam developmentTesting and debuggingSupport and updates

Basic code editingBasic debuggingEclipse plug-in

Page 10: PHP and Zend Framework on Windows

©All rights reserved. Zend Technologies, Inc.13 PHP on Windows

Introducing the Eclipse Foundation

A consortium of major software vendors, solution providers, corporations, educational and research institutions and individuals working together to create an eco-system that enhances, promotes and cultivates the Eclipse open platform with complementary products, services and capabilities

Page 11: PHP and Zend Framework on Windows

©All rights reserved. Zend Technologies, Inc.14 PHP on Windows

The Ecosystem

Page 12: PHP and Zend Framework on Windows

©All rights reserved. Zend Technologies, Inc.15 PHP on Windows

Eclipse Simultaneous Release

2005 2006 2007 2008 2009

6Projects

10Projects

21Projects

23Projects

33Projects

Page 13: PHP and Zend Framework on Windows

©All rights reserved. Zend Technologies, Inc.16 PHP on Windows

Zend Contribution

• PHP Development Tools

• Ajax Tools

• Dynamic Languages Tools

• Data Tools

Page 14: PHP and Zend Framework on Windows

©All rights reserved. Zend Technologies, Inc.

Introducing Zend Framework

Page 15: PHP and Zend Framework on Windows

©All rights reserved. Zend Technologies, Inc.18 PHP on Windows

Introducing Zend Framework

• Some History:Started as part of the PHP Collaboration Project in late ‘05

First public release: 0.2, Early ‘06

1.0 Released on July 2007

Currently in version 1.10 (today!)

Zend Framework 2.0 planning process started

• Open-source, business-friendly licensing

• Emphasis on high-quality, loose coupling and simplifying creation of modern Web Applications

Page 16: PHP and Zend Framework on Windows

©All rights reserved. Zend Technologies, Inc.

Zend Framework Rapid Adoption Continues

• Rapidly Growing Over 10M downloads

Over 200 contributors

• Commercial Contributions

• Enterprise Adoption

Page 17: PHP and Zend Framework on Windows

©All rights reserved. Zend Technologies, Inc.20 PHP on Windows

Is it really a framework?

• Zend Framework is: A Full Stack Application Framework ?

A Component Library ?

Both!

• Use-at-will Architecture Loose coupling between components

Pick and choose the components you need and use them with your own app or with a different framework

Build your application from the group up based on ZF’s MVC

Page 18: PHP and Zend Framework on Windows

©All rights reserved. Zend Technologies, Inc.21 PHP on Windows

Example: Zend_Mail

• Allows you to easily compose and send e-mail messages from your PHP applications Simplified control over recipients, headers, etc.

Easy creation of multipart/alternative HTML messages

Easy attachment handling

Supports different delivery transports

• Allows you to read e-mail messages from POP3, IMAP, Mbox and Maildir not demonstrated here :)

Page 19: PHP and Zend Framework on Windows

©All rights reserved. Zend Technologies, Inc.22 PHP on Windows

Example: Zend_Mail – Sending a message

// Load the Zend_Mail classrequire_once 'Zend/Mail.php';

// Instantiate a new message object$message = new Zend_Mail('utf-8');

// Use the fluent interface to set message properties$message->setFrom('[email protected]', 'Shahar E') ->setSubject('Hello, world!') ->setBodyText("Hi, what's up?") ->addHeader('Importance', 'high') ->addTo('[email protected]', 'Some One') ->addCc('[email protected]', 'Other Guy') ->addBcc('[email protected]', 'The Third Person'); // Send the message!$message->send();

Page 20: PHP and Zend Framework on Windows

©All rights reserved. Zend Technologies, Inc.23 PHP on Windows

Example: Zend_Mail – Adding Attachments

// Load the Zend_Mail classrequire_once 'Zend/Mail.php';

// Instantiate a new message object$message = new Zend_Mail('utf-8');

// Use the fluent interface to set message properties$message->setFrom(‘[email protected]', ‘Report System') ->setSubject('The report you have requested is ready') ->addTo('shahar@localhost', 'Shahar Evron'); // Add a PDF attachment (Will be base64 encoded)$pdf = $message->createAttachment(

file_get_contents('report.pdf'));$pdf->type = 'application/pdf';$pdf->filename = 'report.pdf';

// ... Continued on next slide ...

Page 21: PHP and Zend Framework on Windows

©All rights reserved. Zend Technologies, Inc.24 PHP on Windows

Example: Zend_Mail – Adding Attachments

// Add a logo to the message - referenced from the message HTML body$img = $message->createAttachment(file_get_contents('logo.png'));$img->type = 'image/png';$img->id = '[email protected]';$img->filename = 'logo.png';$img->disposition = Zend_Mime::DISPOSITION_INLINE;

// Set the message body$message->setBodyHtml( "Hello Shahar,<br /><br />" . "The report you have requested is attached as a PDF file.<br /><br />" . "Enjoy!<br />" . '<img src="cid:[email protected]" alt="Example.com Logo" />');

// Set the message MIME-type to multipart/related$message->setType(Zend_Mime::MULTIPART_RELATED);

// Send the message!$message->send();

Page 22: PHP and Zend Framework on Windows

©All rights reserved. Zend Technologies, Inc.25 PHP on Windows

Example: Zend_Mail – Adding Attachments

Page 23: PHP and Zend Framework on Windows

©All rights reserved. Zend Technologies, Inc.

Zend Framework – (Some) Components

26 PHP on Windows

Core

Registry

Log

Mail

Uri

Cache

Config

MVC

Controller

Layout

View

Application

Formats & Data AccessDb

Search

Json

Dom_Query

Ldap Feed

Web Services

XmlRpc

Rest

Soap

Http_Client

InfoCard

Yahoo Flickr

Twitter

Amazon

Akismet

Web Infrastructure

Session

Form

Tag

Internationalization

Locale

Currency

Translate

Measure

Loader Date

Security

Auth

Filter

Acl

Validate

OpenId Captcha

Navigation

ProgressBar

Dojo

Amf Queue

Development

Tool

Debug

WildFire

TestDelicious …

Page 24: PHP and Zend Framework on Windows

©All rights reserved. Zend Technologies, Inc.

Zend Framework and Zend StudioDemo Time!

Page 25: PHP and Zend Framework on Windows

©All rights reserved. Zend Technologies, Inc.33 PHP on Windows

Windows Azure Table Storage

• A Highly Scalable Cloud Database Billions of records, terabytes of data

• “Entities” and “Properties”

• Not exactly a relational database

• ACID (Atomic, Consist, Isolated, Durable) Transactions

• Query syntax somewhat reminding SQL (but not really)

• Schema-less some structure can be enforced in client side

• Can be partitioned across servers

Page 26: PHP and Zend Framework on Windows

©All rights reserved. Zend Technologies, Inc.

RecapWhat? Are we done so quickly!?

Page 27: PHP and Zend Framework on Windows

©All rights reserved. Zend Technologies, Inc.35 PHP on Windows

What have we learned?

• PHP Is Everywhere! PHP Is on Windows! No more excuses not to use it! :)

• PHP can become even more effective with the right tools

Get an IDE and use it’s capabilities

Get the framework that fits your needs, study it, and utilize it

Standardize on a runtime environment

• Plan for the future, if you’re successful it will hit you fast!

Plan for scaling

Production Monitoring & Reliability, Moving to the Cloud

Page 28: PHP and Zend Framework on Windows

©All rights reserved. Zend Technologies, Inc.

Thanks!Still have questions?

[email protected] or @royganor

[email protected] or @shevron

Page 29: PHP and Zend Framework on Windows

©All rights reserved. Zend Technologies, Inc.37 PHP on Windows

Tips & Tricks

• Keep your slides clean: Avoid using more than 5 bullets

Try to keep your bullets as short as possible

• Why?People usually don’t read slides with a lot of text

Easier to memorize

Highlighted text can be displayed here