SlideShare a Scribd company logo
Using Zend_Tool to Establish Your Project's Skeleton DFW Apache LAMP Group presented by Jeremy Brown, ZCE 1 Feb 2010
Housekeeping
Who Am I? Jeremy Brown, Zend Certified Engineer (ZCE)   Have been using PHP since 1999 (PHP 3) Have been using Zend Framework since 2008 (version 1.0.4) Software Architect / Team Lead at Spear One (spearone.com)
Contact Information Blog: notmessenger.com Twitter: twitter.com/notmessenger Email: jeremy@notmessenger.com IRC: #zftalk and #dallasphp  (irc.freenode.net)
Where to find this presentation On my blog notmessenger.com/presentations Slideshare.net <insert link here>
How to provide feedback Via Joind.in http://joind.in/event/view/136
Your turn – who are you? How many of you have heard of Zend Framework before?
Your turn – who are you? How many of you have heard of Zend Framework before? How many of you have played with it a little bit?
Your turn – who are you? How many of you have heard of Zend Framework before? How many of you have played with it a little bit? How many of you use it in a project or on a regular basis?
Groundwork
What is Zend Framework An open source, object-oriented web application framework implemented in PHP 5 All components are fully object-oriented PHP 5 and are E_STRICT compliant Use-at-will architecture with loosely-coupled components and minimal interdependencies Provides individual components for many common requirements in web application development
So what is Zend_Tool? Zend_Tool is both rapid application development (RAD) tools as well as a framework for exposing your own set of tooling needs to the Zend_Tool user interface.
So what is Zend_Tool? Zend_Tool is both rapid application development (RAD) tools as well as a framework for exposing your own set of tooling needs to the Zend_Tool user interface. No, really, what is Zend_Tool?
Basic structure of a ZF application … OR…
Where’s the beef? Main Classes & APIs: Zend_Tool_Framework The component responsible for dispatching tooling requests Zend_Tool_Project The component responsible for exposing the “project specific” tooling capabilities Inspired by talk by Ralph Schindler of Zend, at ZendCon 2009 http://www.slideshare.net/ZendCon/zendtool-practical-use-and-extending
Where’s the beef? Main Classes & APIs: Zend_Tool_Framework The component responsible for dispatching tooling requests Zend_Tool_Project The component responsible for exposing the “project specific” tooling capabilities And the gravy… Supporting Classes & APIs: Zend_CodeGenerator Zend_Reflection Inspired by talk by Ralph Schindler of Zend, at ZendCon 2009 http://www.slideshare.net/ZendCon/zendtool-practical-use-and-extending
Zend_Tool_Framework
Zend_Tool_Framework sub-parts Zend_Tool_Framework Dispatch-style framework, designed to abstract enough system internals to make extensibility easy “ Flexibility of the tooling dispatch over speed of tooling dispatch” Broken down into logical sub-parts: Client Client storage & configuration Loader Provider & Provider Repository Manifest, Manifest Repository & Metadata System (Built-in) Providers From talk by Ralph Schindler of Zend, at ZendCon 2009 http://www.slideshare.net/ZendCon/zendtool-practical-use-and-extending
Zend_Tool_Framework sub-parts Zend_Tool_Framework_Client Responsibilities: Request Object Response Object Interactivity support Setting up the system registry containing all required objects The actual dispatch()-ing First implementation of Zend_Tool_Framework_Client_Console From talk by Ralph Schindler of Zend, at ZendCon 2009 http://www.slideshare.net/ZendCon/zendtool-practical-use-and-extending
Zend_Tool_Framework sub-parts Zend_Tool_Framework_Client_Storage & Zend_Tool_Framework_Client_Config Responsibilities: Allowing clients to specify configuration values for the system and providers to use Allowing clients to store artifacts on the filesystem that the system and providers can consume Custom profile files Provider-specific file formats and metadata From talk by Ralph Schindler of Zend, at ZendCon 2009 http://www.slideshare.net/ZendCon/zendtool-practical-use-and-extending
Zend_Tool_Framework sub-parts Zend_Tool_Framework_Loader Responsibilities: Load files provided Search for classes defined that implement: Zend_Tool_Framework_Manifest_Interface Zend_Tool_Framework_Provider_Interface From talk by Ralph Schindler of Zend, at ZendCon 2009 http://www.slideshare.net/ZendCon/zendtool-practical-use-and-extending
Zend_Tool_Framework sub-parts Zend_Tool_Framework_Provider & Provider Registry Responsibilities: An interface for defining via a class, dispatch-able actions and “specialties” (Similar to how Action Controllers define actions) Registry to maintain instances of all providers available Parsing of provider classes for dispatch-able “signatures” From talk by Ralph Schindler of Zend, at ZendCon 2009 http://www.slideshare.net/ZendCon/zendtool-practical-use-and-extending
Zend_Tool_Framework sub-parts Zend_Tool_Framework_Manifest & Manifest Repository Responsibilities: Manifest can supply a collection of providers, actions and/or metadata Registry provides a way to search for metadata in the manifest Zend_Tool_Framework_Metadata Responsibilities: Primary use case is to attach “data about data” to instance of a specific client, provider, or action ex: alternate names for each provider based on the command line naming scheme, OR short names (p for profile) From talk by Ralph Schindler of Zend, at ZendCon 2009 http://www.slideshare.net/ZendCon/zendtool-practical-use-and-extending
Zend_Tool_Project
Zend_Tool_Project sub-parts Zend_Tool_Project_Profile Responsibilities: loading, parsing, serializing and storing a profile file Top most node in a “resource tree” Zend_Tool_Project_Profile_Resource Responsibilities: The class most responsible for the “where” question of project modeling The class most responsible for implementing a node in a “resource tree” Extends Resource_Container which is a RecursiveIterator (tree fundamentals) Can create new Resources at specific locations Can find resources by name and attribute sets Each contains a Zend_Project_Context object From talk by Ralph Schindler of Zend, at ZendCon 2009 http://www.slideshare.net/ZendCon/zendtool-practical-use-and-extending
Zend_Tool_Project sub-parts Zend_Tool_Project_Context Responsibilities: The class most responsible for the “what” part of project modeling It is assigned to a Zend_Tool_Project_Profile_Resource object Example contexts: Controller file View script directory View script file Model file Action method … From talk by Ralph Schindler of Zend, at ZendCon 2009 http://www.slideshare.net/ZendCon/zendtool-practical-use-and-extending
Putting it all together
Putting it all together Zend_Tool_Framework looks for providers, by default, on the include_path It recursivly iterates all include path directories and opens all files that end with “Manifest.php” or “Provider.php” All classes in these files are inspected if they implement either Zend_Tool_Framework_Provider_Interface  or Zend_Tool_Framework_Manifest_ProviderManifestable Zend_Tool_Project is consumed by Zend_Tool_Framework This allows Zend_Tool_Project to be only concerned with “project” problems This also allows Zend_Tool_Framework to focus on the problem of knowing which requests are good, and knowing how to dispatch said request Zend_Tool_Framework provides a client to the user
Additional Resources In relation to the information presented in this section http://framework.zend.com http://framework.zend.com/manual/en http://framework.zend.com/manual/1.10/en/zend.tool.html http://framework.zend.com/manual/1.10/en/zend.tool.framework.html http://framework.zend.com/manual/1.10/en/zend.tool.project.html http://framework.zend.com/manual/1.10/en/zend.codegenerator.html http://framework.zend.com/manual/1.10/en/zend.reflection.html http://www.slideshare.net/ZendCon/zendtool-practical-use-and-extending
Setting things up
Install Zend Framework Download Zend Framework From website (http://framework.zend.com) SVN Zend Server From PEAR channel (http://pear.zfcampus.org/) Install it How? Where? For purpose of this presentation, have installed it at C:\ZendFramework-1.9.7
Prepare Zend_Tool
Understanding the CLI Tool /bin/zf.sh and /bin/zf.bat Operating system specific client wrappers Responsible for finding the proper php.exe, finding the zf.php file, and passing on the client request /bin/zf.php Responsible for: handling the understanding of your environment construction of proper include path passing what is provided on the command line to the proper library component for dispatching
Accessing the CLI Tool Two things have to be true: zf.sh/zf.bat is reachable from your system path. This is the ability to call ‘zf’ from anywhere on your command line, regardless of what your current working directory is. ZendFramework/library  is in your include path So how do we === true?
Make zf.sh/zf.bat reachable from system path Manual’s recommendation: Copy zf.sh/zf.bat and zf.php into the same directory as your PHP binary For *nix, usually: /usr/bin/ /usr/local/bin/ /usr/local/ZendServer/bin/ /Applications/ZendServer/bin For Windows, usually: C:\PHP C:\Program Files\ZendServer\bin C:\WAMP\PHP\bin
Make zf.sh/zf.bat reachable from system path My recommendation: Create an Alias to zf.sh/zf.bat For *nix: alias zf &quot;/usr/local/Zend/ZendFramework-1.9.7/bin/zf.sh&quot; alias zf &quot;/YOUR_PATH_HERE/bin/zf.sh&quot; For Windows: doskey zf=C:\ZENDFR~1.7\bin\zf.bat However…. On Windows, I could not get the arguments passed to  ‘zf’  to be passed along, so…. Ended up modifying the environment variable PATH to include C:\ZendFramework-1.9.7\bin
Add  ZendFramework/library  to include_path Manual’s recommendation: Determine what your current include_path value is and add the contents of  ZendFramework/library  to one of these locations Alternative option to above: For *nix: In a location included in your current include_path, create a symbolic link to the location of  ZendFramework/library For Windows: Modify the environment variable PATH to include C:\PATH_TO_ZENDFRAMEWORK\bin Alter your php.ini file and modify include_path directive to include C:\PATH_TO_ZENDFRAMEWORK\library
Add  ZendFramework/library  to include_path My recommendation: Use special environment variable(s) to tell zf.php the location of  ZendFramework/library They are: ZEND_TOOL_INCLUDE_PATH_PREPEND Will prepend the value of this environment variable to the system (php.ini) include_path before loading the client ZEND_TOOL_INCLUDE_PATH Completely replaces the system include_path with the one specified How to do this: For *nix: setenv ZEND_TOOL_INCLUDE_PATH_PREPEND /usr/local/Zend/ZendFramework-1.9.7/library/ For Windows: set ZEND_TOOL_INCLUDE_PATH_PREPEND=C:\ZENDFR~1.7\library
Other settable environment variables ZF_HOME ZF_STORAGE_DIR ZF_CONFIG_FILE ZF_INCLUDE_PATH ZF_INCLUDE_PATH_PREPEND Can be found at http://framework.zend.com/manual/en/zend.tool.usage.cli.html
Did I set it up correctly? To verify that the previous steps worked correctly, enter  ‘zf’  at the command line.  Should expect to see something similar to:
Additional Resources In relation to the information presented in this section http://framework.zend.com/manual/1.10/en/zend.tool.framework.html http://framework.zend.com/manual/1.10/en/zend.tool.usage.cli.html http://framework.zend.com/manual/1.10/en/zend.tool.extending.html http://en.wikipedia.org/wiki/Alias_%28command%29 http://www.unix.com/windows-dos-issues-discussions/74664-what-dos-equivalent-alias-command.html
Enough with the setup – I’m here for some coding!
Few basic things zf --help zf show version zf show version zf show version -n 0 zf show version.major-part zf show version -m minor -n 0
Create project Provide a path: zf create project demo Be prompted for path: zf create project
Create project Provide a path: zf create project demo Be prompted for path: zf create project Can now run: zf show project zf show profile
Create Controller Provide a controller name: zf create controller <controllername> Be prompted for a controller name: zf create controller
Create Controller Actions zf create action <actioname> <controllername> Will throw a Fatal Error if <controllername> does not exist
Create views zf create view <controllername> <actionname> <actionname> is really only for the name of the View Script – a new action is NOT created in the controller
Additional Resources In relation to the information presented in this section http://framework.zend.com/manual/en/zend.tool.project.create-a-project.html http://framework.zend.com/manual/en/zend.tool.project.providers.html http://ralphschindler.com/wiki/index.php/Using_Zend_Tool
Extending Zend_Tool
How Zend_Tool finds your Providers Remember that: Zend_Tool_Framework looks for providers, by default, on the include_path It recursivly iterates all include path directories and opens all files that end with “Manifest.php” or “Provider.php” All classes in these files are inspected if they implement either Zend_Tool_Framework_Provider_Interface  or Zend_Tool_Framework_Manifest_ProviderManifestable
How Zend_Tool finds your Providers The following naming rules apply on how you can access the providers that were found by the IncludePathLoader: The last part of your classname split by underscore is used for the provider name, e.g. “My_Provider_Hello” leads to your provider being accessible by the name “hello” If your provider has a method  getName()  it will be used instead of the previous method to determine the name If your provider has “Provider” as suffix, e.g. it is called “My_HelloProvider”, it will be stripped from the name so that the provider will be called “hello”. Note: The IncludePathLoader does not follow symlinks.  This means you cannot link provider functionality into your include paths, they have to be physically present in the include paths.
Example Custom Provider
Minimum code needed… /My/Provider/Slide54Provider.php
…but we really need some more The previous example illustrates being able to make your newly-created custom provider to be seen by Zend_Tool_Framework, but it really isn’t able to expose any Provider capabilities. What you need instead is: /My/Provider/Slide55Provider.php
Provide alternate name for Provider /My/Provider/Slide56Provider.php
Example Custom Manifest
Minimum code needed /My/Manifest/Slide58Manifest.php
Let’s do more with Providers
Passing variables to a Provider /My/Provider/Slide60.php Examples of how to call this provider: zf say slide60 zf say slide60 Jason zf say slide60 --name Jason
Prompt user for input /My/Provider/Slide61.php
Pretendability /My/Provider/Slide62.php Examples of how to call this provider: zf say slide62 zf --pretend say slide62
Verbose /My/Provider/Slide63.php Examples of how to call this provider: zf say slide63 zf --verbose say slide63
Debug /My/Provider/Slide64.php Examples of how to call this provider: zf say slide64 zf --debug say slide64
Multiple arguments /My/Provider/Slide65.php
Additional Resources In relation to the information presented in this section http://framework.zend.com/manual/en/zend.tool.extending.html http://framework.zend.com/manual/en/zend.tool.framework.writing-providers.html
Customizing Zend_Tool Console Client
Customizing Zend_Tool Console Client Zend_Tool_Framework allows developers to store information, provider-specific configuration values, and custom files in a special location on the developers machine. Items of discussion: Home Directory Local Storage User Configuration
Additional Resources In relation to the information presented in this section http://framework.zend.com/manual/1.10/en/zend.tool.framework.extending.html http://framework.zend.com/manual/en/zend.tool.framework.writing-providers.html
Putting our Providers to work
Keep profile up-to-date $this->_loadProfile(); $this->_storeProfile();
Context Can extend Zend_Tool_Project_Context_Filesystem_File and Zend_Tool_Project_Context_Filesystem_Directory to create context classes. $profile = $this->_loadProfile(); $modelsDirectory = $profile->search('ModelsDirectory'); $modelFile = $modelsDirectory->createResource('ModelFile'); $modelFile->getContext()->setModelName($name); Excerpts from Zend Webinar presented by Ralph Schindler of Zend http://www.zend.com/en/webinar/framework/webinar-zend-tool-20090630.flv
Zend_CodeGenerator Excerpts from Zend Webinar presented by Ralph Schindler of Zend http://www.zend.com/en/webinar/framework/webinar-zend-tool-20090630.flv
Integration with Zend_Application Excerpts from Zend Webinar presented by Ralph Schindler of Zend http://www.zend.com/en/webinar/framework/webinar-zend-tool-20090630.flv
Additional Resources In relation to the information presented in this section http://framework.zend.com/manual/en/zend.tool.extending.html http://www.zend.com/en/webinar/framework/webinar-zend-tool-20090630.flv
Where do things go from here?
Known plans
Roadmap Zend Framework 1.10 offers Model Provider Form Provider DbTable Provider DbAdapter configuration Layout enabling and creation Custom Profiles Improved Module Provider … and more! In the works Web interface Better documentation Have hopes for Apache configuration code generator
Using for your own needs
The sky’s the limit Don’t have to use it for just a “project” How Spear One has begun, and plans, on using Zend_Tool
Improving Zend_Tool
Public Service Announcement Play with it and use it Submit bugs and feature requests http://framework.zend.com/issues/browse/ZF/component/10380 Get involved in the community Write a blog post Visit #zftalk on irc.freenode.net Become a contributor Fix bugs Implement new feature set Improve documentation
Additional Resources In relation to the information presented in this section http://framework.zend.com/issues/browse/ZF/component/10380 http://framework.zend.com/issues/browse/ZF-7940 http://ralphschindler.com/wiki/index.php/Using_Zend_Tool
Thank you!
Contact Information Blog: notmessenger.com Twitter: twitter.com/notmessenger Email: jeremy@notmessenger.com IRC: #zftalk and #dallasphp Where to find presentation notmessenger.com/presentations <insert slideshare.net link here> Please rate this talk on Joind.in http://joind.in/event/view/136
Ad

More Related Content

What's hot (10)

The Solar Framework for PHP 5 (2010 Confoo)
The Solar Framework for PHP 5 (2010 Confoo)The Solar Framework for PHP 5 (2010 Confoo)
The Solar Framework for PHP 5 (2010 Confoo)
Paul Jones
 
Java Code Generation for Productivity
Java Code Generation for ProductivityJava Code Generation for Productivity
Java Code Generation for Productivity
David Noble
 
.NET Core, ASP.NET Core Course, Session 3
.NET Core, ASP.NET Core Course, Session 3.NET Core, ASP.NET Core Course, Session 3
.NET Core, ASP.NET Core Course, Session 3
Amin Mesbahi
 
Zend Framework 2 quick start
Zend Framework 2 quick startZend Framework 2 quick start
Zend Framework 2 quick start
Enrico Zimuel
 
Zend Framework 2 Components
Zend Framework 2 ComponentsZend Framework 2 Components
Zend Framework 2 Components
Shawn Stratton
 
Action-Domain-Responder: A Refinement of MVC
Action-Domain-Responder: A Refinement of MVCAction-Domain-Responder: A Refinement of MVC
Action-Domain-Responder: A Refinement of MVC
Paul Jones
 
Java Enterprise Edition
Java Enterprise EditionJava Enterprise Edition
Java Enterprise Edition
Francesco Nolano
 
Hibernate
HibernateHibernate
Hibernate
Mallikarjuna G D
 
Zend Framework 2
Zend Framework 2Zend Framework 2
Zend Framework 2
Tarun Kumar Singhal
 
Zend Framework
Zend FrameworkZend Framework
Zend Framework
John Coggeshall
 
The Solar Framework for PHP 5 (2010 Confoo)
The Solar Framework for PHP 5 (2010 Confoo)The Solar Framework for PHP 5 (2010 Confoo)
The Solar Framework for PHP 5 (2010 Confoo)
Paul Jones
 
Java Code Generation for Productivity
Java Code Generation for ProductivityJava Code Generation for Productivity
Java Code Generation for Productivity
David Noble
 
.NET Core, ASP.NET Core Course, Session 3
.NET Core, ASP.NET Core Course, Session 3.NET Core, ASP.NET Core Course, Session 3
.NET Core, ASP.NET Core Course, Session 3
Amin Mesbahi
 
Zend Framework 2 quick start
Zend Framework 2 quick startZend Framework 2 quick start
Zend Framework 2 quick start
Enrico Zimuel
 
Zend Framework 2 Components
Zend Framework 2 ComponentsZend Framework 2 Components
Zend Framework 2 Components
Shawn Stratton
 
Action-Domain-Responder: A Refinement of MVC
Action-Domain-Responder: A Refinement of MVCAction-Domain-Responder: A Refinement of MVC
Action-Domain-Responder: A Refinement of MVC
Paul Jones
 

Viewers also liked (20)

10 windows 7 commands every administrator should know
10 windows 7 commands every administrator should know10 windows 7 commands every administrator should know
10 windows 7 commands every administrator should know
Ravi Kumar Lanke
 
ClickandBuy booklet
ClickandBuy bookletClickandBuy booklet
ClickandBuy booklet
guestc85db89
 
Waardeverkenner
WaardeverkennerWaardeverkenner
Waardeverkenner
Atrivé
 
8 7 Nrbb Flow
8 7 Nrbb Flow8 7 Nrbb Flow
8 7 Nrbb Flow
websolve
 
Esomar Beijing Preso
Esomar Beijing PresoEsomar Beijing Preso
Esomar Beijing Preso
Peter Harris
 
C.e. dic. 2015. ultima adecuacion al convenio de pruebas
C.e. dic. 2015. ultima adecuacion al convenio de pruebasC.e. dic. 2015. ultima adecuacion al convenio de pruebas
C.e. dic. 2015. ultima adecuacion al convenio de pruebas
Universidad de Sonora
 
Tess Of The D’Urbervilles
Tess Of The D’UrbervillesTess Of The D’Urbervilles
Tess Of The D’Urbervilles
snehadave
 
Inleiding CV-ketelkeuring: "Last of Must"
Inleiding CV-ketelkeuring: "Last of Must"Inleiding CV-ketelkeuring: "Last of Must"
Inleiding CV-ketelkeuring: "Last of Must"
Netherlands Enterprise Agency (RVO.nl)
 
Oracle networking listener
Oracle networking listenerOracle networking listener
Oracle networking listener
Ravi Kumar Lanke
 
Xiaomi leathercraft _smmf2014
Xiaomi leathercraft _smmf2014Xiaomi leathercraft _smmf2014
Xiaomi leathercraft _smmf2014
Nico-Tech Shenzhen/ニコ技深圳コミュニティ
 
2015 12 efw sap functional short
2015 12 efw sap functional short2015 12 efw sap functional short
2015 12 efw sap functional short
AEGIS Consulting, Inc
 
Ipad
IpadIpad
Ipad
Roxanne Missingham
 
Energiebesparing en het Activiteitenbesluit
Energiebesparing en het ActiviteitenbesluitEnergiebesparing en het Activiteitenbesluit
Energiebesparing en het Activiteitenbesluit
Netherlands Enterprise Agency (RVO.nl)
 
Je instagram vreden milijarde dolarjev?_Marketing Magazin_maj2012_st.372_str.16
Je instagram vreden milijarde dolarjev?_Marketing Magazin_maj2012_st.372_str.16Je instagram vreden milijarde dolarjev?_Marketing Magazin_maj2012_st.372_str.16
Je instagram vreden milijarde dolarjev?_Marketing Magazin_maj2012_st.372_str.16
Urska Saletinger
 
Advanced Excel, Day 4
Advanced Excel, Day 4Advanced Excel, Day 4
Advanced Excel, Day 4
Khaled Al-Shamaa
 
Warmtewet
WarmtewetWarmtewet
Warmtewet
Netherlands Enterprise Agency (RVO.nl)
 
Bouyn Brochurev1
Bouyn Brochurev1Bouyn Brochurev1
Bouyn Brochurev1
allanedun
 
20140830 maker fairetrondheim
20140830 maker fairetrondheim20140830 maker fairetrondheim
20140830 maker fairetrondheim
Nico-Tech Shenzhen/ニコ技深圳コミュニティ
 
10 windows 7 commands every administrator should know
10 windows 7 commands every administrator should know10 windows 7 commands every administrator should know
10 windows 7 commands every administrator should know
Ravi Kumar Lanke
 
ClickandBuy booklet
ClickandBuy bookletClickandBuy booklet
ClickandBuy booklet
guestc85db89
 
Waardeverkenner
WaardeverkennerWaardeverkenner
Waardeverkenner
Atrivé
 
8 7 Nrbb Flow
8 7 Nrbb Flow8 7 Nrbb Flow
8 7 Nrbb Flow
websolve
 
Esomar Beijing Preso
Esomar Beijing PresoEsomar Beijing Preso
Esomar Beijing Preso
Peter Harris
 
C.e. dic. 2015. ultima adecuacion al convenio de pruebas
C.e. dic. 2015. ultima adecuacion al convenio de pruebasC.e. dic. 2015. ultima adecuacion al convenio de pruebas
C.e. dic. 2015. ultima adecuacion al convenio de pruebas
Universidad de Sonora
 
Tess Of The D’Urbervilles
Tess Of The D’UrbervillesTess Of The D’Urbervilles
Tess Of The D’Urbervilles
snehadave
 
Oracle networking listener
Oracle networking listenerOracle networking listener
Oracle networking listener
Ravi Kumar Lanke
 
Je instagram vreden milijarde dolarjev?_Marketing Magazin_maj2012_st.372_str.16
Je instagram vreden milijarde dolarjev?_Marketing Magazin_maj2012_st.372_str.16Je instagram vreden milijarde dolarjev?_Marketing Magazin_maj2012_st.372_str.16
Je instagram vreden milijarde dolarjev?_Marketing Magazin_maj2012_st.372_str.16
Urska Saletinger
 
Bouyn Brochurev1
Bouyn Brochurev1Bouyn Brochurev1
Bouyn Brochurev1
allanedun
 
Ad

Similar to Using Zend_Tool to Establish Your Project's Skeleton (20)

Zend_Tool: Rapid Application Development with Zend Framework
Zend_Tool: Rapid Application Development with Zend FrameworkZend_Tool: Rapid Application Development with Zend Framework
Zend_Tool: Rapid Application Development with Zend Framework
Ralph Schindler
 
first pitch
first pitchfirst pitch
first pitch
alind tiwari
 
werwr
werwrwerwr
werwr
alind tiwari
 
before upload
before uploadbefore upload
before upload
alind tiwari
 
234234
234234234234
234234
alind tiwari
 
latest slide
latest slidelatest slide
latest slide
alind tiwari
 
eco friendly
eco friendlyeco friendly
eco friendly
alind tiwari
 
Test Nan
Test NanTest Nan
Test Nan
alind tiwari
 
tiwari
tiwaritiwari
tiwari
alind tiwari
 
latest slide
latest slidelatest slide
latest slide
alind tiwari
 
Greenathan
GreenathanGreenathan
Greenathan
alind tiwari
 
Unit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentUnit Test for ZF SlideShare Component
Unit Test for ZF SlideShare Component
zftalk
 
before upload
before uploadbefore upload
before upload
alind tiwari
 
raining
rainingraining
raining
alind tiwari
 
scout
scoutscout
scout
alind tiwari
 
latest slide
latest slidelatest slide
latest slide
alind tiwari
 
Zf
ZfZf
Zf
sikhalid
 
sdfsd
sdfsdsdfsd
sdfsd
alind tiwari
 
Unit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentUnit Test for ZF SlideShare Component
Unit Test for ZF SlideShare Component
zftalk
 
Unit Test for ZF SlideShare Component
Unit Test for ZF SlideShare ComponentUnit Test for ZF SlideShare Component
Unit Test for ZF SlideShare Component
zftalk
 
Ad

Recently uploaded (20)

Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Web and Graphics Designing Training in Rajpura
Web and Graphics Designing Training in RajpuraWeb and Graphics Designing Training in Rajpura
Web and Graphics Designing Training in Rajpura
Erginous Technology
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Vaibhav Gupta BAML: AI work flows without Hallucinations
Vaibhav Gupta BAML: AI work flows without HallucinationsVaibhav Gupta BAML: AI work flows without Hallucinations
Vaibhav Gupta BAML: AI work flows without Hallucinations
john409870
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Web and Graphics Designing Training in Rajpura
Web and Graphics Designing Training in RajpuraWeb and Graphics Designing Training in Rajpura
Web and Graphics Designing Training in Rajpura
Erginous Technology
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Vaibhav Gupta BAML: AI work flows without Hallucinations
Vaibhav Gupta BAML: AI work flows without HallucinationsVaibhav Gupta BAML: AI work flows without Hallucinations
Vaibhav Gupta BAML: AI work flows without Hallucinations
john409870
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 

Using Zend_Tool to Establish Your Project's Skeleton

  • 1. Using Zend_Tool to Establish Your Project's Skeleton DFW Apache LAMP Group presented by Jeremy Brown, ZCE 1 Feb 2010
  • 3. Who Am I? Jeremy Brown, Zend Certified Engineer (ZCE) Have been using PHP since 1999 (PHP 3) Have been using Zend Framework since 2008 (version 1.0.4) Software Architect / Team Lead at Spear One (spearone.com)
  • 4. Contact Information Blog: notmessenger.com Twitter: twitter.com/notmessenger Email: [email protected] IRC: #zftalk and #dallasphp (irc.freenode.net)
  • 5. Where to find this presentation On my blog notmessenger.com/presentations Slideshare.net <insert link here>
  • 6. How to provide feedback Via Joind.in http://joind.in/event/view/136
  • 7. Your turn – who are you? How many of you have heard of Zend Framework before?
  • 8. Your turn – who are you? How many of you have heard of Zend Framework before? How many of you have played with it a little bit?
  • 9. Your turn – who are you? How many of you have heard of Zend Framework before? How many of you have played with it a little bit? How many of you use it in a project or on a regular basis?
  • 11. What is Zend Framework An open source, object-oriented web application framework implemented in PHP 5 All components are fully object-oriented PHP 5 and are E_STRICT compliant Use-at-will architecture with loosely-coupled components and minimal interdependencies Provides individual components for many common requirements in web application development
  • 12. So what is Zend_Tool? Zend_Tool is both rapid application development (RAD) tools as well as a framework for exposing your own set of tooling needs to the Zend_Tool user interface.
  • 13. So what is Zend_Tool? Zend_Tool is both rapid application development (RAD) tools as well as a framework for exposing your own set of tooling needs to the Zend_Tool user interface. No, really, what is Zend_Tool?
  • 14. Basic structure of a ZF application … OR…
  • 15. Where’s the beef? Main Classes & APIs: Zend_Tool_Framework The component responsible for dispatching tooling requests Zend_Tool_Project The component responsible for exposing the “project specific” tooling capabilities Inspired by talk by Ralph Schindler of Zend, at ZendCon 2009 http://www.slideshare.net/ZendCon/zendtool-practical-use-and-extending
  • 16. Where’s the beef? Main Classes & APIs: Zend_Tool_Framework The component responsible for dispatching tooling requests Zend_Tool_Project The component responsible for exposing the “project specific” tooling capabilities And the gravy… Supporting Classes & APIs: Zend_CodeGenerator Zend_Reflection Inspired by talk by Ralph Schindler of Zend, at ZendCon 2009 http://www.slideshare.net/ZendCon/zendtool-practical-use-and-extending
  • 18. Zend_Tool_Framework sub-parts Zend_Tool_Framework Dispatch-style framework, designed to abstract enough system internals to make extensibility easy “ Flexibility of the tooling dispatch over speed of tooling dispatch” Broken down into logical sub-parts: Client Client storage & configuration Loader Provider & Provider Repository Manifest, Manifest Repository & Metadata System (Built-in) Providers From talk by Ralph Schindler of Zend, at ZendCon 2009 http://www.slideshare.net/ZendCon/zendtool-practical-use-and-extending
  • 19. Zend_Tool_Framework sub-parts Zend_Tool_Framework_Client Responsibilities: Request Object Response Object Interactivity support Setting up the system registry containing all required objects The actual dispatch()-ing First implementation of Zend_Tool_Framework_Client_Console From talk by Ralph Schindler of Zend, at ZendCon 2009 http://www.slideshare.net/ZendCon/zendtool-practical-use-and-extending
  • 20. Zend_Tool_Framework sub-parts Zend_Tool_Framework_Client_Storage & Zend_Tool_Framework_Client_Config Responsibilities: Allowing clients to specify configuration values for the system and providers to use Allowing clients to store artifacts on the filesystem that the system and providers can consume Custom profile files Provider-specific file formats and metadata From talk by Ralph Schindler of Zend, at ZendCon 2009 http://www.slideshare.net/ZendCon/zendtool-practical-use-and-extending
  • 21. Zend_Tool_Framework sub-parts Zend_Tool_Framework_Loader Responsibilities: Load files provided Search for classes defined that implement: Zend_Tool_Framework_Manifest_Interface Zend_Tool_Framework_Provider_Interface From talk by Ralph Schindler of Zend, at ZendCon 2009 http://www.slideshare.net/ZendCon/zendtool-practical-use-and-extending
  • 22. Zend_Tool_Framework sub-parts Zend_Tool_Framework_Provider & Provider Registry Responsibilities: An interface for defining via a class, dispatch-able actions and “specialties” (Similar to how Action Controllers define actions) Registry to maintain instances of all providers available Parsing of provider classes for dispatch-able “signatures” From talk by Ralph Schindler of Zend, at ZendCon 2009 http://www.slideshare.net/ZendCon/zendtool-practical-use-and-extending
  • 23. Zend_Tool_Framework sub-parts Zend_Tool_Framework_Manifest & Manifest Repository Responsibilities: Manifest can supply a collection of providers, actions and/or metadata Registry provides a way to search for metadata in the manifest Zend_Tool_Framework_Metadata Responsibilities: Primary use case is to attach “data about data” to instance of a specific client, provider, or action ex: alternate names for each provider based on the command line naming scheme, OR short names (p for profile) From talk by Ralph Schindler of Zend, at ZendCon 2009 http://www.slideshare.net/ZendCon/zendtool-practical-use-and-extending
  • 25. Zend_Tool_Project sub-parts Zend_Tool_Project_Profile Responsibilities: loading, parsing, serializing and storing a profile file Top most node in a “resource tree” Zend_Tool_Project_Profile_Resource Responsibilities: The class most responsible for the “where” question of project modeling The class most responsible for implementing a node in a “resource tree” Extends Resource_Container which is a RecursiveIterator (tree fundamentals) Can create new Resources at specific locations Can find resources by name and attribute sets Each contains a Zend_Project_Context object From talk by Ralph Schindler of Zend, at ZendCon 2009 http://www.slideshare.net/ZendCon/zendtool-practical-use-and-extending
  • 26. Zend_Tool_Project sub-parts Zend_Tool_Project_Context Responsibilities: The class most responsible for the “what” part of project modeling It is assigned to a Zend_Tool_Project_Profile_Resource object Example contexts: Controller file View script directory View script file Model file Action method … From talk by Ralph Schindler of Zend, at ZendCon 2009 http://www.slideshare.net/ZendCon/zendtool-practical-use-and-extending
  • 27. Putting it all together
  • 28. Putting it all together Zend_Tool_Framework looks for providers, by default, on the include_path It recursivly iterates all include path directories and opens all files that end with “Manifest.php” or “Provider.php” All classes in these files are inspected if they implement either Zend_Tool_Framework_Provider_Interface or Zend_Tool_Framework_Manifest_ProviderManifestable Zend_Tool_Project is consumed by Zend_Tool_Framework This allows Zend_Tool_Project to be only concerned with “project” problems This also allows Zend_Tool_Framework to focus on the problem of knowing which requests are good, and knowing how to dispatch said request Zend_Tool_Framework provides a client to the user
  • 29. Additional Resources In relation to the information presented in this section http://framework.zend.com http://framework.zend.com/manual/en http://framework.zend.com/manual/1.10/en/zend.tool.html http://framework.zend.com/manual/1.10/en/zend.tool.framework.html http://framework.zend.com/manual/1.10/en/zend.tool.project.html http://framework.zend.com/manual/1.10/en/zend.codegenerator.html http://framework.zend.com/manual/1.10/en/zend.reflection.html http://www.slideshare.net/ZendCon/zendtool-practical-use-and-extending
  • 31. Install Zend Framework Download Zend Framework From website (http://framework.zend.com) SVN Zend Server From PEAR channel (http://pear.zfcampus.org/) Install it How? Where? For purpose of this presentation, have installed it at C:\ZendFramework-1.9.7
  • 33. Understanding the CLI Tool /bin/zf.sh and /bin/zf.bat Operating system specific client wrappers Responsible for finding the proper php.exe, finding the zf.php file, and passing on the client request /bin/zf.php Responsible for: handling the understanding of your environment construction of proper include path passing what is provided on the command line to the proper library component for dispatching
  • 34. Accessing the CLI Tool Two things have to be true: zf.sh/zf.bat is reachable from your system path. This is the ability to call ‘zf’ from anywhere on your command line, regardless of what your current working directory is. ZendFramework/library is in your include path So how do we === true?
  • 35. Make zf.sh/zf.bat reachable from system path Manual’s recommendation: Copy zf.sh/zf.bat and zf.php into the same directory as your PHP binary For *nix, usually: /usr/bin/ /usr/local/bin/ /usr/local/ZendServer/bin/ /Applications/ZendServer/bin For Windows, usually: C:\PHP C:\Program Files\ZendServer\bin C:\WAMP\PHP\bin
  • 36. Make zf.sh/zf.bat reachable from system path My recommendation: Create an Alias to zf.sh/zf.bat For *nix: alias zf &quot;/usr/local/Zend/ZendFramework-1.9.7/bin/zf.sh&quot; alias zf &quot;/YOUR_PATH_HERE/bin/zf.sh&quot; For Windows: doskey zf=C:\ZENDFR~1.7\bin\zf.bat However…. On Windows, I could not get the arguments passed to ‘zf’ to be passed along, so…. Ended up modifying the environment variable PATH to include C:\ZendFramework-1.9.7\bin
  • 37. Add ZendFramework/library to include_path Manual’s recommendation: Determine what your current include_path value is and add the contents of ZendFramework/library to one of these locations Alternative option to above: For *nix: In a location included in your current include_path, create a symbolic link to the location of ZendFramework/library For Windows: Modify the environment variable PATH to include C:\PATH_TO_ZENDFRAMEWORK\bin Alter your php.ini file and modify include_path directive to include C:\PATH_TO_ZENDFRAMEWORK\library
  • 38. Add ZendFramework/library to include_path My recommendation: Use special environment variable(s) to tell zf.php the location of ZendFramework/library They are: ZEND_TOOL_INCLUDE_PATH_PREPEND Will prepend the value of this environment variable to the system (php.ini) include_path before loading the client ZEND_TOOL_INCLUDE_PATH Completely replaces the system include_path with the one specified How to do this: For *nix: setenv ZEND_TOOL_INCLUDE_PATH_PREPEND /usr/local/Zend/ZendFramework-1.9.7/library/ For Windows: set ZEND_TOOL_INCLUDE_PATH_PREPEND=C:\ZENDFR~1.7\library
  • 39. Other settable environment variables ZF_HOME ZF_STORAGE_DIR ZF_CONFIG_FILE ZF_INCLUDE_PATH ZF_INCLUDE_PATH_PREPEND Can be found at http://framework.zend.com/manual/en/zend.tool.usage.cli.html
  • 40. Did I set it up correctly? To verify that the previous steps worked correctly, enter ‘zf’ at the command line. Should expect to see something similar to:
  • 41. Additional Resources In relation to the information presented in this section http://framework.zend.com/manual/1.10/en/zend.tool.framework.html http://framework.zend.com/manual/1.10/en/zend.tool.usage.cli.html http://framework.zend.com/manual/1.10/en/zend.tool.extending.html http://en.wikipedia.org/wiki/Alias_%28command%29 http://www.unix.com/windows-dos-issues-discussions/74664-what-dos-equivalent-alias-command.html
  • 42. Enough with the setup – I’m here for some coding!
  • 43. Few basic things zf --help zf show version zf show version zf show version -n 0 zf show version.major-part zf show version -m minor -n 0
  • 44. Create project Provide a path: zf create project demo Be prompted for path: zf create project
  • 45. Create project Provide a path: zf create project demo Be prompted for path: zf create project Can now run: zf show project zf show profile
  • 46. Create Controller Provide a controller name: zf create controller <controllername> Be prompted for a controller name: zf create controller
  • 47. Create Controller Actions zf create action <actioname> <controllername> Will throw a Fatal Error if <controllername> does not exist
  • 48. Create views zf create view <controllername> <actionname> <actionname> is really only for the name of the View Script – a new action is NOT created in the controller
  • 49. Additional Resources In relation to the information presented in this section http://framework.zend.com/manual/en/zend.tool.project.create-a-project.html http://framework.zend.com/manual/en/zend.tool.project.providers.html http://ralphschindler.com/wiki/index.php/Using_Zend_Tool
  • 51. How Zend_Tool finds your Providers Remember that: Zend_Tool_Framework looks for providers, by default, on the include_path It recursivly iterates all include path directories and opens all files that end with “Manifest.php” or “Provider.php” All classes in these files are inspected if they implement either Zend_Tool_Framework_Provider_Interface or Zend_Tool_Framework_Manifest_ProviderManifestable
  • 52. How Zend_Tool finds your Providers The following naming rules apply on how you can access the providers that were found by the IncludePathLoader: The last part of your classname split by underscore is used for the provider name, e.g. “My_Provider_Hello” leads to your provider being accessible by the name “hello” If your provider has a method getName() it will be used instead of the previous method to determine the name If your provider has “Provider” as suffix, e.g. it is called “My_HelloProvider”, it will be stripped from the name so that the provider will be called “hello”. Note: The IncludePathLoader does not follow symlinks. This means you cannot link provider functionality into your include paths, they have to be physically present in the include paths.
  • 54. Minimum code needed… /My/Provider/Slide54Provider.php
  • 55. …but we really need some more The previous example illustrates being able to make your newly-created custom provider to be seen by Zend_Tool_Framework, but it really isn’t able to expose any Provider capabilities. What you need instead is: /My/Provider/Slide55Provider.php
  • 56. Provide alternate name for Provider /My/Provider/Slide56Provider.php
  • 58. Minimum code needed /My/Manifest/Slide58Manifest.php
  • 59. Let’s do more with Providers
  • 60. Passing variables to a Provider /My/Provider/Slide60.php Examples of how to call this provider: zf say slide60 zf say slide60 Jason zf say slide60 --name Jason
  • 61. Prompt user for input /My/Provider/Slide61.php
  • 62. Pretendability /My/Provider/Slide62.php Examples of how to call this provider: zf say slide62 zf --pretend say slide62
  • 63. Verbose /My/Provider/Slide63.php Examples of how to call this provider: zf say slide63 zf --verbose say slide63
  • 64. Debug /My/Provider/Slide64.php Examples of how to call this provider: zf say slide64 zf --debug say slide64
  • 66. Additional Resources In relation to the information presented in this section http://framework.zend.com/manual/en/zend.tool.extending.html http://framework.zend.com/manual/en/zend.tool.framework.writing-providers.html
  • 68. Customizing Zend_Tool Console Client Zend_Tool_Framework allows developers to store information, provider-specific configuration values, and custom files in a special location on the developers machine. Items of discussion: Home Directory Local Storage User Configuration
  • 69. Additional Resources In relation to the information presented in this section http://framework.zend.com/manual/1.10/en/zend.tool.framework.extending.html http://framework.zend.com/manual/en/zend.tool.framework.writing-providers.html
  • 71. Keep profile up-to-date $this->_loadProfile(); $this->_storeProfile();
  • 72. Context Can extend Zend_Tool_Project_Context_Filesystem_File and Zend_Tool_Project_Context_Filesystem_Directory to create context classes. $profile = $this->_loadProfile(); $modelsDirectory = $profile->search('ModelsDirectory'); $modelFile = $modelsDirectory->createResource('ModelFile'); $modelFile->getContext()->setModelName($name); Excerpts from Zend Webinar presented by Ralph Schindler of Zend http://www.zend.com/en/webinar/framework/webinar-zend-tool-20090630.flv
  • 73. Zend_CodeGenerator Excerpts from Zend Webinar presented by Ralph Schindler of Zend http://www.zend.com/en/webinar/framework/webinar-zend-tool-20090630.flv
  • 74. Integration with Zend_Application Excerpts from Zend Webinar presented by Ralph Schindler of Zend http://www.zend.com/en/webinar/framework/webinar-zend-tool-20090630.flv
  • 75. Additional Resources In relation to the information presented in this section http://framework.zend.com/manual/en/zend.tool.extending.html http://www.zend.com/en/webinar/framework/webinar-zend-tool-20090630.flv
  • 76. Where do things go from here?
  • 78. Roadmap Zend Framework 1.10 offers Model Provider Form Provider DbTable Provider DbAdapter configuration Layout enabling and creation Custom Profiles Improved Module Provider … and more! In the works Web interface Better documentation Have hopes for Apache configuration code generator
  • 79. Using for your own needs
  • 80. The sky’s the limit Don’t have to use it for just a “project” How Spear One has begun, and plans, on using Zend_Tool
  • 82. Public Service Announcement Play with it and use it Submit bugs and feature requests http://framework.zend.com/issues/browse/ZF/component/10380 Get involved in the community Write a blog post Visit #zftalk on irc.freenode.net Become a contributor Fix bugs Implement new feature set Improve documentation
  • 83. Additional Resources In relation to the information presented in this section http://framework.zend.com/issues/browse/ZF/component/10380 http://framework.zend.com/issues/browse/ZF-7940 http://ralphschindler.com/wiki/index.php/Using_Zend_Tool
  • 85. Contact Information Blog: notmessenger.com Twitter: twitter.com/notmessenger Email: [email protected] IRC: #zftalk and #dallasphp Where to find presentation notmessenger.com/presentations <insert slideshare.net link here> Please rate this talk on Joind.in http://joind.in/event/view/136