A presentation I gave at php[world], 2015 in Washington, DC on Zend Framework 2 focusing on the EventManager, ServiceManager, and how to build dependent-free modules for your applications
Design & Development of Web Applications using SpringMVC Naresh Chintalcheru
Spring MVC is a web MVC framework that provides a reusable presentation layer for web applications. It removes boilerplate code and standardizes navigation flow and validation. Spring MVC controllers handle HTTP requests and delegate work to service objects. It uses the front controller design pattern and is view-agnostic, allowing different view technologies. Spring MVC applications are configured through XML files and use annotations for components and request mapping.
The document is an introduction to the Zend Framework 2 (ZF2) architecture. It discusses key ZF2 concepts like modules, the model-view-controller pattern, routes, controllers, and the service manager. Modules are a core concept, with everything including applications being modules. The service manager handles application dependencies and allows for decoupled development. Routes map URLs to controllers and actions. Controllers are executed from dispatched routes and return responses or view models.
Deprecated: Foundations of Zend Framework 2Adam Culp
DEPRECATED-Please see http://www.slideshare.net/adamculp/foundations-of-zendframework for updated version.
For this talk Adam Culp will cover a basic intro to Zend Framework 2 (ZF2) and how to use the foundational pieces. We will discover how to get a Zend Framework 2 application up and running quickly using GitHub, Composer, and the Zend Framework 2 Skeleton Application. Then we will leverage the Zend Skeleton Module to introduce adding modules to a Zend Framework 2 application.
We will also cover basic usage of the ZF2 module manager, event manager, service manager, and database components. Adam will also introduce some useful resources to help attendees continue learning on their own. The goal of the talk is to give attendees enough information to be able to get a jump start into using ZF2.
Adam Culp will give a basic intro to Zend Framework (ZF2 and ZF3) and how to use the foundational pieces. We will get a Zend Framework application up and running quickly using the Zend Framework Skeleton Application, and Zend Skeleton Module to add modules. Adam will also introduce some useful resources to help attendees continue learning on their own. The talk will give attendees enough information to get a jump start into using the framework.
One thing we do at Zend is provide consulting services to companies around the world, and many of those consulting engagements involve planning migrations from ZF1 to ZF2. Learn some techniques that we have found work quite well to help ease that migration effort and answer questions like "What are the low hanging fruit? How can I reuse ZF1 resources in a ZF2 application?" We shows the codez!
Design & Development of Web Applications using SpringMVC Naresh Chintalcheru
Spring MVC is a web MVC framework that provides a reusable presentation layer for web applications. It removes boilerplate code and standardizes navigation flow and validation. Spring MVC controllers handle HTTP requests and delegate work to service objects. It uses the front controller design pattern and is view-agnostic, allowing different view technologies. Spring MVC applications are configured through XML files and use annotations for components and request mapping.
The document is an introduction to the Zend Framework 2 (ZF2) architecture. It discusses key ZF2 concepts like modules, the model-view-controller pattern, routes, controllers, and the service manager. Modules are a core concept, with everything including applications being modules. The service manager handles application dependencies and allows for decoupled development. Routes map URLs to controllers and actions. Controllers are executed from dispatched routes and return responses or view models.
Deprecated: Foundations of Zend Framework 2Adam Culp
DEPRECATED-Please see http://www.slideshare.net/adamculp/foundations-of-zendframework for updated version.
For this talk Adam Culp will cover a basic intro to Zend Framework 2 (ZF2) and how to use the foundational pieces. We will discover how to get a Zend Framework 2 application up and running quickly using GitHub, Composer, and the Zend Framework 2 Skeleton Application. Then we will leverage the Zend Skeleton Module to introduce adding modules to a Zend Framework 2 application.
We will also cover basic usage of the ZF2 module manager, event manager, service manager, and database components. Adam will also introduce some useful resources to help attendees continue learning on their own. The goal of the talk is to give attendees enough information to be able to get a jump start into using ZF2.
Adam Culp will give a basic intro to Zend Framework (ZF2 and ZF3) and how to use the foundational pieces. We will get a Zend Framework application up and running quickly using the Zend Framework Skeleton Application, and Zend Skeleton Module to add modules. Adam will also introduce some useful resources to help attendees continue learning on their own. The talk will give attendees enough information to get a jump start into using the framework.
One thing we do at Zend is provide consulting services to companies around the world, and many of those consulting engagements involve planning migrations from ZF1 to ZF2. Learn some techniques that we have found work quite well to help ease that migration effort and answer questions like "What are the low hanging fruit? How can I reuse ZF1 resources in a ZF2 application?" We shows the codez!
This document provides guidance on migrating from Zend Framework 1 (ZF1) to Zend Framework 2 (ZF2). It discusses high-level considerations like planning the migration process and deciding on an overall strategy. It also provides lower-level technical suggestions, such as using a ZF1 compatibility module to reuse existing ZF1 resources like the database and translations as ZF2 services. The document emphasizes that there is no single correct approach and the best path depends on factors like code quality and project scope.
Николай Паламарчук "Управление зависимостями в больших проектах" Fwdays
С ростом проектов усложняется их сопровождение. Адекватный выход из ситуации: разделение проекта на меньшие части. Но как именно это сделать правильно?
В этом докладе я хочу изложить основные принципы деления больших PHP проектов на меньшие части и организации их совместной работы. Я расскажу:
как делить статический код
что нам дают фреймворки
плагин, модуль, бандл, ... в чем разница?
что такое "хорошая организация модулей" в проекте
конфигурация модулей и зависимости между модулями
This document discusses modules in JavaScript. It defines what modules are, their benefits like abstraction, encapsulation, reusability and managing dependencies. It describes how earlier versions of JavaScript did not support modules natively and workarounds used like IIFE and Revealing Module Pattern. It also explains key aspects of modules like module format, module loader and build tools. Finally, it provides details on popular module formats like AMD, CommonJS, module loaders like SystemJS, RequireJS, configuration options of SystemJS like baseURL, bundles, map etc.
ZF2 Modular Architecture - Taking advantage of itSteve Maraspin
Zend Framework 1 had modules. Their name is pretty much everything Zend Framework 2 modules share with them, though. The whole framework architecture has been rewritten to encourage software reuse and extension. In this talk I’ll share our experiences on ZF2 module creation and usage.
Prism is a framework that helps build composite applications for WPF and Silverlight. It promotes loose coupling between modules, which can be developed independently and integrated at runtime. Prism supports core concepts like modules, dependency injection, and the MVVM pattern to help create maintainable, extensible applications. The presenter provides an overview of Prism capabilities and recommends resources for further information.
Ростислав Михайлив "Zend Framework 3 - evolution or revolution"Fwdays
My talk will be about ZF3, the most waited release of ZF for the last 4 years that were spent on development, features it brings and drawbacks of migration of existing ZF2 application to new rails comes with. Components, PSR-7, and Middleware
The Composite Application Guidance for WPF and Silverlight is designed to help you more easily build enterprise-level Windows Presentation Foundation (WPF) client applications.
The document discusses Zend Framework 2 service components. It provides background on service components and their goals of being independently versioned and reusable outside of ZF contexts. It outlines the lifecycle of a service component, from discussion and code review to publication. Finally, it walks through writing a sample service component for Google Cloud Messaging (GCM), including file structure, unit testing, coding standards, documentation, and integration.
The document discusses model-driven distributed software deployment. It introduces the Nix deployment system and proposes Disnix, an extension that allows distributed deployment. Disnix uses three models - services, infrastructure, and distribution - to model a distributed system. It employs a two-phase commit algorithm to allow distributed and atomic upgrades. The document also describes adapting an existing distributed system called SDS2 to be deployable with Disnix, including modifying dependencies and implementing a lookup service. The adaptation demonstrated automatic deployment of SDS2 across multiple machines.
SeedStack is a comprehensive full development stack. Learn about its features and their benefits for building enterprise software applications.
These slides have been shown at Ippon technologies, the 11th of July 2016, in Paris.
The document discusses OSGi and modular application development in Java. It provides an overview of OSGi concepts like modular design, bundles, services, and containers. It also covers tools for OSGi development including BND, Apache Felix, Apache Karaf, integration testing with Pax Exam, and using OSGi in real-world projects. The presenter has over 2 years of experience with OSGi and will discuss how to make Java applications more modular using this framework.
Spring boot is a suite, pre-configured, pre-sugared set of frameworks/technologies to reduce boilerplate configuration providing you the shortest way to have a Spring web application up and running with smallest line of code/configuration out-of-the-box.
Here are some of the key purposes of the ApplicationContext in Spring:
- It extends and builds upon the basic functionality of the BeanFactory by adding support for internationalization, event publication, resource loading, etc.
- It allows configuration through XML files and automatic detection of configuration metadata.
- It manages the complete lifecycle of beans within the context, including instantiation, configuration, dependency injection, and destruction.
- It supports transparently loading bean definitions from a variety of external locations. This includes classpath, file system, URLs, etc.
- It provides a simplified and more object-oriented model for accessing configuration metadata and bean definitions during runtime compared to the BeanFactory.
- It allows for
This document provides an overview of the facade design pattern, including its definition, purpose, applicability, structure, sample code, and related patterns. The facade pattern hides the complexities of a system and provides a simplified interface. It promotes loose coupling between subsystems and clients. The document includes structural diagrams of the pattern, guidelines for when to use it, sample code demonstrating how a facade class interacts with subsystem classes, and related patterns like abstract factory and mediator.
This document discusses environment setup, modules, and Node Package Manager (NPM) in Node.js. It provides instructions for setting up Node.js, including downloading the .msi file and setting the path. It demonstrates a simple "Hello World" app and describes modules as reusable functionality organized in files. It covers core modules, local modules, and using NPM to install, update, and uninstall Node.js packages.
Meteor is a full stack JavaScript framework that allows building reactive web and mobile apps quickly. It includes MongoDB, Node.js and packages. Apps can be created in minutes using simple commands. Meteor uses reactive templates, collections to store and sync data, and publications/subscriptions for security. Apps can be deployed easily to meteor.com or custom servers using mup. Mobile apps can also be created by wrapping the web app.
This document discusses an automatic code generation tool called UJECTOR that can generate executable Java code from UML diagrams, including class diagrams, sequence diagrams, and activity diagrams. It notes the benefits of automatic code generation in reducing errors compared to manual coding. The paper also discusses some related work, including Enterprise Architect, Eclipse UML Generators, Rhapsody, and dCode - other tools that can generate code from UML models. Overall, the document examines challenges in ensuring consistency, accuracy, maintainability and efficiency when automatically generating code from UML models.
Shine a Light with Prism (the Composite Application Guidance for WPF and Silv...Dave Bost
Prism is a library that provides guidance and tools for building composite client applications in WPF and Silverlight. It supports separating an application into modules and composing them at runtime. Prism provides features like module discovery, region-based UI composition, and an event aggregator for loose coupling. The library includes documentation, code samples, and a reference implementation to help developers build these types of applications while targeting both desktop and RIA scenarios.
This document discusses Node.js modules. It defines a module as reusable functionality organized in JavaScript files. There are three types of modules: core modules that are compiled into Node.js, local modules created locally, and external modules from NPM. Core modules provide basic functionality like HTTP and file system access. Local modules are created in separate files and exported using module.exports to make their functions or objects available. Modules can export literals, objects, functions, or classes to define their reusable API.
This document provides guidance on migrating from Zend Framework 1 (ZF1) to Zend Framework 2 (ZF2). It discusses high-level considerations like planning the migration process and deciding on an overall strategy. It also provides lower-level technical suggestions, such as using a ZF1 compatibility module to reuse existing ZF1 resources like the database and translations as ZF2 services. The document emphasizes that there is no single correct approach and the best path depends on factors like code quality and project scope.
Николай Паламарчук "Управление зависимостями в больших проектах" Fwdays
С ростом проектов усложняется их сопровождение. Адекватный выход из ситуации: разделение проекта на меньшие части. Но как именно это сделать правильно?
В этом докладе я хочу изложить основные принципы деления больших PHP проектов на меньшие части и организации их совместной работы. Я расскажу:
как делить статический код
что нам дают фреймворки
плагин, модуль, бандл, ... в чем разница?
что такое "хорошая организация модулей" в проекте
конфигурация модулей и зависимости между модулями
This document discusses modules in JavaScript. It defines what modules are, their benefits like abstraction, encapsulation, reusability and managing dependencies. It describes how earlier versions of JavaScript did not support modules natively and workarounds used like IIFE and Revealing Module Pattern. It also explains key aspects of modules like module format, module loader and build tools. Finally, it provides details on popular module formats like AMD, CommonJS, module loaders like SystemJS, RequireJS, configuration options of SystemJS like baseURL, bundles, map etc.
ZF2 Modular Architecture - Taking advantage of itSteve Maraspin
Zend Framework 1 had modules. Their name is pretty much everything Zend Framework 2 modules share with them, though. The whole framework architecture has been rewritten to encourage software reuse and extension. In this talk I’ll share our experiences on ZF2 module creation and usage.
Prism is a framework that helps build composite applications for WPF and Silverlight. It promotes loose coupling between modules, which can be developed independently and integrated at runtime. Prism supports core concepts like modules, dependency injection, and the MVVM pattern to help create maintainable, extensible applications. The presenter provides an overview of Prism capabilities and recommends resources for further information.
Ростислав Михайлив "Zend Framework 3 - evolution or revolution"Fwdays
My talk will be about ZF3, the most waited release of ZF for the last 4 years that were spent on development, features it brings and drawbacks of migration of existing ZF2 application to new rails comes with. Components, PSR-7, and Middleware
The Composite Application Guidance for WPF and Silverlight is designed to help you more easily build enterprise-level Windows Presentation Foundation (WPF) client applications.
The document discusses Zend Framework 2 service components. It provides background on service components and their goals of being independently versioned and reusable outside of ZF contexts. It outlines the lifecycle of a service component, from discussion and code review to publication. Finally, it walks through writing a sample service component for Google Cloud Messaging (GCM), including file structure, unit testing, coding standards, documentation, and integration.
The document discusses model-driven distributed software deployment. It introduces the Nix deployment system and proposes Disnix, an extension that allows distributed deployment. Disnix uses three models - services, infrastructure, and distribution - to model a distributed system. It employs a two-phase commit algorithm to allow distributed and atomic upgrades. The document also describes adapting an existing distributed system called SDS2 to be deployable with Disnix, including modifying dependencies and implementing a lookup service. The adaptation demonstrated automatic deployment of SDS2 across multiple machines.
SeedStack is a comprehensive full development stack. Learn about its features and their benefits for building enterprise software applications.
These slides have been shown at Ippon technologies, the 11th of July 2016, in Paris.
The document discusses OSGi and modular application development in Java. It provides an overview of OSGi concepts like modular design, bundles, services, and containers. It also covers tools for OSGi development including BND, Apache Felix, Apache Karaf, integration testing with Pax Exam, and using OSGi in real-world projects. The presenter has over 2 years of experience with OSGi and will discuss how to make Java applications more modular using this framework.
Spring boot is a suite, pre-configured, pre-sugared set of frameworks/technologies to reduce boilerplate configuration providing you the shortest way to have a Spring web application up and running with smallest line of code/configuration out-of-the-box.
Here are some of the key purposes of the ApplicationContext in Spring:
- It extends and builds upon the basic functionality of the BeanFactory by adding support for internationalization, event publication, resource loading, etc.
- It allows configuration through XML files and automatic detection of configuration metadata.
- It manages the complete lifecycle of beans within the context, including instantiation, configuration, dependency injection, and destruction.
- It supports transparently loading bean definitions from a variety of external locations. This includes classpath, file system, URLs, etc.
- It provides a simplified and more object-oriented model for accessing configuration metadata and bean definitions during runtime compared to the BeanFactory.
- It allows for
This document provides an overview of the facade design pattern, including its definition, purpose, applicability, structure, sample code, and related patterns. The facade pattern hides the complexities of a system and provides a simplified interface. It promotes loose coupling between subsystems and clients. The document includes structural diagrams of the pattern, guidelines for when to use it, sample code demonstrating how a facade class interacts with subsystem classes, and related patterns like abstract factory and mediator.
This document discusses environment setup, modules, and Node Package Manager (NPM) in Node.js. It provides instructions for setting up Node.js, including downloading the .msi file and setting the path. It demonstrates a simple "Hello World" app and describes modules as reusable functionality organized in files. It covers core modules, local modules, and using NPM to install, update, and uninstall Node.js packages.
Meteor is a full stack JavaScript framework that allows building reactive web and mobile apps quickly. It includes MongoDB, Node.js and packages. Apps can be created in minutes using simple commands. Meteor uses reactive templates, collections to store and sync data, and publications/subscriptions for security. Apps can be deployed easily to meteor.com or custom servers using mup. Mobile apps can also be created by wrapping the web app.
This document discusses an automatic code generation tool called UJECTOR that can generate executable Java code from UML diagrams, including class diagrams, sequence diagrams, and activity diagrams. It notes the benefits of automatic code generation in reducing errors compared to manual coding. The paper also discusses some related work, including Enterprise Architect, Eclipse UML Generators, Rhapsody, and dCode - other tools that can generate code from UML models. Overall, the document examines challenges in ensuring consistency, accuracy, maintainability and efficiency when automatically generating code from UML models.
Shine a Light with Prism (the Composite Application Guidance for WPF and Silv...Dave Bost
Prism is a library that provides guidance and tools for building composite client applications in WPF and Silverlight. It supports separating an application into modules and composing them at runtime. Prism provides features like module discovery, region-based UI composition, and an event aggregator for loose coupling. The library includes documentation, code samples, and a reference implementation to help developers build these types of applications while targeting both desktop and RIA scenarios.
This document discusses Node.js modules. It defines a module as reusable functionality organized in JavaScript files. There are three types of modules: core modules that are compiled into Node.js, local modules created locally, and external modules from NPM. Core modules provide basic functionality like HTTP and file system access. Local modules are created in separate files and exported using module.exports to make their functions or objects available. Modules can export literals, objects, functions, or classes to define their reusable API.
Similar to ZF2 Modules: Events, Services, and of course, modularity (20)
The document discusses using Vagrant and Puppet to create virtual machine environments for development. Vagrant allows defining and provisioning VMs through a Vagrantfile, while Puppet can further configure the VMs by installing software and configuring settings. Benefits include keeping development environments isolated, easy setup for new developers, and ability to deploy VMs to cloud providers like AWS. The key steps are downloading Vagrant and VirtualBox, defining the Vagrantfile, writing Puppet manifests, and running vagrant up to launch and provision the VM.
John Coggeshall has 18 years of experience in web development and PHP. He discusses several projects that failed due to neglecting technical debt, overcomplicating projects, and ignoring expert advice. Some key lessons are to have expert skills as partners rather than employees, manage expectations, be flexible, have a development process, and keep things simple.
The rise of virtualization has transformed the server business, but other than that it seems like the developer world has largely been left behind. Regardless of if you are working on one project, or have 20 clients, every developer should know how to use virtualization to create seamless and easy to manage development environments. In this talk we will take a practical approach to using a combination of Puppet, Vagrant, and VirtualBox to create entire development environments in a matter of moments - and even better re-use that template for any project you have in the future in a version-controlled and easily managed manner. Bringing on a new developer for your project? We'll show you how they can get a full-fledged development environment from zero to working in under 10 minutes.
My talk given at Confoo, 2011 in Montreal, Quebec on using the Puppet client/server deployment tool for complex web application deployments. This is an introduction talk, and introduces everything you'll need to get started.
This is a talk I gave at PHP Quebec 2009 on building Android applications with PHP back-ends. Posted for completeness, the majority of this talk was buried in Android/Java and PHP code.. That said, there are still some useful things in the slides themselves to share.
The document discusses building rich internet applications (RIAs) using Adobe Flex and AIR with a PHP/Zend Framework backend. It describes a project to modernize a legacy DOS-based dealer management system (DMS) by creating an internet-based version that provides data sharing and analytics capabilities. Flex and AIR were chosen for the user interface to provide a desktop-like experience, while PHP/Zend Framework handles the backend functionality. Challenges included a lack of server push capabilities and no hardware support in AIR. These issues were addressed through custom data transfer code and a Java server (Merapi) that could communicate with hardware devices.
A brief keynote I gave at PHP Quebec regarding the shift away from the browser for applications and the potential impacts it will have on our development needs as an industry
The document provides tips on common scalability mistakes made when designing web applications and strategies to avoid them. It discusses the importance of considering scalability from the beginning, avoiding blocking calls, caching frequently accessed data, optimizing database and file system usage, and using tools like profilers to identify bottlenecks. The key is designing applications that can scale both up and down based on current needs through a proactive, process-oriented approach.
These are the slides from my ZendCon 2007 talk on a project we did in Professional Services to basically rebuild from scratch InTicketing's (TicketMaster competitor) e-commerce engine using Zend technologies. It was very well received (not even standing room) and well worth a look!
The document provides an introduction to PHP security basics. It discusses identifying principals (the targets of attackers like private data), understanding common attack vectors like SQL injection and cross-site scripting, and employing defense in depth with overlapping security tactics to protect against multiple attack vectors. The presentation emphasizes understanding what information an attacker could derive from an application in order to better protect principal data and functions.
A three hour tutorial I gave at PHP Quebec on the challenges, theory, and concepts behind making asynchronous JavaScript calls for Web 2.0 Applications using PHP
Instagram has become one of the most popular social media platforms, allowing people to share photos, videos, and stories with their followers. Sometimes, though, you might want to view someone's story without them knowing.
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdfFlorence Consulting
Quattordicesimo Meetup di Milano, tenutosi a Milano il 23 Maggio 2024 dalle ore 17:00 alle ore 18:30 in presenza e da remoto.
Abbiamo parlato di come Axpo Italia S.p.A. ha ridotto il technical debt migrando le proprie APIs da Mule 3.9 a Mule 4.4 passando anche da on-premises a CloudHub 1.0.
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC
Ellisha Heppner, Grant Management Lead, presented an update on APNIC Foundation to the PNG DNS Forum held from 6 to 10 May, 2024 in Port Moresby, Papua New Guinea.
Gen Z and the marketplaces - let's translate their needsLaura Szabó
The product workshop focused on exploring the requirements of Generation Z in relation to marketplace dynamics. We delved into their specific needs, examined the specifics in their shopping preferences, and analyzed their preferred methods for accessing information and making purchases within a marketplace. Through the study of real-life cases , we tried to gain valuable insights into enhancing the marketplace experience for Generation Z.
The workshop was held on the DMA Conference in Vienna June 2024.
Understanding User Behavior with Google Analytics.pdfSEO Article Boost
Unlocking the full potential of Google Analytics is crucial for understanding and optimizing your website’s performance. This guide dives deep into the essential aspects of Google Analytics, from analyzing traffic sources to understanding user demographics and tracking user engagement.
Traffic Sources Analysis:
Discover where your website traffic originates. By examining the Acquisition section, you can identify whether visitors come from organic search, paid campaigns, direct visits, social media, or referral links. This knowledge helps in refining marketing strategies and optimizing resource allocation.
User Demographics Insights:
Gain a comprehensive view of your audience by exploring demographic data in the Audience section. Understand age, gender, and interests to tailor your marketing strategies effectively. Leverage this information to create personalized content and improve user engagement and conversion rates.
Tracking User Engagement:
Learn how to measure user interaction with your site through key metrics like bounce rate, average session duration, and pages per session. Enhance user experience by analyzing engagement metrics and implementing strategies to keep visitors engaged.
Conversion Rate Optimization:
Understand the importance of conversion rates and how to track them using Google Analytics. Set up Goals, analyze conversion funnels, segment your audience, and employ A/B testing to optimize your website for higher conversions. Utilize ecommerce tracking and multi-channel funnels for a detailed view of your sales performance and marketing channel contributions.
Custom Reports and Dashboards:
Create custom reports and dashboards to visualize and interpret data relevant to your business goals. Use advanced filters, segments, and visualization options to gain deeper insights. Incorporate custom dimensions and metrics for tailored data analysis. Integrate external data sources to enrich your analytics and make well-informed decisions.
This guide is designed to help you harness the power of Google Analytics for making data-driven decisions that enhance website performance and achieve your digital marketing objectives. Whether you are looking to improve SEO, refine your social media strategy, or boost conversion rates, understanding and utilizing Google Analytics is essential for your success.
Ready to Unlock the Power of Blockchain!Toptal Tech
Imagine a world where data flows freely, yet remains secure. A world where trust is built into the fabric of every transaction. This is the promise of blockchain, a revolutionary technology poised to reshape our digital landscape.
Toptal Tech is at the forefront of this innovation, connecting you with the brightest minds in blockchain development. Together, we can unlock the potential of this transformative technology, building a future of transparency, security, and endless possibilities.
2. Hi! I’m John!
• Involved in PHP since circa 1996
• Sr. Architect, Zend Global Services
• PHP Core Contributor
• ZF Contributor
3. Getting Started
The easiest way to get started in ZF2 is to
start with the skeleton application:
https://github.com/zendframework/zendskeletonapplication
$ composer create-project
-sdev
-repository-url=“https://packages.zendframework.com”
zendframework/skeleton-application
/path/to/install
4. ZF2 Modules
In ZF2 modules are a core concept when
developing applications. Everything including
the application is a module.
Modules can be application-specific or can be
written generically and then loaded into the
application via composer
6. How do Modules work?
Every ZF2 module starts with a Module class
which describes the module and the things it
provides to the application
Services
Event Handlers
Controllers
Routes
Etc.
7. How do Modules work?
Modules also have their own configuration
files which can setup default values that are
later over-written by the application’s
configurations.
Useful for creating module-specific routes, or
module-specific configurations, etc.
config/module.config.php
8. How do Modules work?
The module class can implement a number of
useful methods
getAutoLoaderConfig() – configure the way
classes are autoloaded through this module
getServiceConfig() – set up the way services this
module provides can be created and accessed
getModuleDependencies() – Define module
dependencies
onBootstrap() – Executed when module is fired up
9. Service Manager
ZF2 applications in general rely heavily on
something called the Service Manager to deal
with application dependencies
Examples: The DB adapter used by the
application is created by the Service Manager
10. Service Manager
Implementing dependencies and
components as services allows modules to be
completely decoupled from each other
Services are identified by unique ID, which is
referenced when the service is required
Customization (i.e. a different DB adapter)
can be done simply by over-writing the
factory associated with that unique ID
11. Service Manager
In a module services can be defined in various
locations
module.config.php (the ‘service_manager’ key)
Module::getServiceConfig() (the programatic
approach)
12. Service Manager
How services can be defined
By factory – identify the key to either a class that
implements a Factory interface or other callable
which returns the instance
By invokable – Simply identify the class associated
with this service
Aliases – Services can have an alias for
complicated dependency scenarios
13. Using Events
All events are managed through the event
manager class(es)
Can be automatically injected into your objects via
the Service Locator
Implement the EventManagerAwareInterface
14. Event Managers
The ZF2 Event manager is the primary way
modules should communicate with each
other
Optionally, also internally
Broadcast Events for others to react to
I.e. “Dispatch”
15. ZF2 Baked in Events
ZF2 uses events throughout its core functionality
Module Manager
Application
Bootstrap, etc.
MVC Events
Routing
Dispatching
Rendering
http://akrabat.com/zend-framework-2/a-list-of-zf2-
events/
16. Event Scoping
Events are by default scoped to the local
object
Each Event Manger is by default unique to that
object
If you want to have events of a different
scope you have a few options
Provide a way to get your event manager
Use the more global SharedEventManager
17. Summary
This is a very surface-level exploration into
the complex possibilities of ZF2 modules and
events, but enough to get started.
Get to know Service Manager and Event
Manager very well and they will serve you
fantastically, allowing you to write powerful
reusable components
18. Any questions?
Tell me what you think: http://joind.in/11875
Slides will be available at http://www.slideshare.net/coogle