what's new in zf 1.10

56
© All rights reserved. Zend Technologies, Inc. What's New in ZF 1.10? Ralph Schindler Zend Framework Software Engineer

Upload: ralph-schindler

Post on 15-May-2015

2.373 views

Category:

Technology


2 download

DESCRIPTION

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

TRANSCRIPT

Page 1: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.

What's New in ZF 1.10?Ralph SchindlerZend Framework Software Engineer

Page 2: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.

In a Nutshell Numerous improvements New Components New Services Documentation updates

Page 3: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.3

Improvements

Building incrementally

Page 4: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.

Improvements

•Zend_Filter_Boolean

4 Insert->Header & Footer

Page 5: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.

Improvements

•Zend_Filter_Null

5 Insert->Header & Footer

Page 6: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.

Improvements

•Zend_Filter_Compress / Decompress

6 Insert->Header & Footer

Page 7: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.

Improvements

•Zend_Validate_Callback

7 Insert->Header & Footer

Page 8: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.

Improvements

•Zend_Validate_CreditCardSupported 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

8 Insert->Header & Footer

Page 9: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.

Improvements

•Zend_Validate_PostCodeAllows you to determine if a given value is a

valid postal code

Locale aware

9 Insert->Header & Footer

Page 10: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.

Improvements

•Zend_Log::factory() & Zend Monitor Writer Adapter

10 Insert->Header & Footer

Page 11: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.

Improvements

•Zend_Log::factory() & Zend Monitor Writer Adapter

11 Insert->Header & Footer

Page 12: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.

Improvements

•Zend_Pdf performance enhancements

•Zend_Exception previous Exception support

•Zend_Loader::loadClass() PSR-0 recommendations

•Upgrade to Dojo 1.4

12 Insert->Header & Footer

Page 13: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.

Improvements

•Zend_Application ResourcesCachemanager

Dojo

Jquery

Layout

Log

Mail

Multidb

13 Insert->Header & Footer

Page 14: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.

Improvements

•Zend_Tool ProvidersNo 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

14 Insert->Header & Footer

Page 15: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.

Improvements

Page 16: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.

Improvements

Page 17: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.

Improvements

Page 18: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.18

New Components

Extending an already extensible and extensive framework

Page 19: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.

Zend_Barcode Create barcodes, and render as PDF or

images Validate barcode values

Page 20: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.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');

$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');

Page 21: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.21

$validator = new Zend_Validate_Barcode('CODE39');if ($validator->isValid($input)) { // valid barcode text} else { // invalid barcode text}

$validator = new Zend_Validate_Barcode('CODE39');if ($validator->isValid($input)) { // valid barcode text} else { // invalid barcode text}

Page 22: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.

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

Page 23: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.23

RewriteCond %{DOCUMENT_ROOT}/cached/% {REQUEST_URI}.html -fRewriteRule .* cached/%{REQUEST_URI}.%1 [L]

RewriteCond %{DOCUMENT_ROOT}/cached/% {REQUEST_URI}.html -fRewriteRule .* cached/%{REQUEST_URI}.%1 [L]

Page 24: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.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' );}

$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' );}

Page 25: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.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');

$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');

Page 26: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.

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.

Page 27: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.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' => '[email protected]', 'uri' => 'http://framework.zend.com/', )) ->setDateModified(strtotime( '2010-03-17 12:00:00'));

$feed = new Zend_Feed_Writer_Feed;$feed->setTitle('ZF Webinars') ->setLink( 'http://framework.zend.com/webinars/atom', 'atom') ->addAuthor(array( 'name' => 'ZF DevTeam', 'email' => '[email protected]', 'uri' => 'http://framework.zend.com/', )) ->setDateModified(strtotime( '2010-03-17 12:00:00'));

Page 28: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.28

$entry = $feed->createEntry();$entry->setLink( 'http://framework.zend.com/webinars/2010-03-17') ->addAuthor(array( 'name' => 'Ralph Schindler', 'email' => '[email protected]', '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');

$entry = $feed->createEntry();$entry->setLink( 'http://framework.zend.com/webinars/2010-03-17') ->addAuthor(array( 'name' => 'Ralph Schindler', 'email' => '[email protected]', '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');

Page 29: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.

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

Page 30: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.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();

$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();

Page 31: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.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();

$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();

Page 32: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.32

$callback = new Zend_Feed_Pubsubhubbub_Subscriber_Callback;$callback->setStorage($storage);$callback->handle();$callback->sendResponse();

if ($callback->hasFeedUpdate()) { $feedString = $callback->getFedUpdate(); // start processing!}

$callback = new Zend_Feed_Pubsubhubbub_Subscriber_Callback;$callback->setStorage($storage);$callback->handle();$callback->sendResponse();

if ($callback->hasFeedUpdate()) { $feedString = $callback->getFedUpdate(); // start processing!}

Page 33: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.

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);

$bbcode = Zend_Markup::factory('Bbcode');echo $bbcode->render($someBbCodeMarkup);

$textile = Zend_Markup::factory('Textile');echo $textile->render($someTextileMarkup);

Page 34: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.

Zend_Oauth Act as an Oauth consumer

Page 35: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.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();

$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();

Page 36: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.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();// ...

// 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();// ...

Page 37: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.

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

Page 38: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.38

$serializer = Zend_Serializer::factory('Json');

$serialized = $serializer->serialize($data);$unserialized = $serializer->unserialize($serialized);

$serializer = Zend_Serializer::factory('Json');

$serialized = $serializer->serialize($data);$unserialized = $serializer->unserialize($serialized);

Page 39: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.39

New Services

Extending your reach into the cloud

Page 40: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.

New Service - LiveDocx

•http://www.livedocx.com/

•Best described by this image:

40 Insert->Header & Footer

Page 41: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.

New Service - LiveDocx

41 Insert->Header & Footer

Page 42: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.

New Service - LiveDocx

42 Insert->Header & Footer

Page 43: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.

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

43 Insert->Header & Footer

Page 44: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.

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.44 Insert->Header & Footer

Page 45: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.

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.

45 Insert->Header & Footer

Page 46: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.

New Service - DeveloperGarden

•Setup a conference call:

46 Insert->Header & Footer

Page 47: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.

New Service - WindowsAzure

•Windows Azure is the name for Microsoft's Software + Services platform

•Features:Interface to Storage API:

• Blobs

• Tables

Batch processing

• Queues

47 Insert->Header & Footer

Page 48: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.

New Service – WindowsAzure

48 Insert->Header & Footer

Page 49: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.49

Documentation updates

Helping you educate yourself

Page 50: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.

Versioned Documentation Versioned by minor revision (1.10, 1.9,

1.8, etc.) Search by version

Page 51: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.

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

Page 52: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.

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

Page 53: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.53

Page 54: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.

Migration Notes New centralized “Migration Notes”

appendix Migration notes per minor version

Page 55: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.

Commenting Manual comments, ala php.net, have

been enabled!

Page 56: What's New in ZF 1.10

© All rights reserved. Zend Technologies, Inc.56

Thank you! Information and resources:

http://framework.zend.com/