SlideShare una empresa de Scribd logo
1 de 32
Introducing: Zend Framework

John Coggeshall




                  Copyright © 2006, Zend Technologies Inc.
Welcome

     • Today I‟ll be introducing you to the Zend
           Framework
              What it is
              Why we’re doing it
              How to use it
              Where it’s going
              How to be a part of it




8-Mar-10                                           #2
Getting Started


     • Zend Framework is..
            A modular collection of PHP classes based on PHP 5 to
             simplify common tasks
            A starting point for your applications
            A demonstration of PHP 5 best practices
            A smaller component of the PHP Collaboration Project
     • Zend Framework isn‟t…
            A free-reign open source project
            A religion




8-Mar-10                                                             #3
Goals of the Framework


     • Zend Framework strives to be fundamentally….
            An industry-leading framework for PHP application
             development
            A partnership between many companies already
             experienced in PHP Framework development
     • Zend Framework strives to be technically…
            A source of high-quality, PHP 5 / E_STRICT compatible
             application components
            Completely PHP 5 powered, requiring as few external PHP
             extensions as necessary
            A minimal object hierarchy to achieve the necessary goals
            Modular design allowing developers to use the framework at
             will, as they see fit.



8-Mar-10                                                                  #4
Why Yet another Framework?


     • Keep PHP competitive with other technologies
            .NET, Java, etc.
     • Provide “clean” IP to enable commercial use
            Real companies can’t just “borrow” code from the
             Internet without clear licensing
     • “Extreme Simplicity”: It may not be simple
           technically, but using it should be.
     •     Take full advantage of PHP 5




8-Mar-10                                                        #5
The Framework License


     • Zend Framework is licensed using a PHP/BSD
           style license
            Anyone can use it, for anything, no strings attached –
             period.
     • Along with the license of the framework itself,
           contributors must sign a Contributor License
           Agreement (CLA)




8-Mar-10                                                              #6
There’s no such thing as a free…


     • Why spend so much time and effort on
           something, just to give it away?
            Yes, we’re still interested in making money
     • For the continued success of PHP it must be a
           collaboration beyond OSS hackers
            Through the PHP Collaboration project, and projects
             like Zend Framework, we can leverage the knowledge
             of some of the best in the industry in the benefit of PHP
             as a whole
            As you might expect, Zend benefits with PHP




8-Mar-10                                                                 #7
We eat our own dog food


     • Zend Framework is more than unit-tested, it is
           used in real-life production environments
            Gives us the ability to test performance, ease of
             use, etc. in a practical environment

            Zend and its partners are already using the preview
             release of the Framework to speed development of
             their applications

            Both the Framework homepage (framework.zend.com)
             and our new Developer’s Zone (devzone.zend.com)
             use the preview release of Framework as their
             foundation.



8-Mar-10                                                           #8
The grail: Extreme Simplicity


     • Many of PHP 5‟s most exciting new technologies
           are really simple to use:
            Simple XML
            SOAP
            Tidy
     • While the underlying technologies may be
           extremely complex, the end-user APIs are
           reduced to an extremely simple interface




8-Mar-10                                                #9
Getting the Grail


     • To achieve the grail of extreme simplicity
            “Simple things should be simple, complex things should
             be possible”
     • Use-at-will architecture
            You shouldn’t be forced into buying the whole pizza
             just for a slice
            Use individual components (controller/model) without
             being forced to use everything (your own
             template/view)
     • Configuration-less
            The framework should be plug-and-go, no
             configuration files necessary



8-Mar-10                                                              # 10
Zend Framework from 10,000 feet




8-Mar-10                          # 11
Completely PHP-5 focused


     • Requires PHP 5.0.4 or later for near future
     • Takes full advantage of the PHP exception
           model
     •     Constants are all at the class-level
     •     No functions in global namespace
     •     ZE2 / SPL technologies fully utilized where it
           makes sense
     •     Black magic __magic() functions used very
           sparsely



8-Mar-10                                                    # 12
Preview Release


     • PR 1.2 is the latest preview release of the
           Framework including many immediately useful
           tools such as:
              A basic MVC framework for application design
              A PDO-based database layer
              Feed (RSS, Atom) ingestion and manipulation
              An HTTP client
              Input data filtering
              Json support for AJAX
              PDF generation and manipulation
              RPC / Web service support
              And more!



