Magento 2.0 GA was released this past Tuesday. This new major release of the well-known Magento eCommerce platform incorporates modern design practices, breathing new life into a steadily growing platform. Whether you’ve been working with Magento 1 for the last few years or are completely new to Magento, come and learn about the new and exciting aspects of Magento 2. You will be presented with an overview of the system architecture, shown some of the various ways to extend the system, and walk away ready to use Magento for your next eCommerce project.
This presentation is about real examples of Design Patterns usage in Magento 2. There are 2 major architectural goals set for Magento 2 project:
1. Enable streamline customisations.
2. Simplify external integrations.
There are much more Design Patterns used in Magento 2, some of them are discussed in the deck.
Magento 2 - An Intro to a Modern PHP-Based System - Northeast PHP 2015Joshua Warren
Over 200,000 companies use the Magento 1 platform to power their eCommerce needs. So when they set out to build a major new version, the Magento team had significant pressure to deliver a modern, well-designed PHP-based system. Pulling in some of the best of the PHP world through tools like Composer, phpunit and more, I believe they met that goal. In this talk, we’ll take a look at the design and architecture of Magento 2, including it’s use of dependency injections, interceptors and service contracts to provide numerous ways for developers to extend and customize the system.
Presented at Northeast PHP 2015
Magento 2: New and Innovative? - php[world] 2015David Alger
Since the early days of Magento, the PHP eCommerce platform has taken the world by storm. As with any new platform, there were growing pains. Five years later, we see the age of Magento 2 dawning upon us. Although not rewritten from the ground up, the architects behind the beast went back to the drawing board to create something innovative. This led to a system with configurable dependency injection, PSR compliance, decoupled modules, native composer support, and a modern tech stack. This talk looks at some ways Magento has improved. You will also learn how to create a plugin in Magento 2.
Magento 2 Development for PHP DevelopersJoshua Warren
As one of the most popular eCommerce platforms in the world, the demand for Magento developer is at an all-time high. In this tutorial, I’ll introduce you to developing for Magento 2 and help you get up to speed quickly so that you’re ready to support and extend existing Magento 2 sites.
Presented as a 3.5 hour tutorial at php[world] 2016.
Magento 2 Dependency Injection, Interceptors, and You - php[world] 2015Joshua Warren
Magento 2 introduces dependency injection and interceptors, two approaches to creating a more flexible, extendable architecture. These concepts are new to many PHP developers, but they are critical to understanding and taking advantage of the power and flexibility of Magento 2. Let's take a high-level look at these concepts, and then dive into some real examples of how to utilize these techniques in your development work with Magento 2.
This presentation is about real examples of Design Patterns usage in Magento 2. There are 2 major architectural goals set for Magento 2 project:
1. Enable streamline customisations.
2. Simplify external integrations.
There are much more Design Patterns used in Magento 2, some of them are discussed in the deck.
Magento 2 - An Intro to a Modern PHP-Based System - Northeast PHP 2015Joshua Warren
Over 200,000 companies use the Magento 1 platform to power their eCommerce needs. So when they set out to build a major new version, the Magento team had significant pressure to deliver a modern, well-designed PHP-based system. Pulling in some of the best of the PHP world through tools like Composer, phpunit and more, I believe they met that goal. In this talk, we’ll take a look at the design and architecture of Magento 2, including it’s use of dependency injections, interceptors and service contracts to provide numerous ways for developers to extend and customize the system.
Presented at Northeast PHP 2015
Magento 2: New and Innovative? - php[world] 2015David Alger
Since the early days of Magento, the PHP eCommerce platform has taken the world by storm. As with any new platform, there were growing pains. Five years later, we see the age of Magento 2 dawning upon us. Although not rewritten from the ground up, the architects behind the beast went back to the drawing board to create something innovative. This led to a system with configurable dependency injection, PSR compliance, decoupled modules, native composer support, and a modern tech stack. This talk looks at some ways Magento has improved. You will also learn how to create a plugin in Magento 2.
Magento 2 Development for PHP DevelopersJoshua Warren
As one of the most popular eCommerce platforms in the world, the demand for Magento developer is at an all-time high. In this tutorial, I’ll introduce you to developing for Magento 2 and help you get up to speed quickly so that you’re ready to support and extend existing Magento 2 sites.
Presented as a 3.5 hour tutorial at php[world] 2016.
Magento 2 Dependency Injection, Interceptors, and You - php[world] 2015Joshua Warren
Magento 2 introduces dependency injection and interceptors, two approaches to creating a more flexible, extendable architecture. These concepts are new to many PHP developers, but they are critical to understanding and taking advantage of the power and flexibility of Magento 2. Let's take a high-level look at these concepts, and then dive into some real examples of how to utilize these techniques in your development work with Magento 2.
MidwestPHP - Getting Started with Magento 2Mathew Beane
Magento 2 is a fresh take on a modern eCommerce platform rich in features and community. We will go over common best practices and toolsets, and to introduce popular community resources. Then we will take a dive into setting up a Magento 2 site to illustrate the effort required to get a project off the ground, and to find a better understand of what Magento 2 offers.
Covers the following Topics:
the following topics:
Best Practices: Keeping core clean, how to modify Magento the right way.
Community Resources: How to join the Magento Community
Certification: How to get Magento Certified
Migrating from Magento 1: A look at the tools and methods.
Setting up a Magento site: Covering the basic design and development choices.
Sergii Shymko: Magento 2: Composer for Extensions DistributionMeet Magento Italy
Magento 1.x uses Magento Connect to package and distribute extensions. Magento 2 uses Composer, a de facto standard dependency manager for PHP, instead. Integration with Composer changes approach to module versioning, dependencies declaration, and installation. It completely changes the way modules/themes/localizations are distributed in the Magento ecosystem.
Sergii Shymko - Code migration tool for upgrade to Magento 2Meet Magento Italy
Since the official release of Magento 2 in November 2015, upgrading from Magento 1.x has become a goal for store owners and extension vendors. Being a major release, Magento 2 has made leaps forward in the application architecture, which contributes to the upgrade complexity. One of the major challenges is upgrade of a codebase. Code migration tool has been created to tackle this task. Current presentation goes over the capabilities of the tool. We discuss how to employ the tool for a successful upgrade project.
How To Create Theme in Magento 2 - Part 1Magestore
How to create theme on Magento 2. A useful tutorial for any Magento developers.
Other updates & tutorial are on Magestore Blog: http://blog.magestore.com/magento-2/
Oleh Kobchenko - Configure Magento 2 to get maximum performanceMeet Magento Italy
Magento 2 is qualitatively new product in world of e-commerce. Providing new opportunities for extensibility, configurability and scalability of your store M2 also brings list of performance improvements.
This presentation is devoted to main performance features available in product, their activation and usage.
Speaker dives into details on how to setup environment and Magento itself to get the best result in terms of page response and throughput.
12 Amazing Features of Magento 2
1 Backup / Rollback System in Magento 2
2 Upgrading in Magento 2
3 Maintenance Mode and Restricting IP Addresses
4 Three Modes in Magento 2 Developer, Production and Default
5 Module Installation and Management
6 PSR Compliance
7 Performance
8 Magento 2 Admin Backend UI
9 Theme Developer's Delight : Blank Theme
10 Migration Tool
11 Scalability
12 Last but not the least: The Magento 2 Testing Framework
For more Updates on Magento 2, visit us @
http://schogini.biz/magento/
Magento 2 - An Intro to a Modern PHP-Based System - ZendCon 2015Joshua Warren
Newly updated version of my Magento 2 intro talk - make sure to refer to this one, not the older ones!
Over 200,000 companies use the Magento 1 platform to power their eCommerce needs. So when they set out to build a major new version, the Magento team had significant pressure to deliver a modern, well-designed PHP-based system. Pulling in some of the best of the PHP world through tools like Composer, phpunit and more, I believe they met that goal. In this talk, we’ll take a look at the design and architecture of Magento 2, including it’s use of dependency injections, interceptors and service contracts to provide numerous ways for developers to extend and customize the system.
Presented at ZendCon 2015.
Magento 2: Modernizing an eCommerce PowerhouseBen Marks
Magento 2 is almost here. This talk presents the goals driving its development as well as highlighting changes and new technology. Delivered at PNWPHP 2015
Find step by step tutorial on how to install Magento 2 beta/alpha version and what are the system requirements to install Magento 2. And stay with us to learn more on Magento 2.
Magento 2 Theme Trainning for Beginners | MagenestMagenest
Whoever you are an extension or theme developer, you should spend time reading this slide post because you’ll understand more about theme and template structure in Magento 2.
Finding Your Way: Understanding Magento CodeBen Marks
With millions of lines of code, an unconventional approach to MVC framework architecture, and unique concepts such as layout XML, Magento can be intimidating for the new developer and even difficult for experienced Magento developers. This talk aims to help developers find answers in the codebase by breaking down the technologies, design patterns, and module structure into intuitive chunks. Starting with a high level view of Magento's MVC implementation, a pre-developed module is dissected in order to demonstrate various areas of the framework as well as the application-level settings and features which can thwart (or aide!) developers.
Topics covered include the following:
* MVC theory as implemented by Magento, especially the thin-controller, fat-view concept
* Overall module architecture * Finding method definitions when grep won't work, aka "when __call() strikes"
* Identifying poor-performing code using native code profiling tools
* An infallible (well, nearly-infallible) flowchart for finding problematic code
* Essential developer preparations
Magento 2 is best known as the most successful open source commerce app but did you know that it is a full-fledged PHP framework underneath, complete with several tools to make a developer's life easier? In order to build and maintain a Magento 2 site, developers must adhere to certain framework conventions and use the tools that ship with the app. This talk presents these best practices and introduces some community-created tools as well.
How I Learned to Stop Worrying and Love Composer - php[world] 2015Joshua Warren
WordPress extensions, Drupal modules, Magento extensions — developers are building amazing features for each platform. But what if, instead of building platform-specific features, we built reusable packages? All of our platforms can be used with Composer — Magento 2 is even fully installable via Composer & developers can pull in specific Magento components to non-Magento projects, as well. However, we still write extensions for our platform & don't write reusable PHP packages. Let's look at how we all benefit by changing this mindset and how to start writing reusable cross-platform packages.
Make implementation of third party elements in magento 2 in 5-times easierElena Kulbich
There is one magic tool that simplifies development on Magento 2. We recommend remembering its name, because today we are giving kudos to one and only - the 'Composer'. Composer is a dependency manager for PHP that allows you to declare the libraries your project depends on, and it will manage (install/update) them for you. Sometimes Composer is referred to as the library manager since this is how it works in general, but when used for some definite local project, Composer becomes a Dependency Manager.
When comparing Magento 2 and Magento 1, you can see that the last one has quite an inflexible structure. Shift from Magento 1 to Magento 2 can be compared to the fall of the Berlin Wall in 1989, where Pink Floyd gave their famous concert. Magento 1 is perceived as a monolith structure where each module is like another brick of the solid wall. In Magento 2 all modules are separated and independent like bricks of the broken wall, except for the modules that are marked as “dependent” in the configuration. So the Composer helps to crash the unbreakable wall.
MidwestPHP - Getting Started with Magento 2Mathew Beane
Magento 2 is a fresh take on a modern eCommerce platform rich in features and community. We will go over common best practices and toolsets, and to introduce popular community resources. Then we will take a dive into setting up a Magento 2 site to illustrate the effort required to get a project off the ground, and to find a better understand of what Magento 2 offers.
Covers the following Topics:
the following topics:
Best Practices: Keeping core clean, how to modify Magento the right way.
Community Resources: How to join the Magento Community
Certification: How to get Magento Certified
Migrating from Magento 1: A look at the tools and methods.
Setting up a Magento site: Covering the basic design and development choices.
Sergii Shymko: Magento 2: Composer for Extensions DistributionMeet Magento Italy
Magento 1.x uses Magento Connect to package and distribute extensions. Magento 2 uses Composer, a de facto standard dependency manager for PHP, instead. Integration with Composer changes approach to module versioning, dependencies declaration, and installation. It completely changes the way modules/themes/localizations are distributed in the Magento ecosystem.
Sergii Shymko - Code migration tool for upgrade to Magento 2Meet Magento Italy
Since the official release of Magento 2 in November 2015, upgrading from Magento 1.x has become a goal for store owners and extension vendors. Being a major release, Magento 2 has made leaps forward in the application architecture, which contributes to the upgrade complexity. One of the major challenges is upgrade of a codebase. Code migration tool has been created to tackle this task. Current presentation goes over the capabilities of the tool. We discuss how to employ the tool for a successful upgrade project.
How To Create Theme in Magento 2 - Part 1Magestore
How to create theme on Magento 2. A useful tutorial for any Magento developers.
Other updates & tutorial are on Magestore Blog: http://blog.magestore.com/magento-2/
Oleh Kobchenko - Configure Magento 2 to get maximum performanceMeet Magento Italy
Magento 2 is qualitatively new product in world of e-commerce. Providing new opportunities for extensibility, configurability and scalability of your store M2 also brings list of performance improvements.
This presentation is devoted to main performance features available in product, their activation and usage.
Speaker dives into details on how to setup environment and Magento itself to get the best result in terms of page response and throughput.
12 Amazing Features of Magento 2
1 Backup / Rollback System in Magento 2
2 Upgrading in Magento 2
3 Maintenance Mode and Restricting IP Addresses
4 Three Modes in Magento 2 Developer, Production and Default
5 Module Installation and Management
6 PSR Compliance
7 Performance
8 Magento 2 Admin Backend UI
9 Theme Developer's Delight : Blank Theme
10 Migration Tool
11 Scalability
12 Last but not the least: The Magento 2 Testing Framework
For more Updates on Magento 2, visit us @
http://schogini.biz/magento/
Magento 2 - An Intro to a Modern PHP-Based System - ZendCon 2015Joshua Warren
Newly updated version of my Magento 2 intro talk - make sure to refer to this one, not the older ones!
Over 200,000 companies use the Magento 1 platform to power their eCommerce needs. So when they set out to build a major new version, the Magento team had significant pressure to deliver a modern, well-designed PHP-based system. Pulling in some of the best of the PHP world through tools like Composer, phpunit and more, I believe they met that goal. In this talk, we’ll take a look at the design and architecture of Magento 2, including it’s use of dependency injections, interceptors and service contracts to provide numerous ways for developers to extend and customize the system.
Presented at ZendCon 2015.
Magento 2: Modernizing an eCommerce PowerhouseBen Marks
Magento 2 is almost here. This talk presents the goals driving its development as well as highlighting changes and new technology. Delivered at PNWPHP 2015
Find step by step tutorial on how to install Magento 2 beta/alpha version and what are the system requirements to install Magento 2. And stay with us to learn more on Magento 2.
Magento 2 Theme Trainning for Beginners | MagenestMagenest
Whoever you are an extension or theme developer, you should spend time reading this slide post because you’ll understand more about theme and template structure in Magento 2.
Finding Your Way: Understanding Magento CodeBen Marks
With millions of lines of code, an unconventional approach to MVC framework architecture, and unique concepts such as layout XML, Magento can be intimidating for the new developer and even difficult for experienced Magento developers. This talk aims to help developers find answers in the codebase by breaking down the technologies, design patterns, and module structure into intuitive chunks. Starting with a high level view of Magento's MVC implementation, a pre-developed module is dissected in order to demonstrate various areas of the framework as well as the application-level settings and features which can thwart (or aide!) developers.
Topics covered include the following:
* MVC theory as implemented by Magento, especially the thin-controller, fat-view concept
* Overall module architecture * Finding method definitions when grep won't work, aka "when __call() strikes"
* Identifying poor-performing code using native code profiling tools
* An infallible (well, nearly-infallible) flowchart for finding problematic code
* Essential developer preparations
Magento 2 is best known as the most successful open source commerce app but did you know that it is a full-fledged PHP framework underneath, complete with several tools to make a developer's life easier? In order to build and maintain a Magento 2 site, developers must adhere to certain framework conventions and use the tools that ship with the app. This talk presents these best practices and introduces some community-created tools as well.
How I Learned to Stop Worrying and Love Composer - php[world] 2015Joshua Warren
WordPress extensions, Drupal modules, Magento extensions — developers are building amazing features for each platform. But what if, instead of building platform-specific features, we built reusable packages? All of our platforms can be used with Composer — Magento 2 is even fully installable via Composer & developers can pull in specific Magento components to non-Magento projects, as well. However, we still write extensions for our platform & don't write reusable PHP packages. Let's look at how we all benefit by changing this mindset and how to start writing reusable cross-platform packages.
Make implementation of third party elements in magento 2 in 5-times easierElena Kulbich
There is one magic tool that simplifies development on Magento 2. We recommend remembering its name, because today we are giving kudos to one and only - the 'Composer'. Composer is a dependency manager for PHP that allows you to declare the libraries your project depends on, and it will manage (install/update) them for you. Sometimes Composer is referred to as the library manager since this is how it works in general, but when used for some definite local project, Composer becomes a Dependency Manager.
When comparing Magento 2 and Magento 1, you can see that the last one has quite an inflexible structure. Shift from Magento 1 to Magento 2 can be compared to the fall of the Berlin Wall in 1989, where Pink Floyd gave their famous concert. Magento 1 is perceived as a monolith structure where each module is like another brick of the solid wall. In Magento 2 all modules are separated and independent like bricks of the broken wall, except for the modules that are marked as “dependent” in the configuration. So the Composer helps to crash the unbreakable wall.
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.
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHPDana Luther
In this tutorial we will go over setting up a standard LEMP stack for development use and learn how to modify it to mimic your production/pre-production environments as closely as possible. We will go over how to switch from Nginx to Apache, upgrade PHP versions and introduce additional storage engines such as Redis to the equation. We'll also step through how to run both unit and acceptance suites using headless Selenium images in the stack. Leave here fully confident in knowing that whatever environment you get thrown into, you can replicate it and work in it comfortably.
Why I like PHPStorm
Advantages of Using Docker
Client, Docker Host, Registry
Docker Usage
Solr Docker File
Every Day Docker Commands
Docker Search
One Line Scripts
Portainer
Kinematic
Docker Compose
Grafana
Coding style guide
PHPCS/MD
Documentation Rules
Xdebug
Postman
This talk is about how my company took a broken e-commerce and LMS site written in an older style MVC framework and re-wrote a significant portion of it in Symfony and related tools (Doctrine, FOS Bundles, Sonata) over 6 months and created a stable, well-tested application.
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
Generating a custom Ruby SDK for your web service or Rails API using Smithyg2nightmarescribd
Have you ever wanted a Ruby client API to communicate with your web service? Smithy is a protocol-agnostic language for defining services and SDKs. Smithy Ruby is an implementation of Smithy that generates a Ruby SDK using a Smithy model. In this talk, we will explore Smithy and Smithy Ruby to learn how to generate custom feature-rich SDKs that can communicate with any web service, such as a Rails JSON API.
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Ramesh Iyer
In today's fast-changing business world, Companies that adapt and embrace new ideas often need help to keep up with the competition. However, fostering a culture of innovation takes much work. It takes vision, leadership and willingness to take risks in the right proportion. Sachin Dev Duggal, co-founder of Builder.ai, has perfected the art of this balance, creating a company culture where creativity and growth are nurtured at each stage.
2. Fundamentals of Extending Magento 2 @blackbooker / #phpworld
My Experience
Magento developer since early 2009
Magento 1 & 2 contributor
GitHub Community Moderator
Director of Technology at Classy Llama
2
4. Fundamentals of Extending Magento 2 @blackbooker / #phpworld
Technology Stack
PHP 5.6.x or 5.5.x*
PSR-0 through PSR-4
HTML5 & CSS3 w/LESS
JQuery w/RequireJS
3PLs ZF1, ZF2 and Symfony
Apache 2.2, 2.4 / Nginx 1.8
MySQL 5.6
Composer meta-packages
*There are known issues with 5.5.10–5.5.16 and 5.6.0
Optional components:
• Varnish as a cache layer
• Redis for sessions or page caching
• Solr (search engine)
4
5. Fundamentals of Extending Magento 2 @blackbooker / #phpworld
Backwards Compatibility
SemVer 2.0 policy for PHP code
Version numbers in MAJOR.MINOR.PATCH format
• MAJOR indicates incompatible API changes
• MINOR where added functionality is backward-compatible
• PATCH for backward-compatible bug fixes
Guaranteed BC for code with @api annotations
@deprecated annotations with ~1yr later removal
5
6. Fundamentals of Extending Magento 2 @blackbooker / #phpworld
Strongly Layered
Presentation layer to provide view components
Service layer defined interfaces for integrating with logic
Domain layer to provide core business logic and base functionality
Persistence layer using an active record pattern to store data
6
7. Fundamentals of Extending Magento 2 @blackbooker / #phpworld
Magento Components
Modules support major functionality and behavior
Themes implement the interface users interact with
Language packs to support i18n
Vendor libraries such as ZF1, ZF1 & Symfony
7
8. Fundamentals of Extending Magento 2 @blackbooker / #phpworld
Breaking it Down
MagentoFramework
• provides common libraries such as FS, Events, OM, etc
• core application behavior such as routing
• does not "know" about anything outside of itself
VendorLibrary similar to framework, don't re-invent
Modules,Themes & Language Packs
• areas you as a developer will be working with
• may fall into either of 2 categories: required or optional
8
10. Fundamentals of Extending Magento 2 @blackbooker / #phpworld
Dependency Injection
Implements the constructor injection pattern
Dependencies may be provided automatically
Some injected dependencies must be set in XML
This completely replaces the "Mage" god class in 1.x
Class dependencies can be replaced via module config
10
11. @blackbooker / #phpworldFundamentals of Extending Magento 2
Injecting an Interface
class Norf
{
protected $bar;
public function __construct(BarInterface $bar) {
$this->bar = $bar;
parent::__construct();
}
}
11
13. @blackbooker / #phpworldFundamentals of Extending Magento 2
DI Proxies
<type name="FooBarModelBaz" shared="false">
<arguments>
<argument name="norf" xsi:type="object">FooBarModelNorf</argument>
</arguments>
</type>
13
14. @blackbooker / #phpworldFundamentals of Extending Magento 2
Plugins
Plugins work using technique called interception
They are implemented in context of a module
You write your plugins; interceptor code is generated
Can wrap around, be called before/after class methods
14
http://devdocs.magento.com/guides/v2.0/extension-dev-guide/plugins.html
16. @blackbooker / #phpworldFundamentals of Extending Magento 2
Intercepting Before
class Qux
{
public function beforeSetBaz(Norf $subject, $baz)
{
// modify baz
return [$baz];
}
}
16
Plugin/Qux.php
17. @blackbooker / #phpworldFundamentals of Extending Magento 2
Intercepting After
class Qux
{
public function afterGetBaz(Norf $subject, $result)
{
// modify result
return $result;
}
}
17
Plugin/Qux.php
18. @blackbooker / #phpworldFundamentals of Extending Magento 2
Wrapping Around
class Qux
{
public function aroundBaztastic(Norf $subject, Closure $proceed)
{
// do something before
$result = $proceed();
if ($result) {
// do something really cool
}
return $result;
}
}
18
Plugin/Qux.php
19. Fundamentals of Extending Magento 2 @blackbooker / #phpworld
Where can you Plugin?
Anywhere except for…
• final methods / classes
• non-public methods
• class methods
• __construct
19
http://devdocs.magento.com/guides/v2.0/extension-dev-guide/plugins.html
20. Fundamentals of Extending Magento 2 @blackbooker / #phpworld
Code Generation
Auto-generates code to create non-existent classes
This is based on convention such as *Factory classes
You can still see and debug the code in var/generation
In development mode these are created in autoloader
Production mode expects pre-compilation via CLI tool
20
21. Fundamentals of Extending Magento 2 @blackbooker / #phpworld
Factory Pattern
Single purpose objects used to create object instances
Isolate the object manager from business logic
Instead of injecting ObjectManager, use a *Factory
Uniform pattern interface since they are generated
21
22. @blackbooker / #phpworldFundamentals of Extending Magento 2
BaseFactory
class BaseFactory
{
protected $objectManager;
public function __construct(ObjectManager $objectManager)
{
$this->objectManager = $objectManager;
}
public function create($sourceData = null)
{
return $this->objectManager->create('Base', ['sourceData' => $sourceData]);
}
}
22
23. @blackbooker / #phpworldFundamentals of Extending Magento 2
Using a Factory
class Norf
{
protected $barFactory;
public function __construct(BarFactory $barFactory) {
$this->barFactory = $barFactory;
parent::__construct();
}
/** returns Bar object instantiated by object manager */
public function createBar() {
return $this->barFactory->create();
}
}
23
24. Fundamentals of Extending Magento 2 @blackbooker / #phpworld
Component Management
All components installed via composer
Register component so Magento knows it's there
Composer auto-loader used to load registration.php
Any app/code/*/*/registration.php loaded in bootstrap
24
25. @blackbooker / #phpworldFundamentals of Extending Magento 2
Component Registration
use MagentoFrameworkComponentComponentRegistrar;
ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Foo_Bar', __DIR__);
25
registration.php
29. Fundamentals of Extending Magento 2 @blackbooker / #phpworld
Which install method?
Getting the source
• Complete tarball
• Composer meta-packages
• GitHub clone
App installation
• Command line `bin/magento` tool
• GUI wizard
29
http://devdocs.magento.com/guides/v2.0/install-gde/continue.html
30. Fundamentals of Extending Magento 2 @blackbooker / #phpworld
Installing from GitHub
Used to contribute back to core via PRs
Sample data may still be installed, but messier
30
32. Fundamentals of Extending Magento 2 @blackbooker / #phpworld
Installing via Composer
Use of meta-packages provide you more control
Clear separation between custom / vendor code
Sample data is a snap to install
Best method to use for site builds and other projects
32
33. @blackbooker / #phpworldFundamentals of Extending Magento 2
Installing via Composer
$ cd /sites
$ composer create-project --repository-url=https://repo.magento.com/
magento/project-community-edition m2.demo
$ cd m2.demo
$ chmod +x bin/magento
$ bin/magento sampledata:deploy
$ composer update # this line here because bugs... fix on it's way
$ mysql -e 'create database m2_demo'
$ bin/magento setup:install --base-url=http://m2.demo --backend-frontname=backend
--admin-user=admin --admin-firstname=Admin --admin-lastname=Admin
--admin-email=user@example.com --admin-password=A123456
--db-host=dev-db --db-user=root --db-name=m2_demo
33
bit.ly/1H8P249
34. Fundamentals of Extending Magento 2 @blackbooker / #phpworld
Installing for Shared Hosting
Tarballs for "easy" install method on shared hosting
Essentially same code produced via composer install
Can be readily used where CLI access is not to be had
After install can be maintained with composer
34
44. @blackbooker / #phpworldFundamentals of Extending Magento 2
Example Block
namespace AlgerSkeletonBlock;
use AlgerSkeletonHelperBar;
use MagentoFrameworkViewElementTemplate;
use MagentoFrameworkViewElementTemplateContext;
class Norf extends Template {
protected $bar;
public function __construct(Bar $bar, Context $context, array $data = []) {
$this->bar = $bar;
parent::__construct($context, $data);
}
public function getDrinksCallout() {
return 'Helper your self to an ' . implode(' or a ', $this->bar->getDrinks()) . '!';
}
}
44
Block/Norf.php
45. @blackbooker / #phpworldFundamentals of Extending Magento 2
Using the Block
<?xml version="1.0"?>
<page xmlns:xsi="..." xsi:noNamespaceSchemaLocation="...">
<body>
<referenceContainer name="page.top">
<block class="AlgerSkeletonBlockNorf"
template="Alger_Skeleton::banner.phtml"/>
</referenceContainer>
</body>
</page>
45
https://github.com/davidalger/phpworld-talk2
46. @blackbooker / #phpworldFundamentals of Extending Magento 2
Unit Testing
namespace AlgerSkeletonTestUnit;
use MagentoFrameworkTestFrameworkUnitHelperObjectManager;
class HelperTest extends PHPUnit_Framework_TestCase {
protected $object;
protected function setUp() {
$this->object = (new ObjectManager($this))->getObject('AlgerSkeletonHelperBar');
}
/** @dataProvider pourDrinkDataProvider */
public function testPourDrink($brew, $expectedResult) {
$this->assertSame($expectedResult, $this->object->pourDrink($brew));
}
public function pourDrinkDataProvider() {
return [['Sam', 'Adams'], ['Blue', 'Moon']];
}
}
46
https://github.com/davidalger/phpworld-talk2
47. @blackbooker / #phpworldFundamentals of Extending Magento 2
Running our Test
$ cd dev/tests/unit
$ phpunit ../../../app/code/Alger/Skeleton/
PHPUnit 4.8.5 by Sebastian Bergmann and contributors.
..
Time: 235 ms, Memory: 15.00Mb
OK (2 tests, 2 assertions)
47
50. @blackbooker / #phpworldFundamentals of Extending Magento 2
Running from Anywhere
#!/usr/bin/env bash
dir="$(pwd)"
while [[ "$dir" != "/" ]]; do
if [[ -x "$dir/bin/magento" ]]; then
"$dir/bin/magento" "$@"
exit $?
fi
dir="$(dirname "$dir")"
done
>&2 echo "Error: Failed to locate bin/magento (you probably are not inside a magento site root)"
50
bit.ly/215EOYR — /usr/local/bin/magento