SlideShare a Scribd company logo
Zend Framework Thomas Weidner I18N Team Leader and Core Developer,  for the Zend Framework Now, the world's most popular web programming language gets even better with an easy to use framework for developing the next generation of web applications.
What is the Zend Framework? PHP 5 class library for web development Free, open source, BSD license (like PHP) +150,000 lines of code Emphasis on quality: 90%+ unit test coverage Solutions are “extremely simple” – solving the 80% usage case, and allowing for extensibility +200,000 downloads http://framework.zend.com/
History of the Zend Framework Brought to live at 19.October 2005 by Zend at the IST in California First official preview 03.March.2006 (V0.1.1) 12 official releases since 2006 Actual release 1.0RC1 Official 1.0 proposed for July
What’s in the Zend Framework? MVC web app framework (model-view-controller) Database access Lucene-compatible Search engine Input filtering and validation Authentication Access control Session handling I18N, translation PDF file reading and writing HTTP client XmlRpc REST web services RSS and Atom feeds Google Gdata client Logging Mail reading and sending Caching Configuration file handling Command-line option parsing Simple, convenient object-oriented solutions to common web application development tasks:
API Overview
Component Overview 1/4 MVC Layer Zend_Controller – Controller Pattern Zend_View – View Pattern DATA Layer Zend_Db – Database Handling Zend_Pdf – PDF Creation and Handling Zend_Search – Lucene Search I18N Layer Zend_Date – Localized Date handling Zend_Locale – I18N Base class, Localisation Zend_Measure – Measurements, conversions Zend_Translate – Translations
Component Overview 2/4 WEB Services Layer Zend_Feed – RSS und ATOM Feeds Zend_GData – Google Data Client Zend_Http – HTTP Client and Server  Zend_Json – JSON Access Zend_Rest – Rest Client and Server Zend_XmlRpc – XMLRPC Client and Server Zend_Service – Access for different web services including Askimet Amazon Audioscrobbler Delicious Flickr Simpy Yahoo and more are already in the incubator or proposed
Component Overview 3/4 Core Layer Zend_Acl – Access Controll List, Limiting ressources, roles, users Zend_Auth – Authentication Zend_Cache – Caching Zend_Config – Configuration Handling Zend_Console – Console Options Handling Zend_Filter – Filtering Input data Zend_Log – Log file Handling (log4j based) Zend_Mail – Mail sending and receiving Zend_Memory – Memory Access when memory is limited Zend_Registry – Storing data within an application registry Zend_Session – Session Handling Zend_Validate – Validating
Component Overview 4/4 Incubator Components… after 1.0 release, already partitial useable Zend_Currency – Localized currency handling (I18N) Zend_Environment – (Core) Zend_Form – Form handling (MVC) Zend_Soap – Soap Client and Server (Services) Zend_Timesync – Timeserver access (NTP, SNTP) (I18N) Future Components Several additional components proposed including… LDAP, Calendar, PayPal, YouTube, Yaml… Proposals http://framework.zend.com/wiki/display/ZFPROP/Home
Directory layout /Zend /Zend/Locale.php /Zend/Locale /Zend/Locale/Format.php … A component is always a base class and all subclasses in it’s same named directory. .. This way single components can be used without installing the complete framework…
Minimum requirements Some Minimum requirements PHP 5.1.4 Webserver Standard installation commonly no additional extensions needed That’s all…
A simple example 1/4 A simple example – Localisation: <?php require_once ‘Zend/Locale.php’; $locale = new Zend_Locale(); print $locale->toString();
A simple example 2/4 Each class can be used alone: <?php require_once ‘Zend/Locale.php’; $locale = new Zend_Locale(); print $locale->toString(); Requiring the file is enough… Each component knows which other components it has to load
A simple example 3/4 Location of the ZF components: <?php require_once ‘Zend/Locale.php’; $locale = new Zend_Locale(); print $locale->toString(); All components are in the same directory.
A simple example 4/4 The result: our users language <?php require_once ‘Zend/Locale.php’; $locale = new Zend_Locale(); print  $locale->toString(); The visiting users language…
Localisation Possibilities of Zend_Locale Get the client users languages Get localized data Base localisation class for ZF Locale aware formating of numbers, dates and times Example1 Example2
Localized data Localized and translated data: Translation for all languages Translation for all scripts Translation for countries and territories Calendar formats Month- and Day names Standard formats for Date and Time Currency name, signs and formats Characters used in this language Yes and no strings …
Locale aware formating rules Zend_Locale_Format Converting from one script to another Normalizing of numbers (12,345.45 -> 12345.45) Localizing of numbers (12345.45 -> 12,345.45) Checking if a localized number is valid Normalizing date & time inputs Checking if a localized date or time input is valid
Script conversion From european digits to arabic digits and visa versa <?php require_once ‘Zend/Locale.php’; $number = “12345”; $converted = Zend_Locale_Format::convertNumerals($number, ‘Latn’, ‘Arab’); $european = Zend_Locale_Format::convertNumerals($converted, ‘Arab’, ‘Latn’); Example3
Number normalization Normalizing numbers <?php require_once ‘Zend/Locale.php’; $number = “12.345,67”; $normal = Zend_Locale_Format::getNumber($number); Example4
Number localization Localizing numbers <?php require_once ‘Zend/Locale.php’; $number = 12345.67; $normal = Zend_Locale_Format::toNumber($number); Example5 Example8
Multilingual applications Making applications running worldwide Translating output Format of date and time Format of numbers Format of currencies Knowing allowed characters of a language
Translation Gettext… the old way <?php bindtextdomain(‘domain’, ‘path’); textdomain(‘domain’); print gettext(‘my translation’); Fixed directory layout /path/LC_ALL/locale/ Needs an extension to work Complicated for people unfamiliar to GNUs gettext
Zend_Translate Gettext… with Zend_Translate <?php require_once ‘Zend/Translate.php’; // within bootstrap file $tr = new Zend_Translate(AN_ARRAY, ‘Path/to/myfile.mo’, ‘de’); print $tr->_(‘my translation’); No fixed directory layout No extension needed Same API for all sources
Zend_Translate sources Zend_Translate sources One API for all sources Supported sources are: Array Csv Gettext Qt Tmx Xliff More to come (SQL, XmlTm, …)
Switching sources Changing sources ? No problem… <?php require_once ‘Zend/Translate.php’; // within bootstrap file $tr = new Zend_Translate( AN_CSV , ‘Path/to/ myfile.csv ’, ‘de’); print $tr->_(‘my translation’); <?php require_once ‘Zend/Translate.php’; // within bootstrap file $tr = new Zend_Translate( AN_GETTEXT , ‘Path/to/ myfile.mo ’, ‘de’); print $tr->_(‘my translation’); Just one small change, same API
Conditional translating Is a string translateable ? <?php require_once ‘Zend/Translate.php’; // within bootstrap file $tr = new Zend_Translate(AN_CSV, ‘Path/to/myfile.csv’, ‘de’); if  ($tr->isTranslated(‘my translation’))  { // do something } else { // no translation, do something else } Not possible with php
Allowed characters Verifying input… but localized ? <?php require_once ‘Zend/Locale.php’; // within bootstrap file $tr = new Zend_Locale(); $de = $tr->getTranslationList(‘characters’, ‘de’); $fr = $tr->getTranslationList(‘characters’, ‘fr’); For more than 128 languages Example6
Language selectbox Creating a localized selectbox for languages ? <?php require_once ‘Zend/Locale.php’; // within bootstrap file $tr = new Zend_Locale(); $de = $tr->getTranslationList(‘language’); foreach ($de as $key => $value) { $fr = $tr->getTranslationList(‘language’, $key); print $fr[$key]; } Example7
Yes or No How to realize a yes-no for every language ? <?php require_once ‘Zend/Locale.php’; // within bootstrap file $tr = new Zend_Locale(); $de = $tr->getQuestion(); Example9
Normalizing dates Monthnames / Daynames <?php require_once ‘Zend/Locale.php’; // within bootstrap file $date = “12.März.2007 20:15:00”; $tr = new Zend_Locale_Format::getDate($date, ‘de’); print_r($tr); Example10
Working with dates Zend_Date One class Handles all meanings (date, time, parts, sun…) Simple API Easy handling ISO Standard also PHP’s GNU supported Knows more than 50 standard represenations Unlimited (more than 64bit) dates supported
Working with dates 2 Capabilities Computing dates Get sunset / sunrise for cities Easy changing with ISO ( dd.MM.yyyy HH:mm:ss a ) Supports different standards ( ISO, GNU, RFC2822 (mail), W3C, RSS, Cookies…)
Date maths Computing dates Normalized Localized Added / Substracted Checked (earlier, later, equal Splitted Converted …
Date example Example11 $date = new Zend_Date(‘20070414T122050’, Zend_Date::ISO_8601); $date->addMonth(2); $date->subYear(6); If ($date->isLeapYear()) {   // LeapYear } else {   // NO LeapYear }
Checking dates Check if a date is a date If ( Zend_Date::isDate(’14. April. 2007 10:20:55’)) Example12 Compare parts If ( $date->compareWeekday(2))  Example13
Stay up Calculating sunset / sunrise With php… complicated With Zend_Date… just know your city $city = Zend_Date_Cities::City(‘Amsterdam’); $date = new Zend_Date(); $uptime = $date->getSunrise($city)
At the end Simple solution Easy handling Easy extending – 80% use case High quality Growing fast
Contact us http://framework.zend.com Mailinglist   [email_address] Instant messager  jabber.zend.com
Thanks http://framework.zend.com/
Ad

Recommended

The state of DI in PHP - phpbnl12
The state of DI in PHP - phpbnl12
Stephan Hochdörfer
 
Introduction to php php++
Introduction to php php++
Tanay Kishore Mishra
 
A Conversation About REST
A Conversation About REST
Jeremy Brown
 
MidwestPHP Symfony2 Internals
MidwestPHP Symfony2 Internals
Raul Fraile
 
Phpwebdev
Phpwebdev
Luv'k Verma
 
Apache thrift-RPC service cross languages
Apache thrift-RPC service cross languages
Jimmy Lai
 
Apache Thrift
Apache Thrift
knight1128
 
RESTLess Design with Apache Thrift: Experiences from Apache Airavata
RESTLess Design with Apache Thrift: Experiences from Apache Airavata
smarru
 
ColdBox i18N
ColdBox i18N
Oğuz Demirkapı
 
Introduction to-php
Introduction to-php
AhmedAElHalimAhmed
 
Using PHP 5.3 Namespaces for Fame and Fortune
Using PHP 5.3 Namespaces for Fame and Fortune
Zend by Rogue Wave Software
 
An introduction to Apache Thrift
An introduction to Apache Thrift
Mike Frampton
 
Github.com anton terekhov-orientdb-php
Github.com anton terekhov-orientdb-php
San jay
 
Introduction To PHP
Introduction To PHP
Shweta A
 
Hunt for dead code
Hunt for dead code
Damien Seguy
 
Php i basic chapter 3 (mardhiah kamaludin's conflicted copy 2013-04-23)
Php i basic chapter 3 (mardhiah kamaludin's conflicted copy 2013-04-23)
Muhamad Al Imran
 
PHP ITCS 323
PHP ITCS 323
Sleepy Head
 
CocoaConf: The Language of Mobile Software is APIs
CocoaConf: The Language of Mobile Software is APIs
Tim Burks
 
topic_perlcgi
topic_perlcgi
tutorialsruby
 
Language processor implementation using python
Language processor implementation using python
Viktor Pyskunov
 
web programming UNIT VIII python by Bhavsingh Maloth
web programming UNIT VIII python by Bhavsingh Maloth
Bhavsingh Maloth
 
Building scalable and language-independent Java services using Apache Thrift ...
Building scalable and language-independent Java services using Apache Thrift ...
IndicThreads
 
Unit 1-introduction to perl
Unit 1-introduction to perl
sana mateen
 
Patterns for JVM languages JokerConf
Patterns for JVM languages JokerConf
Jaroslaw Palka
 
Something About Dynamic Linking
Something About Dynamic Linking
Wang Hsiangkai
 
Unit VI
Unit VI
Bhavsingh Maloth
 
WEB PROGRAMMING UNIT V BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT V BY BHAVSINGH MALOTH
Bhavsingh Maloth
 
Php
Php
Gangadhar S
 
Symfony2 as an api
Symfony2 as an api
Kifah Abbad
 
Welcome to the Symfony2 World - FOSDEM 2013
Welcome to the Symfony2 World - FOSDEM 2013
Lukas Smith
 

More Related Content

What's hot (20)

ColdBox i18N
ColdBox i18N
Oğuz Demirkapı
 
Introduction to-php
Introduction to-php
AhmedAElHalimAhmed
 
Using PHP 5.3 Namespaces for Fame and Fortune
Using PHP 5.3 Namespaces for Fame and Fortune
Zend by Rogue Wave Software
 
An introduction to Apache Thrift
An introduction to Apache Thrift
Mike Frampton
 
Github.com anton terekhov-orientdb-php
Github.com anton terekhov-orientdb-php
San jay
 
Introduction To PHP
Introduction To PHP
Shweta A
 
Hunt for dead code
Hunt for dead code
Damien Seguy
 
Php i basic chapter 3 (mardhiah kamaludin's conflicted copy 2013-04-23)
Php i basic chapter 3 (mardhiah kamaludin's conflicted copy 2013-04-23)
Muhamad Al Imran
 
PHP ITCS 323
PHP ITCS 323
Sleepy Head
 
CocoaConf: The Language of Mobile Software is APIs
CocoaConf: The Language of Mobile Software is APIs
Tim Burks
 
topic_perlcgi
topic_perlcgi
tutorialsruby
 
Language processor implementation using python
Language processor implementation using python
Viktor Pyskunov
 
web programming UNIT VIII python by Bhavsingh Maloth
web programming UNIT VIII python by Bhavsingh Maloth
Bhavsingh Maloth
 
Building scalable and language-independent Java services using Apache Thrift ...
Building scalable and language-independent Java services using Apache Thrift ...
IndicThreads
 
Unit 1-introduction to perl
Unit 1-introduction to perl
sana mateen
 
Patterns for JVM languages JokerConf
Patterns for JVM languages JokerConf
Jaroslaw Palka
 
Something About Dynamic Linking
Something About Dynamic Linking
Wang Hsiangkai
 
Unit VI
Unit VI
Bhavsingh Maloth
 
WEB PROGRAMMING UNIT V BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT V BY BHAVSINGH MALOTH
Bhavsingh Maloth
 
Php
Php
Gangadhar S
 
An introduction to Apache Thrift
An introduction to Apache Thrift
Mike Frampton
 
Github.com anton terekhov-orientdb-php
Github.com anton terekhov-orientdb-php
San jay
 
Introduction To PHP
Introduction To PHP
Shweta A
 
Hunt for dead code
Hunt for dead code
Damien Seguy
 
Php i basic chapter 3 (mardhiah kamaludin's conflicted copy 2013-04-23)
Php i basic chapter 3 (mardhiah kamaludin's conflicted copy 2013-04-23)
Muhamad Al Imran
 
CocoaConf: The Language of Mobile Software is APIs
CocoaConf: The Language of Mobile Software is APIs
Tim Burks
 
Language processor implementation using python
Language processor implementation using python
Viktor Pyskunov
 
web programming UNIT VIII python by Bhavsingh Maloth
web programming UNIT VIII python by Bhavsingh Maloth
Bhavsingh Maloth
 
Building scalable and language-independent Java services using Apache Thrift ...
Building scalable and language-independent Java services using Apache Thrift ...
IndicThreads
 
Unit 1-introduction to perl
Unit 1-introduction to perl
sana mateen
 
Patterns for JVM languages JokerConf
Patterns for JVM languages JokerConf
Jaroslaw Palka
 
Something About Dynamic Linking
Something About Dynamic Linking
Wang Hsiangkai
 
WEB PROGRAMMING UNIT V BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT V BY BHAVSINGH MALOTH
Bhavsingh Maloth
 

Viewers also liked (10)

Symfony2 as an api
Symfony2 as an api
Kifah Abbad
 
Welcome to the Symfony2 World - FOSDEM 2013
Welcome to the Symfony2 World - FOSDEM 2013
Lukas Smith
 
Symphony Software Foundation API Working Group Proposal
Symphony Software Foundation API Working Group Proposal
Symphony Software Foundation
 
Considerations For an API Strategy - Ronnie MItra API Architect Layer 7 Londo...
Considerations For an API Strategy - Ronnie MItra API Architect Layer 7 Londo...
CA API Management
 
Pimp legacy PHP apps with Apigility - TrueNorthPHP 2014
Pimp legacy PHP apps with Apigility - TrueNorthPHP 2014
Michelangelo van Dam
 
OAuth based reference architecture for API Management
OAuth based reference architecture for API Management
WSO2
 
Deep-Dive: API Security in the Digital Age
Deep-Dive: API Security in the Digital Age
Apigee | Google Cloud
 
Best Practices for API Management
Best Practices for API Management
WSO2
 
Architecting an Enterprise API Management Strategy
Architecting an Enterprise API Management Strategy
WSO2
 
3 Things Every Sales Team Needs to Be Thinking About in 2017
3 Things Every Sales Team Needs to Be Thinking About in 2017
Drift
 
Symfony2 as an api
Symfony2 as an api
Kifah Abbad
 
Welcome to the Symfony2 World - FOSDEM 2013
Welcome to the Symfony2 World - FOSDEM 2013
Lukas Smith
 
Symphony Software Foundation API Working Group Proposal
Symphony Software Foundation API Working Group Proposal
Symphony Software Foundation
 
Considerations For an API Strategy - Ronnie MItra API Architect Layer 7 Londo...
Considerations For an API Strategy - Ronnie MItra API Architect Layer 7 Londo...
CA API Management
 
Pimp legacy PHP apps with Apigility - TrueNorthPHP 2014
Pimp legacy PHP apps with Apigility - TrueNorthPHP 2014
Michelangelo van Dam
 
OAuth based reference architecture for API Management
OAuth based reference architecture for API Management
WSO2
 
Deep-Dive: API Security in the Digital Age
Deep-Dive: API Security in the Digital Age
Apigee | Google Cloud
 
Best Practices for API Management
Best Practices for API Management
WSO2
 
Architecting an Enterprise API Management Strategy
Architecting an Enterprise API Management Strategy
WSO2
 
3 Things Every Sales Team Needs to Be Thinking About in 2017
3 Things Every Sales Team Needs to Be Thinking About in 2017
Drift
 
Ad

Similar to PHPBootcamp - Zend Framework (20)

Getting Started with Zend Framework
Getting Started with Zend Framework
Juan Antonio
 
Zend Framework Workshop
Zend Framework Workshop
10n Software, LLC
 
Best practices tekx
Best practices tekx
Lorna Mitchell
 
PHP and Zend Framework on Windows
PHP and Zend Framework on Windows
Shahar Evron
 
MVC Frameworks for building PHP Web Applications
MVC Frameworks for building PHP Web Applications
Vforce Infotech
 
Building Web Applications with Zend Framework
Building Web Applications with Zend Framework
Phil Brown
 
Zend Framework 2, What's new, Confoo 2011
Zend Framework 2, What's new, Confoo 2011
Bachkoutou Toutou
 
Extending ZF & Extending With ZF
Extending ZF & Extending With ZF
Ralph Schindler
 
Phpwebdevelping
Phpwebdevelping
mohamed ashraf
 
Intro To Mvc Development In Php
Intro To Mvc Development In Php
funkatron
 
DPC2007 Zend Framework (Gaylord Aulke)
DPC2007 Zend Framework (Gaylord Aulke)
dpc
 
Zend framework 06 - zend config, pdf, i18n, l10n, sessions
Zend framework 06 - zend config, pdf, i18n, l10n, sessions
Tricode (part of Dept)
 
green
green
alind tiwari
 
Greenathan
Greenathan
alind tiwari
 
Greenathan
Greenathan
alind tiwari
 
latest slide
latest slide
alind tiwari
 
latest slide
latest slide
alind tiwari
 
dfgdfgf
dfgdfgf
alind tiwari
 
latest slide
latest slide
alind tiwari
 
Unit Test for ZF SlideShare Component
Unit Test for ZF SlideShare Component
zftalk
 
Getting Started with Zend Framework
Getting Started with Zend Framework
Juan Antonio
 
PHP and Zend Framework on Windows
PHP and Zend Framework on Windows
Shahar Evron
 
MVC Frameworks for building PHP Web Applications
MVC Frameworks for building PHP Web Applications
Vforce Infotech
 
Building Web Applications with Zend Framework
Building Web Applications with Zend Framework
Phil Brown
 
Zend Framework 2, What's new, Confoo 2011
Zend Framework 2, What's new, Confoo 2011
Bachkoutou Toutou
 
Extending ZF & Extending With ZF
Extending ZF & Extending With ZF
Ralph Schindler
 
Intro To Mvc Development In Php
Intro To Mvc Development In Php
funkatron
 
DPC2007 Zend Framework (Gaylord Aulke)
DPC2007 Zend Framework (Gaylord Aulke)
dpc
 
Zend framework 06 - zend config, pdf, i18n, l10n, sessions
Zend framework 06 - zend config, pdf, i18n, l10n, sessions
Tricode (part of Dept)
 
Unit Test for ZF SlideShare Component
Unit Test for ZF SlideShare Component
zftalk
 
Ad

Recently uploaded (20)

9-1-1 Addressing: End-to-End Automation Using FME
9-1-1 Addressing: End-to-End Automation Using FME
Safe Software
 
Cyber Defense Matrix Workshop - RSA Conference
Cyber Defense Matrix Workshop - RSA Conference
Priyanka Aash
 
Improving Data Integrity: Synchronization between EAM and ArcGIS Utility Netw...
Improving Data Integrity: Synchronization between EAM and ArcGIS Utility Netw...
Safe Software
 
The Future of Data, AI, and AR: Innovation Inspired by You.pdf
The Future of Data, AI, and AR: Innovation Inspired by You.pdf
Safe Software
 
Enhance GitHub Copilot using MCP - Enterprise version.pdf
Enhance GitHub Copilot using MCP - Enterprise version.pdf
Nilesh Gule
 
Wenn alles versagt - IBM Tape schützt, was zählt! Und besonders mit dem neust...
Wenn alles versagt - IBM Tape schützt, was zählt! Und besonders mit dem neust...
Josef Weingand
 
Information Security Response Team Nepal_npCERT_Vice_President_Sudan_Jha.pdf
Information Security Response Team Nepal_npCERT_Vice_President_Sudan_Jha.pdf
ICT Frame Magazine Pvt. Ltd.
 
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Alliance
 
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
Muhammad Rizwan Akram
 
The Future of Technology: 2025-2125 by Saikat Basu.pdf
The Future of Technology: 2025-2125 by Saikat Basu.pdf
Saikat Basu
 
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Safe Software
 
OpenPOWER Foundation & Open-Source Core Innovations
OpenPOWER Foundation & Open-Source Core Innovations
IBM
 
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
Safe Software
 
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik
 
MuleSoft for AgentForce : Topic Center and API Catalog
MuleSoft for AgentForce : Topic Center and API Catalog
shyamraj55
 
Connecting Data and Intelligence: The Role of FME in Machine Learning
Connecting Data and Intelligence: The Role of FME in Machine Learning
Safe Software
 
“Key Requirements to Successfully Implement Generative AI in Edge Devices—Opt...
“Key Requirements to Successfully Implement Generative AI in Edge Devices—Opt...
Edge AI and Vision Alliance
 
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
revolcs10
 
Securing Account Lifecycles in the Age of Deepfakes.pptx
Securing Account Lifecycles in the Age of Deepfakes.pptx
FIDO Alliance
 
cnc-processing-centers-centateq-p-110-en.pdf
cnc-processing-centers-centateq-p-110-en.pdf
AmirStern2
 
9-1-1 Addressing: End-to-End Automation Using FME
9-1-1 Addressing: End-to-End Automation Using FME
Safe Software
 
Cyber Defense Matrix Workshop - RSA Conference
Cyber Defense Matrix Workshop - RSA Conference
Priyanka Aash
 
Improving Data Integrity: Synchronization between EAM and ArcGIS Utility Netw...
Improving Data Integrity: Synchronization between EAM and ArcGIS Utility Netw...
Safe Software
 
The Future of Data, AI, and AR: Innovation Inspired by You.pdf
The Future of Data, AI, and AR: Innovation Inspired by You.pdf
Safe Software
 
Enhance GitHub Copilot using MCP - Enterprise version.pdf
Enhance GitHub Copilot using MCP - Enterprise version.pdf
Nilesh Gule
 
Wenn alles versagt - IBM Tape schützt, was zählt! Und besonders mit dem neust...
Wenn alles versagt - IBM Tape schützt, was zählt! Und besonders mit dem neust...
Josef Weingand
 
Information Security Response Team Nepal_npCERT_Vice_President_Sudan_Jha.pdf
Information Security Response Team Nepal_npCERT_Vice_President_Sudan_Jha.pdf
ICT Frame Magazine Pvt. Ltd.
 
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Alliance
 
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
Muhammad Rizwan Akram
 
The Future of Technology: 2025-2125 by Saikat Basu.pdf
The Future of Technology: 2025-2125 by Saikat Basu.pdf
Saikat Basu
 
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Smarter Aviation Data Management: Lessons from Swedavia Airports and Sweco
Safe Software
 
OpenPOWER Foundation & Open-Source Core Innovations
OpenPOWER Foundation & Open-Source Core Innovations
IBM
 
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
Safe Software
 
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik
 
MuleSoft for AgentForce : Topic Center and API Catalog
MuleSoft for AgentForce : Topic Center and API Catalog
shyamraj55
 
Connecting Data and Intelligence: The Role of FME in Machine Learning
Connecting Data and Intelligence: The Role of FME in Machine Learning
Safe Software
 
“Key Requirements to Successfully Implement Generative AI in Edge Devices—Opt...
“Key Requirements to Successfully Implement Generative AI in Edge Devices—Opt...
Edge AI and Vision Alliance
 
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
ReSTIR [DI]: Spatiotemporal reservoir resampling for real-time ray tracing ...
revolcs10
 
Securing Account Lifecycles in the Age of Deepfakes.pptx
Securing Account Lifecycles in the Age of Deepfakes.pptx
FIDO Alliance
 
cnc-processing-centers-centateq-p-110-en.pdf
cnc-processing-centers-centateq-p-110-en.pdf
AmirStern2
 

PHPBootcamp - Zend Framework

  • 1. Zend Framework Thomas Weidner I18N Team Leader and Core Developer, for the Zend Framework Now, the world's most popular web programming language gets even better with an easy to use framework for developing the next generation of web applications.
  • 2. What is the Zend Framework? PHP 5 class library for web development Free, open source, BSD license (like PHP) +150,000 lines of code Emphasis on quality: 90%+ unit test coverage Solutions are “extremely simple” – solving the 80% usage case, and allowing for extensibility +200,000 downloads http://framework.zend.com/
  • 3. History of the Zend Framework Brought to live at 19.October 2005 by Zend at the IST in California First official preview 03.March.2006 (V0.1.1) 12 official releases since 2006 Actual release 1.0RC1 Official 1.0 proposed for July
  • 4. What’s in the Zend Framework? MVC web app framework (model-view-controller) Database access Lucene-compatible Search engine Input filtering and validation Authentication Access control Session handling I18N, translation PDF file reading and writing HTTP client XmlRpc REST web services RSS and Atom feeds Google Gdata client Logging Mail reading and sending Caching Configuration file handling Command-line option parsing Simple, convenient object-oriented solutions to common web application development tasks:
  • 6. Component Overview 1/4 MVC Layer Zend_Controller – Controller Pattern Zend_View – View Pattern DATA Layer Zend_Db – Database Handling Zend_Pdf – PDF Creation and Handling Zend_Search – Lucene Search I18N Layer Zend_Date – Localized Date handling Zend_Locale – I18N Base class, Localisation Zend_Measure – Measurements, conversions Zend_Translate – Translations
  • 7. Component Overview 2/4 WEB Services Layer Zend_Feed – RSS und ATOM Feeds Zend_GData – Google Data Client Zend_Http – HTTP Client and Server Zend_Json – JSON Access Zend_Rest – Rest Client and Server Zend_XmlRpc – XMLRPC Client and Server Zend_Service – Access for different web services including Askimet Amazon Audioscrobbler Delicious Flickr Simpy Yahoo and more are already in the incubator or proposed
  • 8. Component Overview 3/4 Core Layer Zend_Acl – Access Controll List, Limiting ressources, roles, users Zend_Auth – Authentication Zend_Cache – Caching Zend_Config – Configuration Handling Zend_Console – Console Options Handling Zend_Filter – Filtering Input data Zend_Log – Log file Handling (log4j based) Zend_Mail – Mail sending and receiving Zend_Memory – Memory Access when memory is limited Zend_Registry – Storing data within an application registry Zend_Session – Session Handling Zend_Validate – Validating
  • 9. Component Overview 4/4 Incubator Components… after 1.0 release, already partitial useable Zend_Currency – Localized currency handling (I18N) Zend_Environment – (Core) Zend_Form – Form handling (MVC) Zend_Soap – Soap Client and Server (Services) Zend_Timesync – Timeserver access (NTP, SNTP) (I18N) Future Components Several additional components proposed including… LDAP, Calendar, PayPal, YouTube, Yaml… Proposals http://framework.zend.com/wiki/display/ZFPROP/Home
  • 10. Directory layout /Zend /Zend/Locale.php /Zend/Locale /Zend/Locale/Format.php … A component is always a base class and all subclasses in it’s same named directory. .. This way single components can be used without installing the complete framework…
  • 11. Minimum requirements Some Minimum requirements PHP 5.1.4 Webserver Standard installation commonly no additional extensions needed That’s all…
  • 12. A simple example 1/4 A simple example – Localisation: <?php require_once ‘Zend/Locale.php’; $locale = new Zend_Locale(); print $locale->toString();
  • 13. A simple example 2/4 Each class can be used alone: <?php require_once ‘Zend/Locale.php’; $locale = new Zend_Locale(); print $locale->toString(); Requiring the file is enough… Each component knows which other components it has to load
  • 14. A simple example 3/4 Location of the ZF components: <?php require_once ‘Zend/Locale.php’; $locale = new Zend_Locale(); print $locale->toString(); All components are in the same directory.
  • 15. A simple example 4/4 The result: our users language <?php require_once ‘Zend/Locale.php’; $locale = new Zend_Locale(); print $locale->toString(); The visiting users language…
  • 16. Localisation Possibilities of Zend_Locale Get the client users languages Get localized data Base localisation class for ZF Locale aware formating of numbers, dates and times Example1 Example2
  • 17. Localized data Localized and translated data: Translation for all languages Translation for all scripts Translation for countries and territories Calendar formats Month- and Day names Standard formats for Date and Time Currency name, signs and formats Characters used in this language Yes and no strings …
  • 18. Locale aware formating rules Zend_Locale_Format Converting from one script to another Normalizing of numbers (12,345.45 -> 12345.45) Localizing of numbers (12345.45 -> 12,345.45) Checking if a localized number is valid Normalizing date & time inputs Checking if a localized date or time input is valid
  • 19. Script conversion From european digits to arabic digits and visa versa <?php require_once ‘Zend/Locale.php’; $number = “12345”; $converted = Zend_Locale_Format::convertNumerals($number, ‘Latn’, ‘Arab’); $european = Zend_Locale_Format::convertNumerals($converted, ‘Arab’, ‘Latn’); Example3
  • 20. Number normalization Normalizing numbers <?php require_once ‘Zend/Locale.php’; $number = “12.345,67”; $normal = Zend_Locale_Format::getNumber($number); Example4
  • 21. Number localization Localizing numbers <?php require_once ‘Zend/Locale.php’; $number = 12345.67; $normal = Zend_Locale_Format::toNumber($number); Example5 Example8
  • 22. Multilingual applications Making applications running worldwide Translating output Format of date and time Format of numbers Format of currencies Knowing allowed characters of a language
  • 23. Translation Gettext… the old way <?php bindtextdomain(‘domain’, ‘path’); textdomain(‘domain’); print gettext(‘my translation’); Fixed directory layout /path/LC_ALL/locale/ Needs an extension to work Complicated for people unfamiliar to GNUs gettext
  • 24. Zend_Translate Gettext… with Zend_Translate <?php require_once ‘Zend/Translate.php’; // within bootstrap file $tr = new Zend_Translate(AN_ARRAY, ‘Path/to/myfile.mo’, ‘de’); print $tr->_(‘my translation’); No fixed directory layout No extension needed Same API for all sources
  • 25. Zend_Translate sources Zend_Translate sources One API for all sources Supported sources are: Array Csv Gettext Qt Tmx Xliff More to come (SQL, XmlTm, …)
  • 26. Switching sources Changing sources ? No problem… <?php require_once ‘Zend/Translate.php’; // within bootstrap file $tr = new Zend_Translate( AN_CSV , ‘Path/to/ myfile.csv ’, ‘de’); print $tr->_(‘my translation’); <?php require_once ‘Zend/Translate.php’; // within bootstrap file $tr = new Zend_Translate( AN_GETTEXT , ‘Path/to/ myfile.mo ’, ‘de’); print $tr->_(‘my translation’); Just one small change, same API
  • 27. Conditional translating Is a string translateable ? <?php require_once ‘Zend/Translate.php’; // within bootstrap file $tr = new Zend_Translate(AN_CSV, ‘Path/to/myfile.csv’, ‘de’); if ($tr->isTranslated(‘my translation’)) { // do something } else { // no translation, do something else } Not possible with php
  • 28. Allowed characters Verifying input… but localized ? <?php require_once ‘Zend/Locale.php’; // within bootstrap file $tr = new Zend_Locale(); $de = $tr->getTranslationList(‘characters’, ‘de’); $fr = $tr->getTranslationList(‘characters’, ‘fr’); For more than 128 languages Example6
  • 29. Language selectbox Creating a localized selectbox for languages ? <?php require_once ‘Zend/Locale.php’; // within bootstrap file $tr = new Zend_Locale(); $de = $tr->getTranslationList(‘language’); foreach ($de as $key => $value) { $fr = $tr->getTranslationList(‘language’, $key); print $fr[$key]; } Example7
  • 30. Yes or No How to realize a yes-no for every language ? <?php require_once ‘Zend/Locale.php’; // within bootstrap file $tr = new Zend_Locale(); $de = $tr->getQuestion(); Example9
  • 31. Normalizing dates Monthnames / Daynames <?php require_once ‘Zend/Locale.php’; // within bootstrap file $date = “12.März.2007 20:15:00”; $tr = new Zend_Locale_Format::getDate($date, ‘de’); print_r($tr); Example10
  • 32. Working with dates Zend_Date One class Handles all meanings (date, time, parts, sun…) Simple API Easy handling ISO Standard also PHP’s GNU supported Knows more than 50 standard represenations Unlimited (more than 64bit) dates supported
  • 33. Working with dates 2 Capabilities Computing dates Get sunset / sunrise for cities Easy changing with ISO ( dd.MM.yyyy HH:mm:ss a ) Supports different standards ( ISO, GNU, RFC2822 (mail), W3C, RSS, Cookies…)
  • 34. Date maths Computing dates Normalized Localized Added / Substracted Checked (earlier, later, equal Splitted Converted …
  • 35. Date example Example11 $date = new Zend_Date(‘20070414T122050’, Zend_Date::ISO_8601); $date->addMonth(2); $date->subYear(6); If ($date->isLeapYear()) { // LeapYear } else { // NO LeapYear }
  • 36. Checking dates Check if a date is a date If ( Zend_Date::isDate(’14. April. 2007 10:20:55’)) Example12 Compare parts If ( $date->compareWeekday(2)) Example13
  • 37. Stay up Calculating sunset / sunrise With php… complicated With Zend_Date… just know your city $city = Zend_Date_Cities::City(‘Amsterdam’); $date = new Zend_Date(); $uptime = $date->getSunrise($city)
  • 38. At the end Simple solution Easy handling Easy extending – 80% use case High quality Growing fast
  • 39. Contact us http://framework.zend.com Mailinglist [email_address] Instant messager jabber.zend.com