8-Mar-10                                                      # 13
Getting Zend Framework


     • You can either get the framework preview
           release or check out the latest repository version

     • Preview Release: http://framework.zend.com/

     • Repository:
              $ svn checkout http://framework.zend.com/svn/framework/trunk




8-Mar-10                                                                     # 14
Installing Zend Framework


     • Installing the framework is very easy, just modify
           your include_path to include the library/
           directory

     From php.ini:
            ……
            include_path=“.:/usr/local/lib/php:/usr/local/lib/ZendFramework”
            ……
     From .htaccess
            ……
            php_value include_path “.:/usr/local/lib/php:/usr/local/lib/ZendFramework”
            ……



8-Mar-10                                                                             # 15
MVC Pattern


     • MVC, or Model View Controller pattern is a
       powerful technique for developing user
       interfaces
     • Originally was conceived for client-side GUI
       applications and adopted to the web
     • Zend Framework provides a simplistic MVC
       model




8-Mar-10                                              # 16
Example Controller




     • Note: indexAction() is declared abstract in
           Zend_Controller_Action, and therefore must be
           defined in any Action/Page controller




8-Mar-10                                                   # 17
Passing Parameters


     • Beyond $_GET/$_POST you can also pass
           parameters to a specific controller action by
           appending them to the URL:
            http://localhost/foo/dosomething/param1/value1/param2/value2
     • Parameters can be accessed from within the
           action by name
            $this->_getParam(<key> [, <default value>]);
            $this->_getAllParams();




8-Mar-10                                                                    # 18
Dealing with 404s


     • 404 errors are no longer the responsibility of
       Apache per-se, and are more likely to result in a
       „Class not found‟ / „Method not found‟ exception
     • To deal with these Zend Framework provides two
       methods
            In the event of a controller not found, the
             IndexController::noRoute() method will be called
             instead
            In the event a controller action is not defined, it is the
             responsibility of the controller to implement safeguards
             (i.e. __call() which traps bad action calls)



8-Mar-10                                                                  # 19
Chaining Controllers


     • Controllers can be chained together to either
           break business logic out into components, or to
           otherwise redirect the user
            $this->_forward(<controller_name> [, <parameters>])
            Parameters are a series of key/value pairs
            Controller Chaining does not occur until the current
             action is complete, to immediately forward you must
             return from the current action after calling _forward()
     • Forwarding does not cause a refresh on the
           client, to physically refresh the browser
            $this->_redirect(<url>);



8-Mar-10                                                               # 20
Final thoughts on MVC


     • Although the pattern dictates three individual
       class types, they are as conceptual as functional
     • For instance a “model” or “view” isn‟t absolutely
       necessary to gain most of the benefit of MVC
            You can always perform queries from a controller
            You can always print output from a controller
     • Although not necessary, they are never the less
           recommended




8-Mar-10                                                        # 21
Input Filtering




             Copyright © 2006, Zend Technologies Inc.
Zend_InputFilter


     • Security is a primary concern in Zend Framework
     • As such, we provide facilities to clean and
           manage untrusted data in your applications via
           Zend_InputFilter and Zend_Filter
            Provides a number of methods for filtering data against
             many common data types
             (digits, alphanumeric, alpha, phone, etc.)




8-Mar-10                                                               # 23
Using Zend_InputFilter

     • With Input Filter you can both test data types and
           retrieve filtered data easily




     • Note, by default the source of the data and all of
           it‟s references are destroyed when filtered

8-Mar-10                                                    # 24
Zend_Mail


     • Simplifies building and sending e-mail

     • Supports MIME types and multipart e-mail

     • Supports multiple transports and persistent
           connections automatically

     • Supports large file attachments via the streams
           API improving performance



8-Mar-10                                                 # 25
Sending HTML mail is now really easy




8-Mar-10                               # 26
Zend_Search


     • PHP 5 implementation of the popular Lucene
           search engine from the Java world.

     • Simplified API

     • Requires no special PHP extensions

     • Fully compatible with the binary index format of
           Java Lucene 1.4 and above



