What's New in ZF 1.10

  • 2,297 views
Uploaded on

Slides from a webinar where we discussed the new features in Zend Framework 1.10

Slides from a webinar where we discussed the new features in Zend Framework 1.10

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
2,297
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
42
Comments
0
Likes
3

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. What's New in ZF 1.10? Ralph Schindler Zend Framework Software Engineer
  • 2. In a Nutshell
    • Numerous improvements
    • New Components
    • New Services
    • Documentation updates
  • 3. Improvements Building incrementally
  • 4. Improvements
    • Zend_Filter_Boolean
    Insert->Header & Footer
  • 5. Improvements
    • Zend_Filter_Null
    Insert->Header & Footer
  • 6. Improvements
    • Zend_Filter_Compress / Decompress
    Insert->Header & Footer
  • 7. Improvements
    • Zend_Validate_Callback
    Insert->Header & Footer
  • 8. Improvements
    • Zend_Validate_CreditCard
      • Supported CC Institutes:
        • American Express, China UnionPay
        • Diners Club Card Blanche, Diners Club International, Diners Club US & Canada
        • Discover Card, JCB, Laser, Maestro
        • MasterCard, Solo
        • Visa, Visa Electron
    Insert->Header & Footer
  • 9. Improvements
    • Zend_Validate_PostCode
      • Allows you to determine if a given value is a valid postal code
      • Locale aware
    Insert->Header & Footer
  • 10. Improvements
    • Zend_Log::factory() & Zend Monitor Writer Adapter
    Insert->Header & Footer
  • 11. Improvements
    • Zend_Log::factory() & Zend Monitor Writer Adapter
    Insert->Header & Footer
  • 12. Improvements
    • Zend_Pdf performance enhancements
    • Zend_Exception previous Exception support
    • Zend_Loader::loadClass() PSR-0 recommendations
    • Upgrade to Dojo 1.4
    Insert->Header & Footer
  • 13. Improvements
    • Zend_Application Resources
      • Cachemanager
      • Dojo
      • Jquery
      • Layout
      • Log
      • Mail
      • Multidb
    Insert->Header & Footer
  • 14. Improvements
    • Zend_Tool Providers
      • No more IncludePath scanner – Explicit loader
      • Home directory & Configuration
      • DbAdapter Provider
      • Layout Provider
      • Basic Scaffolding
        • Model Provider
        • Form Provider
      • Project in 1.10+ generated with Application_ prefix in code & bootstrap support
    Insert->Header & Footer
  • 15. Improvements
  • 16. Improvements
  • 17. Improvements
  • 18. New Components Extending an already extensible and extensive framework
  • 19. Zend_Barcode
    • Create barcodes, and render as PDF or images
    • Validate barcode values
  • 20. $renderer = Zend_Barcode::factory( 'code39' , // barcode type 'image' , // image or PDF array ( // barcode options 'text' => 'ZENDFRAMEWORK' , ), array ( // renderer options 'imageType' => 'png' , ) ); $image = $renderer ->draw(); imagepng ( $image , __DIR__ . '/barcode.png' );
  • 21. $validator = new Zend_Validate_Barcode( 'CODE39' ); if ( $validator ->isValid( $input )) { // valid barcode text } else { // invalid barcode text }
  • 22. Zend_Cache
    • New backend: Zend_Cache_Backend_Static
      • Cache to named files in your document root
      • Skip PHP altogether for cached content!
    • New: Zend_Cache_Manager
      • Use configuration to create Cache objects
      • Acts as both a factory and repository for multiple Cache objects
      • Aids usage of multi-tiered caching strategies in your ZF applications
  • 23. RewriteCond %{DOCUMENT_ROOT}/cached/% {REQUEST_URI}.html -f RewriteRule .* cached/%{REQUEST_URI}.%1 [L]
  • 24. $options = array ( 'public_dir' => APPLICATION_PATH . '/../public/cache' , ); // Where $manager is a Zend_Cache_Manager instance $manager ->setTemplateOptions( 'page' , $options ); $cache = $manager ->getCache( 'page' ); // In an action controller: public function preDispatch() { $this ->_helper->cache( // cache these actions: array ( 'foo' , 'bar' , 'baz' ), // use these tags: array ( $this ->_request->getControllerName()), // with this extension: 'html' ); }
  • 25. $manager = new Zend_Cache_Manager; $dbCache = array ( 'frontend' => array ( 'name' => 'Core' , 'options' => array ( 'lifetime' => 3600, 'automatic_serialization' => true, ) ), 'backend' => array ( 'name' => 'Core' , 'options' => array ( 'cache_dir' => APPLICATION_PATH . '/../data/cache/db' , ), ), ); $manager ->setCacheTemplate( 'db' , $dbCache ); $cache = $manager ->getCache( 'db' );
  • 26. Zend_Feed_Writer
    • Sibling to Zend_Feed_Reader, introduced in ZF 1.9.0
    • Provides full capabilities for generation of a variety of feeds, including feed extensions
      • RSS
      • RSS2
      • Atom
      • DublinCore
      • etc.
  • 27. $feed = new Zend_Feed_Writer_Feed; $feed ->setTitle( 'ZF Webinars' ) ->setLink( 'http://framework.zend.com/webinars/atom' , 'atom' ) ->addAuthor( array ( 'name' => 'ZF DevTeam' , 'email' => 'fw-general@lists.zend.com' , 'uri' => 'http://framework.zend.com/' , )) ->setDateModified( strtotime ( '2010-03-17 12:00:00' ));
  • 28. $entry = $feed ->createEntry(); $entry ->setLink( 'http://framework.zend.com/webinars/2010-03-17' ) ->addAuthor( array ( 'name' => 'Ralph Schindler' , 'email' => 'ralph.schindler@zend.com' , 'uri' => 'http://framework.zend.com/' , )) ->setDateModified( strtotime ( '2010-03-17 12:00:00' )) ->setDateCreated( strtotime ( '2010-03-15 08:39:00' )); $output = $feed ->export( 'atom' );
  • 29. Zend_Feed_Pubsubhubbub
    • Act as either a PuSH subscriber or publisher
      • Subscriber functionality allows specifying a callback URL for PuSH's “fat pings”
        • Uses DB storage by default to track what feeds have been received previously
      • Publisher allows pinging a hub to notify that new content is available
  • 30. $publisher = new Zend_Feed_Pubsubhubbub_Publisher; $publisher ->addHubUrls( array ( 'http://pubsubhubbub.appspot.com/' , 'http://wordpress.org/extend/plugins/pushpress/' , )) ->addUpdatedTopicUrls( array ( 'http://framework.zend.com/webinars/atom' , )); // Notify $publisher ->notifyAll();
  • 31. $storage = new Zend_Feed_Pubsubhubbub_Model_Subscription; $subscriber = new Zend_Feed_Pubsubhubbub_Subscriber; $subscriber ->setStorage( $storage ) ->addHubUrl( 'http://pubsubhubbub.appspot.com/' ) ->setTopicUrl( 'http://framework.zend.com/webinars/atom' ) ->setCallbackUrl( 'http://www.mydomain.com/hubbub/callback' ) ->subscribeAll();
  • 32. $callback = new Zend_Feed_Pubsubhubbub_Subscriber_Callback; $callback ->setStorage( $storage ); $callback ->handle(); $callback ->sendResponse(); if ( $callback ->hasFeedUpdate()) { $feedString = $callback ->getFedUpdate(); // start processing! }
  • 33. Zend_Markup
    • Parser and renderer functionality
    • Supports:
      • BBCode
      • Textile
    $bbcode = Zend_Markup::factory( 'Bbcode' ); echo $bbcode ->render( $someBbCodeMarkup ); $textile = Zend_Markup::factory( 'Textile' ); echo $textile ->render( $someTextileMarkup );
  • 34. Zend_Oauth
    • Act as an Oauth consumer
  • 35. $config = array ( 'callbackUrl' => 'http://example.com/callback' , 'siteUrl' => 'http://twitter.com/oauth' , 'consumerKey' => 'gg3DsFTW9OU9eWPnbuPzQ' , 'consumerSecret' => 'tFB0fyWLSMf74lkEu9FTyoHXcazOWpbrAjTCCK48A' ); $consumer = new Zend_Oauth_Consumer( $config ); // Get request token: $token = $consumer ->getRequestToken(); // Persist the token $session = new Zend_Session_Namespace( 'oauth' ); $session ->token = serialize ( $token ); // Redirect to oauth provider $consumer ->redirect();
  • 36. // Within a controller action, assuming consumer // and session setup above $request = $this ->getRequest(); if (! $request ->isGet() || !isset( $session ->token) ) { // error condition! } $token = $consumer ->getAccessToken( $request ->getQuery(), unserialize ( $session ->token) ); // use the token! $client = $token ->getHttpClient(); // ...
  • 37. Zend_Serializer
    • Serialize PHP to a variety of formats, as well as deserialize back to PHP
    • Supported formats include:
      • Igbinary
      • WDDX
      • JSON
      • Active Message Format (AMF) 0 and 3
      • Python Pickle
      • PHP code or serialization
  • 38. $serializer = Zend_Serializer::factory( 'Json' ); $serialized = $serializer -> serialize ( $data ); $unserialized = $serializer -> unserialize ( $serialized );
  • 39. New Services Extending your reach into the cloud
  • 40. New Service - LiveDocx
    • http://www.livedocx.com/
    • Best described by this image:
    Insert->Header & Footer
  • 41. New Service - LiveDocx Insert->Header & Footer
  • 42. New Service - LiveDocx Insert->Header & Footer
  • 43. New Service - LiveDocx
    • Other API features:
      • Local & Remote templates
      • Ability to retrieve information about templates
      • Input Template formats:
        • Docx, Doc, RTF, TXD
      • Output Document formats:
        • Docx, Doc, Html, RTF, PDF, TXD, TXT
      • Output Image formats:
        • BMP, PNG, GIF, TIFF, WMF, JPG
    Insert->Header & Footer
  • 44. New Service - DeveloperGarden
    • Developer Garden is the name of Deutsche Telekom’s developer community.
    • Features of the API:
      • BaseUserService
        • Class to manage API quota and user accounting details.
      • IPLocation
        • Locale the given IP and returns geo coordinates. Works only with IPs allocated in the network of the Deutsche Telekom.
      • LocalSearch
        • Allows you to search with options nearby or around a given geo coordinate or city.
    Insert->Header & Footer
  • 45. New Service - DeveloperGarden
    • Features (cont.)
      • SendSMS
        • Send a SMS or Flash SMS to a given number.
      • SMSValidation
        • You can validate a number to use it with SendSMS for also supply a back channel.
      • VoiceCall
        • Initiates a call between two participants.
      • ConferenceCall
        • You can configure a whole conference room with participants for an adhoc conference or you can also schedule your conference.
    Insert->Header & Footer
  • 46. New Service - DeveloperGarden
    • Setup a conference call:
    Insert->Header & Footer
  • 47. New Service - WindowsAzure
    • Windows Azure is the name for Microsoft's Software + Services platform
    • Features:
      • Interface to Storage API:
        • Blobs
        • Tables
          • Batch processing
        • Queues
    Insert->Header & Footer
  • 48. New Service – WindowsAzure Insert->Header & Footer
  • 49. Documentation updates Helping you educate yourself
  • 50. Versioned Documentation
    • Versioned by minor revision (1.10, 1.9, 1.8, etc.)
    • Search by version
  • 51. New Rendering Engine
    • Now using PhD (PHP's Documentation system) to render online docs as well as downloadable docs
    • Faster rendering time and more flexibility in rendering
    • Better navigation
  • 52. Tutorials
    • New manual section, “Learning Zend Framework”
    • Contains Quick Start, and 8 additional tutorials
    • Part of the ZF repository, which means:
      • Versioned
      • Translations will be available
      • New content can be added
  • 53.
  • 54. Migration Notes
    • New centralized “Migration Notes” appendix
    • Migration notes per minor version
  • 55. Commenting
    • Manual comments, ala php.net, have been enabled!
  • 56. Thank you!
    • Information and resources: http://framework.zend.com/