Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

PHP and Zend Framework on Windows


Published on

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

Published in: Technology
  • Be the first to comment

PHP and Zend Framework on Windows

  1. 1. PHP Development & Deploymentwith Zend and Microsoft<br />Roy GanorZend Studio Project Leader, Zend Technologies<br />Shahar EvronTechnical Product Manager, Zend Technologies<br />
  2. 2. Welcome!<br />Agenda<br />Introductions<br />An Overview of the Zend Stack<br />Rapid Development with Zend Framework and Zend Studio<br />Running on Windows Platforms with Zend Server<br />A little bit of Cloud for dessert<br />2<br />PHP on Windows<br />
  3. 3. Who are we?<br />Shahar Evron<br />A PHP programmer since 2002<br /><ul><li>At Zend since 2005
  4. 4. A Zend Framework contributor since 2006
  5. 5. Maintain Zend_Http_Client
  6. 6. Technical Product Manager for Zend Server
  7. 7. The marketing department’s pet geek :)</li></ul>3<br />PHP on Windows<br />
  8. 8. Who are we?<br />Roy Ganor<br />Project Lead at Zend/Eclipse<br />Contributing to the following projects:<br />PHP Development Tools<br />Ajax Tools<br />Data Tools<br />Dynamic Languages Tools<br />Tools Matter!<br />4<br />PHP on Windows<br />
  9. 9. PH What?<br />Isn’t that like the hacker alternative to ASP.NET??!?<br />
  10. 10. Over one-third of the Web runs on PHP<br />6<br />PHP on Windows<br />
  11. 11. PHP is rapidly becoming a standard for mainstream web-based business applications<br />Corporate IT Developers<br />Part-Time Developers<br />And Hobbyists<br />Independent Software Vendors<br />6<br />5<br />4<br />3<br />2<br />1<br />0<br />Programmers (Millions)<br />2006<br />2007<br />2008<br />2009<br />2010<br />2011<br />2012<br />2013<br />Source: Gartner (December 2007)<br />
  12. 12. Introducing Zend’s PHP Stack<br />WIMP? WAMP? LAMP? MAMP? Zend!<br />
  13. 13. An Integrated, Heterogeneous Stack<br />9<br />PHP on Windows<br />
  14. 14. A Complete Solution<br />
  15. 15. The Production Side…<br />Clustering support<br />Aggregated app monitoring<br />Cross-server job queuing<br />App monitoring & diagnostics<br />Page caching, job queuing<br />Support, updates and hot fixes<br />Data caching and opcode acceleration<br />Integrated, native installers<br />Web admin console<br />
  16. 16. And the Development Side<br />Zend Server integration<br />Zend Framework integration<br />Team development<br />Testing and debugging<br />Support and updates<br />Basic code editing<br />Basic debugging<br />Eclipse plug-in<br />
  17. 17. Introducing the Eclipse Foundation<br />13<br />PHP on Windows<br />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<br />
  18. 18. The Ecosystem<br />14<br />PHP on Windows<br />
  19. 19. Eclipse Simultaneous Release <br />15<br />PHP on Windows<br />
  20. 20. Zend Contribution<br />16<br />PHP on Windows<br /><ul><li>PHP Development Tools
  21. 21. Ajax Tools
  22. 22. Dynamic Languages Tools
  23. 23. Data Tools </li></li></ul><li>Introducing Zend Framework<br />
  24. 24. Introducing Zend Framework<br />Some History:<br />Started as part of the PHP Collaboration Project in late ‘05<br />First public release: 0.2, Early ‘06<br />1.0 Released on July 2007<br />Currently in version 1.10 (today!)<br />Zend Framework 2.0 planning process started<br />Open-source, business-friendly licensing<br />Emphasis on high-quality, loose coupling and simplifying creation of modern Web Applications<br />18<br />PHP on Windows<br />
  25. 25. Zend Framework Rapid Adoption Continues<br /><ul><li>Rapidly Growing
  26. 26. Over 10M downloads
  27. 27. Over 200 contributors
  28. 28. Commercial Contributions
  29. 29. Enterprise Adoption</li></li></ul><li>Is it really a framework?<br />Zend Framework is:<br />A Full Stack Application Framework ?<br />A Component Library ?<br />Both!<br />Use-at-will Architecture<br />Loose coupling between components<br />Pick and choose the components you need and use them with your own app or with a different framework<br />Build your application from the group up based on ZF’s MVC<br />20<br />PHP on Windows<br />
  30. 30. Example: Zend_Mail<br />Allows you to easily compose and send e-mail messages from your PHP applications<br />Simplified control over recipients, headers, etc.<br />Easy creation of multipart/alternative HTML messages<br />Easy attachment handling<br />Supports different delivery transports<br />Allows you to read e-mail messages from POP3, IMAP, Mbox and Maildir<br />not demonstrated here :)<br />21<br />PHP on Windows<br />
  31. 31. Example: Zend_Mail – Sending a message<br />22<br />PHP on Windows<br />// Load the Zend_Mail class<br />require_once&apos;Zend/Mail.php&apos;;<br />// Instantiate a new message object<br />$message = new Zend_Mail(&apos;utf-8&apos;);<br />// Use the fluent interface to set message properties<br />$message-&gt;setFrom(&apos;;, &apos;Shahar E&apos;)<br /> -&gt;setSubject(&apos;Hello, world!&apos;) -&gt;setBodyText(&quot;Hi, what&apos;s up?&quot;)<br /> -&gt;addHeader(&apos;Importance&apos;, &apos;high&apos;)<br /> -&gt;addTo(&apos;;, &apos;Some One&apos;)<br /> -&gt;addCc(&apos;;, &apos;Other Guy&apos;)<br /> -&gt;addBcc(&apos;;, &apos;The Third Person&apos;);<br />// Send the message!<br />$message-&gt;send();<br />
  32. 32. Example: Zend_Mail – Adding Attachments<br />23<br />PHP on Windows<br />// Load the Zend_Mail class<br />require_once&apos;Zend/Mail.php&apos;;<br />// Instantiate a new message object<br />$message = new Zend_Mail(&apos;utf-8&apos;);<br />// Use the fluent interface to set message properties<br />$message-&gt;setFrom(‘;, ‘Report System&apos;)<br /> -&gt;setSubject(&apos;The report you have requested is ready&apos;)<br /> -&gt;addTo(&apos;shahar@localhost&apos;, &apos;Shahar Evron&apos;);<br />// Add a PDF attachment (Will be base64 encoded)<br />$pdf = $message-&gt;createAttachment(file_get_contents(&apos;report.pdf&apos;));<br />$pdf-&gt;type = &apos;application/pdf&apos;;<br />$pdf-&gt;filename = &apos;report.pdf&apos;;<br />// ... Continued on next slide ...<br />
  33. 33. Example: Zend_Mail – Adding Attachments<br />24<br />PHP on Windows<br />// Add a logo to the message - referenced from the message HTML body<br />$img = $message-&gt;createAttachment(file_get_contents(&apos;logo.png&apos;));<br />$img-&gt;type = &apos;image/png&apos;;<br />$img-&gt;id = &apos;;;<br />$img-&gt;filename = &apos;logo.png&apos;;<br />$img-&gt;disposition = Zend_Mime::DISPOSITION_INLINE;<br />// Set the message body<br />$message-&gt;setBodyHtml(<br />&quot;Hello Shahar,&lt;br /&gt;&lt;br /&gt;&quot; . <br />&quot;The report you have requested is attached as a PDF file.&lt;br /&gt;&lt;br /&gt;&quot; . <br />&quot;Enjoy!&lt;br /&gt;&quot; . <br />&apos;&lt;imgsrc=&quot;; alt=&quot; Logo&quot; /&gt;&apos;<br />);<br />// Set the message MIME-type to multipart/related<br />$message-&gt;setType(Zend_Mime::MULTIPART_RELATED);<br />// Send the message!<br />$message-&gt;send();<br />
  34. 34. Example: Zend_Mail – Adding Attachments<br />25<br />PHP on Windows<br />
  35. 35. Zend Framework – (Some) Components<br />Core<br />MVC<br />Formats & Data Access<br />Registry<br />Uri<br />Controller<br />View<br />Db<br />Json<br />Log<br />Cache<br />Layout<br />Application<br />Search<br />Dom_Query<br />Mail<br />Config<br />Ldap<br />Feed<br />Loader<br />Date<br />Amf<br />Queue<br />Web Infrastructure<br />Security<br />Web Services<br />Session<br />Tag<br />Auth<br />Acl<br />XmlRpc<br />Soap<br />Form<br />Filter<br />Validate<br />Navigation<br />Rest<br />Http_Client<br />OpenId<br />ProgressBar<br />Dojo<br />Captcha<br />InfoCard<br />Amazon<br />Yahoo<br />Flickr<br />Internationalization<br />Development<br />Twitter<br />Akismet<br />Locale<br />Translate<br />Tool<br />WildFire<br />Currency<br />Measure<br />Debug<br />Test<br />Delicious<br />…<br />26<br />PHP on Windows<br />
  36. 36. Zend Framework and Zend Studio<br />Demo Time!<br />
  37. 37. Starting a Zend Framework Project<br />Starting a new project with Zend Studio, Zend Framework and Zend Server<br />The Zend Framework MVC Outline<br />Some Interesting Zend Framework Concepts & Components:<br />Dispatching<br />Zend Application Bootstrapping<br />Zend_Config<br />Controllers, Views & Layouts<br />28<br />PHP on Windows<br />
  38. 38. Studio Features<br />Studio Features to show during demo:<br />PHPUnit Integration<br />Zend Tool<br />Refactoring<br />AJAX Support Features<br />29<br />PHP on Windows<br />
  39. 39. Deploying on the Windows Platform<br />Some thoughts about Reliability and Scalability <br />
  40. 40. Deploying and Running with Zend Server<br />Deploying locally from Zend Studio to Zend Server<br />Setting IIS to rewrite ZF requests<br />Rely on Zend_Config to switch from dev config to production<br />31<br />PHP on Windows<br />
  41. 41. Deploying In the Cloud – Windows Azure<br />Eclipse Azure Plugin<br />Simple Cloud API, Inter-cloud Interoperability<br />Windows Azure Demo (???)<br />32<br />PHP on Windows<br />
  42. 42. Windows Azure Table Storage<br />A Highly Scalable Cloud Database<br />Billions of records, terabytes of data<br />“Entities” and “Properties”<br />Not exactly a relational database<br />ACID (Atomic, Consist, Isolated, Durable) Transactions<br />Query syntax somewhat reminding SQL (but not really)<br />Schema-less<br />some structure can be enforced in client side<br />Can be partitioned across servers<br />33<br />PHP on Windows<br />
  43. 43. Recap<br />What? Are we done so quickly!?<br />
  44. 44. What have we learned?<br />PHP Is Everywhere! <br />PHP Is on Windows! No more excuses not to use it! :)<br />PHP can become even more effective with the right tools<br />Get an IDE and use it’s capabilities<br />Get the framework that fits your needs, study it, and utilize it<br />Standardize on a runtime environment<br />Plan for the future, if you’re successful it will hit you fast!<br />Plan for scaling<br />Production Monitoring & Reliability, Moving to the Cloud<br />35<br />PHP on Windows<br />
  45. 45. Thanks!<br />Still have questions?<br /> or @royganor<br /> or @shevron<br />
  46. 46. Tips & Tricks<br />Highlighted text can be displayed here<br />Keep your slides clean: <br />Avoid using more than 5 bullets<br />Try to keep your bullets as short as possible<br />Why?<br />People usually don’t read slides with a lot of text<br />Easier to memorize<br />37<br />PHP on Windows<br />