8-Mar-10                                                  # 27
Zend_Search Features


     • Ranked Searching
            Best results always first

     • Many Query types: phrase, wildcard, proximity

     • Search by field (Author, title, body, etc.)

     • Robust, and simple API
            One-method intelligent searches against indexes, or
             complex OO queries if desired
            Index multiple document types, with different field
             requirements
8-Mar-10                                                           # 28
Using Zend_Search


     • Using Zend Search is very easy




     • The search engine also boasts a parser for
           google-like searching: zend php -java

8-Mar-10                                            # 29
Adding documents to the index




8-Mar-10                        # 30
Cool things about Zend_Search


     • The Lucene search engine allows you to index
           multiple document types in a single index, each
           with different index fields
            Index Individual documents with different searchable
             criterion
            I.e. Index code samples by functions used, while articles
             by title, author, and keywords in the same index
     • Because it is 100% compatible with Lucene
           1.4+, it is compatible with all pre-created index
           files



8-Mar-10                                                                 # 31
Questions?




             Copyright © 2006, Zend Technologies Inc.

Más contenido relacionado

La actualidad más candente

Zend Server: A Guided Tour
Zend Server: A Guided TourZend Server: A Guided Tour
Zend Server: A Guided TourShahar Evron
 
Install MariaDB on IBM i - Tips, troubleshooting, and more
Install MariaDB on IBM i - Tips, troubleshooting, and moreInstall MariaDB on IBM i - Tips, troubleshooting, and more
Install MariaDB on IBM i - Tips, troubleshooting, and moreRod Flohr
 
DB2 and PHP in Depth on IBM i
DB2 and PHP in Depth on IBM iDB2 and PHP in Depth on IBM i
DB2 and PHP in Depth on IBM iAlan Seiden
 
Tiery Eyed
Tiery EyedTiery Eyed
Tiery EyedZendCon
 
Debugging with Zend Studio for Eclipse
Debugging with Zend Studio for EclipseDebugging with Zend Studio for Eclipse
Debugging with Zend Studio for EclipseOSSCube
 
Best Practices in PHP Application Deployment
Best Practices in PHP Application DeploymentBest Practices in PHP Application Deployment
Best Practices in PHP Application DeploymentShahar Evron
 
DA with Wa - Desktop Apps With Web Apps
DA with Wa - Desktop Apps With Web AppsDA with Wa - Desktop Apps With Web Apps
DA with Wa - Desktop Apps With Web Appsphptechtalk
 
PHP Batch Jobs on IBM i
PHP Batch Jobs on IBM iPHP Batch Jobs on IBM i
PHP Batch Jobs on IBM iAlan Seiden
 
PHP Quality Assurance Workshop PHPBenelux
PHP Quality Assurance Workshop PHPBeneluxPHP Quality Assurance Workshop PHPBenelux
PHP Quality Assurance Workshop PHPBeneluxNick Belhomme
 
ZF2 Modular Architecture - Taking advantage of it
ZF2 Modular Architecture - Taking advantage of itZF2 Modular Architecture - Taking advantage of it
ZF2 Modular Architecture - Taking advantage of itSteve Maraspin
 
Web services on IBM i with PHP and Zend Framework
Web services on IBM i with PHP and Zend FrameworkWeb services on IBM i with PHP and Zend Framework
Web services on IBM i with PHP and Zend FrameworkAlan Seiden
 
JavaOne 2015 CON7547 "Beyond the Coffee Cup: Leveraging Java Runtime Technolo...
JavaOne 2015 CON7547 "Beyond the Coffee Cup: Leveraging Java Runtime Technolo...JavaOne 2015 CON7547 "Beyond the Coffee Cup: Leveraging Java Runtime Technolo...
JavaOne 2015 CON7547 "Beyond the Coffee Cup: Leveraging Java Runtime Technolo...0xdaryl
 
Writing Services with ZF2
Writing Services with ZF2Writing Services with ZF2
Writing Services with ZF2Mike Willbanks
 
