Magento 2 · Console Application $ bin/magento Magento CLI version 2.0.0 Usage: command [options]...
Transcript of Magento 2 · Console Application $ bin/magento Magento CLI version 2.0.0 Usage: command [options]...
Magento 2.0
Technical Deep Dive
Magento 2
Application
EnvironmentAnton Kril
Lead Architect
@AntonKril
System Requirements
“System Requirements” section on Magento 2 Documentation Site
v1.8 + v2.2, v2.4
v3.5, v4.x
V5.6
V5.6, v5.6, v7.0.2+
v4.*V3.0
How To Get?
“Installation” section on Magento 2 Documentation Site
Console Installer
magento setup:install --<option>=<value> ... --<option>=<value>
Web Installer
app/etc/
<?phpreturn ['backend' => ['frontName' => 'admin’],'install' => [
'date' => 'Fri, 15 Jan 2016 10:48:39 +0000’],'crypt' => [
'key' => 'dd2efaadc096ace77890224257943a5c’],...
];
env.php
<?phpreturn [’modules' => [
’Magento_Store' => ’1’,’Magento_AdminNotification' => ’1’,’Magento_Directory' => ’1’,’Magento_Theme' => ’1’,...
],];
config.php
Console Application$ bin/magentoMagento CLI version 2.0.0
Usage:command [options] [arguments]
Options:--help (-h) Display this help message--quiet (-q) Do not output any message--verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug--version (-V) Display this application version--ansi Force ANSI output--no-ansi Disable ANSI output--no-interaction (-n) Do not ask any interactive question
Available commands:help Displays help for a commandlist Lists commands
adminadmin:user:create Creates an administratoradmin:user:unlock Unlock Admin Account
cachecache:clean Cleans cache type(s)cache:disable Disables cache type(s)cache:enable Enables cache type(s)cache:flush Flushes cache storage used by cache type(s)cache:status Checks cache status
catalogcatalog:images:resize Creates resized product imagescatalog:product:attributes:cleanup Removes unused product attributes.
...
Application Modes
Default Developer Production
Error Output +
Automatic Code Generation + +
Class Definitions reflection-based reflection-based
requires compilation
Automatic Static File Materialization + ++ requires publication
Page Cache Debugging Info +
Config File Validation +
Automatic Theme Registration + +
> bin\magento deploy:mode:set
Code Generation
• /var/generation folder
• Infrastructure classes
– Factories (‘Magento\Catalog\Model\ProductFactory’)
– Proxies (‘Magento\Framework\Event\Config\Proxy’)
– Interceptors (‘Magento\Framework\Event\Config\Interceptor’)
– Extension Attribute Interfaces
Built-in Client-side Grunt
• Oyejorge PHP library
• ~40 seconds to compile
CSS
• Manual actions to re-
compile
• less.js official script• ~10 seconds to compile CSS• No actions to re-compile
• Command line script
• ~7 seconds to compile CSS
• Automatic browser refresh on
change in LESS
LESS Pre-Processing
Advanced DB Deployment
Slave DBs
Checkout DB OMS DBMain DBNDB cluster NDB cluster
Product merchandizing Storefront Checkout Order management system
Versioning
• Semantic Versioning (http://semver.org)
• One exception: minor release bumps minor versions of all modules
• Extension developers should depend on MajorVer.*.*
2.0.0 2.0.1 2.1.0 2.2.0
Magento_Catalog 100.0.0 100.0.1 100.1.0 101.0.0
Magento_Sales 100.0.0 100.0.0 100.1.0 101.2.0
Documentation
• http://devdocs.magento.com
• http://alankent.me
• https://github.com/magento/magento2
• https://community.magento.com
• http://magento.stackexchange.com
• https://github.com/magento/magento2-samples
Minimal module, Theme, Page, Interception, etc.
My New Slide
Max YekaterynenkoHead of Magento 2 Development
@maksek_ua
Magento 2.0 & Quality
Magento 2 Platform Goals
M2
Modern Tech Stack
Improved Performance &
Scalability
StreamlineCustomization
Simplify ExternalIntegrations
Easier installation & upgrades
High code quality
& testing
Code Quality & Testing
Merchant Extension developer
System Integrator Magento Commerce
“For the first time, testing was fun”
Acceptance
Functional
Performance
Static
Integration & API
Unit
Test types in Magento 2
Unit Test
• Isolated
• Fast
• Mocks, Stubs, Doubles
• Distributed with Module
• PhpUnit https://phpunit.de/
Integration and API
• “Black-box”
• Integration Framework >dev/tests/integration/framework
• Not fast
• PhpUnit
Integration and API
Unit vs Integration
Static
• PHPMD
• PHPCS
• PHPCPD
• Magento-specific integrity tests
• >dev/tests/static/
Performance
• JMeter
• End-To-End Scenarios
Magento Testing Framework
• End user experience testing
• >dev/tests/functional/
• Selenium Webdriver (+Grid)
• Slow, very slow
Magento Testing Framework
Magento Testing Framework
Magento 2 Quality
Unit Tests Integration Web API Functional
16000+ CE4000+ EE
>35%
3200+ CE
400+ EE
640+ CE
50+ EE
300+ scenarios
1000 documented
Magento 2 Quality Stack
GitHub
Code Review
Bamboo
Bamboo
Acceptance Cycle
Travis-CI
Code Quality & Testing
Merchant Extension developer
System Integrator Magento Commerce
Thank you!
Q&A
Anton Kril & Max Yekaterynenko
maksek_ua