A Java Implementer's Guide to Better Apache Spark Performance
A Java Implementer's Guide to Better Apache Spark PerformanceA Java Implementer's Guide to Better Apache Spark Performance
A Java Implementer's Guide to Better Apache Spark PerformanceTim Ellison
 
開放原始碼 Ch1.2 intro - oss - apahce foundry (ver 2.0)
開放原始碼 Ch1.2   intro - oss - apahce foundry (ver 2.0)開放原始碼 Ch1.2   intro - oss - apahce foundry (ver 2.0)
開放原始碼 Ch1.2 intro - oss - apahce foundry (ver 2.0)My own sweet home!
 
eSoftHead - groupware solution
eSoftHead - groupware solutioneSoftHead - groupware solution
eSoftHead - groupware solutionNguyen Hai
 
Multi criteria queries on a cassandra application
Multi criteria queries on a cassandra applicationMulti criteria queries on a cassandra application
Multi criteria queries on a cassandra applicationIppon
 
Desperately seeking a lightweight Perl framework
Desperately seeking a lightweight Perl frameworkDesperately seeking a lightweight Perl framework
Desperately seeking a lightweight Perl frameworkPeter Edwards
 

La actualidad más candente (19)

Zend Server: A Guided Tour
Zend Server: A Guided TourZend Server: A Guided Tour
Zend Server: A Guided Tour
 
Install MariaDB on IBM i - Tips, troubleshooting, and more
Install MariaDB on IBM i - Tips, troubleshooting, and moreInstall MariaDB on IBM i - Tips, troubleshooting, and more
Install MariaDB on IBM i - Tips, troubleshooting, and more
 
DB2 and PHP in Depth on IBM i
DB2 and PHP in Depth on IBM iDB2 and PHP in Depth on IBM i
DB2 and PHP in Depth on IBM i
 
Tiery Eyed
Tiery EyedTiery Eyed
Tiery Eyed
 
Debugging with Zend Studio for Eclipse
Debugging with Zend Studio for EclipseDebugging with Zend Studio for Eclipse
Debugging with Zend Studio for Eclipse
 
Best Practices in PHP Application Deployment
Best Practices in PHP Application DeploymentBest Practices in PHP Application Deployment
Best Practices in PHP Application Deployment
 
DA with Wa - Desktop Apps With Web Apps
DA with Wa - Desktop Apps With Web AppsDA with Wa - Desktop Apps With Web Apps
DA with Wa - Desktop Apps With Web Apps
 
PHP Batch Jobs on IBM i
PHP Batch Jobs on IBM iPHP Batch Jobs on IBM i
PHP Batch Jobs on IBM i
 
PHP Quality Assurance Workshop PHPBenelux
PHP Quality Assurance Workshop PHPBeneluxPHP Quality Assurance Workshop PHPBenelux
PHP Quality Assurance Workshop PHPBenelux
 
ZF2 Modular Architecture - Taking advantage of it
ZF2 Modular Architecture - Taking advantage of itZF2 Modular Architecture - Taking advantage of it
ZF2 Modular Architecture - Taking advantage of it
 
Web services on IBM i with PHP and Zend Framework
Web services on IBM i with PHP and Zend FrameworkWeb services on IBM i with PHP and Zend Framework
Web services on IBM i with PHP and Zend Framework
 
JavaOne 2015 CON7547 "Beyond the Coffee Cup: Leveraging Java Runtime Technolo...
JavaOne 2015 CON7547 "Beyond the Coffee Cup: Leveraging Java Runtime Technolo...JavaOne 2015 CON7547 "Beyond the Coffee Cup: Leveraging Java Runtime Technolo...
JavaOne 2015 CON7547 "Beyond the Coffee Cup: Leveraging Java Runtime Technolo...
 
Writing Services with ZF2
Writing Services with ZF2Writing Services with ZF2
Writing Services with ZF2
 
A Java Implementer's Guide to Better Apache Spark Performance
A Java Implementer's Guide to Better Apache Spark PerformanceA Java Implementer's Guide to Better Apache Spark Performance
A Java Implementer's Guide to Better Apache Spark Performance
 
開放原始碼 Ch1.2 intro - oss - apahce foundry (ver 2.0)
開放原始碼 Ch1.2   intro - oss - apahce foundry (ver 2.0)開放原始碼 Ch1.2   intro - oss - apahce foundry (ver 2.0)
開放原始碼 Ch1.2 intro - oss - apahce foundry (ver 2.0)
 
eSoftHead - groupware solution
eSoftHead - groupware solutioneSoftHead - groupware solution
eSoftHead - groupware solution
 
Multi criteria queries on a cassandra application
Multi criteria queries on a cassandra applicationMulti criteria queries on a cassandra application
Multi criteria queries on a cassandra application
 
Maven
MavenMaven
Maven
 
Desperately seeking a lightweight Perl framework
Desperately seeking a lightweight Perl frameworkDesperately seeking a lightweight Perl framework
Desperately seeking a lightweight Perl framework
 

Destacado (20)

Yeni microsoft office power point sunusu
Yeni microsoft office power point sunusuYeni microsoft office power point sunusu
Yeni microsoft office power point sunusu
 
Lab report sheet
Lab report sheetLab report sheet
Lab report sheet
 
aprueba
apruebaaprueba
aprueba
 
Green Color of Islam
Green Color of IslamGreen Color of Islam
Green Color of Islam
 
20090929_Personal data
20090929_Personal data20090929_Personal data
20090929_Personal data
 
Kpr präs webtest2
Kpr präs webtest2Kpr präs webtest2
Kpr präs webtest2
 
Sedimentary
SedimentarySedimentary
Sedimentary
 
Masa Depanku Gilang 6 B
Masa Depanku Gilang 6 BMasa Depanku Gilang 6 B
Masa Depanku Gilang 6 B
 
Playground - 8th February
Playground - 8th FebruaryPlayground - 8th February
Playground - 8th February
 
Crm in 1 day 2014
Crm in 1 day 2014Crm in 1 day 2014
Crm in 1 day 2014
 
Gw 3d Landscape Databases
Gw 3d Landscape DatabasesGw 3d Landscape Databases
Gw 3d Landscape Databases
 
Pp Lect4 5
Pp Lect4 5Pp Lect4 5
Pp Lect4 5
 
20091012_Personal data_02
20091012_Personal data_0220091012_Personal data_02
20091012_Personal data_02
 
Pp Lect7 1
Pp Lect7 1Pp Lect7 1
Pp Lect7 1
 
I pv6
I pv6I pv6
I pv6
 
Garbage west
Garbage westGarbage west
Garbage west
 
Adjectives and adverbs
Adjectives and adverbsAdjectives and adverbs
Adjectives and adverbs
 
Jquickprofileupload
JquickprofileuploadJquickprofileupload
Jquickprofileupload
 
Pp Lect9 10 1
Pp Lect9 10 1Pp Lect9 10 1
Pp Lect9 10 1
 
waste mgt
waste mgtwaste mgt
waste mgt
 

Similar a green

Unit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentUnit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentDiego Delon
 
Unit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentUnit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentKaiuwe
 
Unit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentUnit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentKaiuwe
 
Unit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentUnit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentKaiuwe
 
Unit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentUnit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentKaiuwe
 
Unit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentUnit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentDiego Delon
 
Unit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentUnit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentDiego Delon
 
Unit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentUnit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentDiego Delon
 
Unit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentUnit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentDiego Delon
 
Unit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentUnit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentDiego Delon
 
Unit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentUnit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentDiego Delon
 
Unit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentUnit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentKaiuwe
 
Unit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentUnit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentKaiuwe
 

Similar a green (20)

Unit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentUnit Test for ZF SlideShare Component
Unit Test for ZF SlideShare Component
 
Unit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentUnit Test for ZF SlideShare Component
Unit Test for ZF SlideShare Component
 
Unit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentUnit Test for ZF SlideShare Component
Unit Test for ZF SlideShare Component
 
Unit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentUnit Test for ZF SlideShare Component
Unit Test for ZF SlideShare Component
 
Unit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentUnit Test for ZF SlideShare Component
Unit Test for ZF SlideShare Component
 
Unit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentUnit Test for ZF SlideShare Component
Unit Test for ZF SlideShare Component
 
Unit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentUnit Test for ZF SlideShare Component
Unit Test for ZF SlideShare Component
 
Unit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentUnit Test for ZF SlideShare Component
Unit Test for ZF SlideShare Component
 
Unit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentUnit Test for ZF SlideShare Component
Unit Test for ZF SlideShare Component
 
Unit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentUnit Test for ZF SlideShare Component
Unit Test for ZF SlideShare Component
 
Unit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentUnit Test for ZF SlideShare Component
Unit Test for ZF SlideShare Component
 
Unit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentUnit Test for ZF SlideShare Component
Unit Test for ZF SlideShare Component
 
Unit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentUnit Test for ZF SlideShare Component
Unit Test for ZF SlideShare Component
 
Demo
DemoDemo
Demo
 
first pitch
first pitchfirst pitch
first pitch
 
werwr
werwrwerwr
werwr
 
sdfsdf
sdfsdfsdfsdf
sdfsdf
 
college
collegecollege
college
 
first pitch
first pitchfirst pitch
first pitch
 
Greenathan
GreenathanGreenathan
Greenathan
 

Más de alind tiwari

Rainforest alliance pdf_test
Rainforest alliance pdf_testRainforest alliance pdf_test
Rainforest alliance pdf_testalind tiwari
 
Eco computing test
Eco computing testEco computing test
Eco computing testalind tiwari
 
Recyle the E-waste-T
Recyle the E-waste-TRecyle the E-waste-T
Recyle the E-waste-Talind tiwari
 
organic community garden suggestion
organic community garden suggestionorganic community garden suggestion
organic community garden suggestionalind tiwari
 
silent features of organic f
silent features of organic fsilent features of organic f
silent features of organic falind tiwari
 
silent features of organic f
silent features of organic fsilent features of organic f
silent features of organic falind tiwari
 
Provide a venue for recycling electronic waste in Brooklyn
Provide a venue for recycling electronic waste in BrooklynProvide a venue for recycling electronic waste in Brooklyn
Provide a venue for recycling electronic waste in Brooklynalind tiwari
 
T-recylce the E-waste
T-recylce the E-wasteT-recylce the E-waste
T-recylce the E-wastealind tiwari
 
one slide solution
one slide solutionone slide solution
one slide solutionalind tiwari
 

Más de alind tiwari (20)

Rainforest alliance pdf_test
Rainforest alliance pdf_testRainforest alliance pdf_test
Rainforest alliance pdf_test
 
Eco computing test
Eco computing testEco computing test
Eco computing test
 
Global Recycling
Global RecyclingGlobal Recycling
Global Recycling
 
Recyle the E-waste-T
Recyle the E-waste-TRecyle the E-waste-T
Recyle the E-waste-T
 
green tea
green teagreen tea
green tea
 
organic community garden suggestion
organic community garden suggestionorganic community garden suggestion
organic community garden suggestion
 
final test
final testfinal test
final test
 
silent features of organic f
silent features of organic fsilent features of organic f
silent features of organic f
 
final test
final testfinal test
final test
 
silent features of organic f
silent features of organic fsilent features of organic f
silent features of organic f
 
my new pitch
my new pitchmy new pitch
my new pitch
 
Test Nan
Test NanTest Nan
Test Nan
 
Provide a venue for recycling electronic waste in Brooklyn
Provide a venue for recycling electronic waste in BrooklynProvide a venue for recycling electronic waste in Brooklyn
Provide a venue for recycling electronic waste in Brooklyn
 
One note
One noteOne note
One note
 
test
testtest
test
 
Save trees
Save treesSave trees
Save trees
 
T-recylce the E-waste
T-recylce the E-wasteT-recylce the E-waste
T-recylce the E-waste
 
Nan's pitch
Nan's pitchNan's pitch
Nan's pitch
 
one slide solution
one slide solutionone slide solution
one slide solution
 
Good one
Good oneGood one
Good one
 

green

  • 1. Introducing: Zend Framework John Coggeshall Copyright © 2006, Zend Technologies Inc.
  • 2. Welcome • Today I‟ll be introducing you to the Zend Framework  What it is  Why we’re doing it  How to use it  Where it’s going  How to be a part of it 8-Mar-10 #2
  • 3. Getting Started • Zend Framework is..  A modular collection of PHP classes based on PHP 5 to simplify common tasks  A starting point for your applications  A demonstration of PHP 5 best practices  A smaller component of the PHP Collaboration Project • Zend Framework isn‟t…  A free-reign open source project  A religion 8-Mar-10 #3
  • 4. Goals of the Framework • Zend Framework strives to be fundamentally….  An industry-leading framework for PHP application development  A partnership between many companies already experienced in PHP Framework development • Zend Framework strives to be technically…  A source of high-quality, PHP 5 / E_STRICT compatible application components  Completely PHP 5 powered, requiring as few external PHP extensions as necessary  A minimal object hierarchy to achieve the necessary goals  Modular design allowing developers to use the framework at will, as they see fit. 8-Mar-10 #4
  • 5. Why Yet another Framework? • Keep PHP competitive with other technologies  .NET, Java, etc. • Provide “clean” IP to enable commercial use  Real companies can’t just “borrow” code from the Internet without clear licensing • “Extreme Simplicity”: It may not be simple technically, but using it should be. • Take full advantage of PHP 5 8-Mar-10 #5
  • 6. The Framework License • Zend Framework is licensed using a PHP/BSD style license  Anyone can use it, for anything, no strings attached – period. • Along with the license of the framework itself, contributors must sign a Contributor License Agreement (CLA) 8-Mar-10 #6
  • 7. There’s no such thing as a free… • Why spend so much time and effort on something, just to give it away?  Yes, we’re still interested in making money • For the continued success of PHP it must be a collaboration beyond OSS hackers  Through the PHP Collaboration project, and projects like Zend Framework, we can leverage the knowledge of some of the best in the industry in the benefit of PHP as a whole  As you might expect, Zend benefits with PHP 8-Mar-10 #7
  • 8. We eat our own dog food • Zend Framework is more than unit-tested, it is used in real-life production environments  Gives us the ability to test performance, ease of use, etc. in a practical environment  Zend and its partners are already using the preview release of the Framework to speed development of their applications  Both the Framework homepage (framework.zend.com) and our new Developer’s Zone (devzone.zend.com) use the preview release of Framework as their foundation. 8-Mar-10 #8
  • 9. The grail: Extreme Simplicity • Many of PHP 5‟s most exciting new technologies are really simple to use:  Simple XML  SOAP  Tidy • While the underlying technologies may be extremely complex, the end-user APIs are reduced to an extremely simple interface 8-Mar-10 #9
  • 10. Getting the Grail • To achieve the grail of extreme simplicity  “Simple things should be simple, complex things should be possible” • Use-at-will architecture  You shouldn’t be forced into buying the whole pizza just for a slice  Use individual components (controller/model) without being forced to use everything (your own template/view) • Configuration-less  The framework should be plug-and-go, no configuration files necessary 8-Mar-10 # 10
  • 11. Zend Framework from 10,000 feet 8-Mar-10 # 11
  • 12. Completely PHP-5 focused • Requires PHP 5.0.4 or later for near future • Takes full advantage of the PHP exception model • Constants are all at the class-level • No functions in global namespace • ZE2 / SPL technologies fully utilized where it makes sense • Black magic __magic() functions used very sparsely 8-Mar-10 # 12
  • 13. Preview Release • PR 1.2 is the latest preview release of the Framework including many immediately useful tools such as:  A basic MVC framework for application design  A PDO-based database layer  Feed (RSS, Atom) ingestion and manipulation  An HTTP client  Input data filtering  Json support for AJAX  PDF generation and manipulation  RPC / Web service support  And more! 8-Mar-10 # 13
  • 14. Getting Zend Framework • You can either get the framework preview release or check out the latest repository version • Preview Release: http://framework.zend.com/ • Repository: $ svn checkout http://framework.zend.com/svn/framework/trunk 8-Mar-10 # 14
  • 15. Installing Zend Framework • Installing the framework is very easy, just modify your include_path to include the library/ directory From php.ini: …… include_path=“.:/usr/local/lib/php:/usr/local/lib/ZendFramework” …… From .htaccess …… php_value include_path “.:/usr/local/lib/php:/usr/local/lib/ZendFramework” …… 8-Mar-10 # 15
  • 16. MVC Pattern • MVC, or Model View Controller pattern is a powerful technique for developing user interfaces • Originally was conceived for client-side GUI applications and adopted to the web • Zend Framework provides a simplistic MVC model 8-Mar-10 # 16
  • 17. Example Controller • Note: indexAction() is declared abstract in Zend_Controller_Action, and therefore must be defined in any Action/Page controller 8-Mar-10 # 17
  • 18. Passing Parameters • Beyond $_GET/$_POST you can also pass parameters to a specific controller action by appending them to the URL:  http://localhost/foo/dosomething/param1/value1/param2/value2 • Parameters can be accessed from within the action by name  $this->_getParam(<key> [, <default value>]);  $this->_getAllParams(); 8-Mar-10 # 18
  • 19. Dealing with 404s • 404 errors are no longer the responsibility of Apache per-se, and are more likely to result in a „Class not found‟ / „Method not found‟ exception • To deal with these Zend Framework provides two methods  In the event of a controller not found, the IndexController::noRoute() method will be called instead  In the event a controller action is not defined, it is the responsibility of the controller to implement safeguards (i.e. __call() which traps bad action calls) 8-Mar-10 # 19
  • 20. Chaining Controllers • Controllers can be chained together to either break business logic out into components, or to otherwise redirect the user  $this->_forward(<controller_name> [, <parameters>])  Parameters are a series of key/value pairs  Controller Chaining does not occur until the current action is complete, to immediately forward you must return from the current action after calling _forward() • Forwarding does not cause a refresh on the client, to physically refresh the browser  $this->_redirect(<url>); 8-Mar-10 # 20
  • 21. Final thoughts on MVC • Although the pattern dictates three individual class types, they are as conceptual as functional • For instance a “model” or “view” isn‟t absolutely necessary to gain most of the benefit of MVC  You can always perform queries from a controller  You can always print output from a controller • Although not necessary, they are never the less recommended 8-Mar-10 # 21
  • 22. Input Filtering Copyright © 2006, Zend Technologies Inc.
  • 23. Zend_InputFilter • Security is a primary concern in Zend Framework • As such, we provide facilities to clean and manage untrusted data in your applications via Zend_InputFilter and Zend_Filter  Provides a number of methods for filtering data against many common data types (digits, alphanumeric, alpha, phone, etc.) 8-Mar-10 # 23
  • 24. Using Zend_InputFilter • With Input Filter you can both test data types and retrieve filtered data easily • Note, by default the source of the data and all of it‟s references are destroyed when filtered 8-Mar-10 # 24
  • 25. Zend_Mail • Simplifies building and sending e-mail • Supports MIME types and multipart e-mail • Supports multiple transports and persistent connections automatically • Supports large file attachments via the streams API improving performance 8-Mar-10 # 25
  • 26. Sending HTML mail is now really easy 8-Mar-10 # 26
  • 27. Zend_Search • PHP 5 implementation of the popular Lucene search engine from the Java world. • Simplified API • Requires no special PHP extensions • Fully compatible with the binary index format of Java Lucene 1.4 and above 8-Mar-10 # 27
  • 28. Zend_Search Features • Ranked Searching  Best results always first • Many Query types: phrase, wildcard, proximity • Search by field (Author, title, body, etc.) • Robust, and simple API  One-method intelligent searches against indexes, or complex OO queries if desired  Index multiple document types, with different field requirements 8-Mar-10 # 28
  • 29. Using Zend_Search • Using Zend Search is very easy • The search engine also boasts a parser for google-like searching: zend php -java 8-Mar-10 # 29
  • 30. Adding documents to the index 8-Mar-10 # 30
  • 31. Cool things about Zend_Search • The Lucene search engine allows you to index multiple document types in a single index, each with different index fields  Index Individual documents with different searchable criterion  I.e. Index code samples by functions used, while articles by title, author, and keywords in the same index • Because it is 100% compatible with Lucene 1.4+, it is compatible with all pre-created index files 8-Mar-10 # 31
  • 32. Questions? Copyright © 2006, Zend Technologies Inc.