Se ha denunciado esta presentación.
Se está descargando tu SlideShare. ×

Zepplin_Pronko_Magento_Festival Hall 1_Final

Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Próximo SlideShare
Magento 2 Design Patterns
Magento 2 Design Patterns
Cargando en…3
×

Eche un vistazo a continuación

1 de 46 Anuncio

Más Contenido Relacionado

Presentaciones para usted (20)

A los espectadores también les gustó (20)

Anuncio

Similares a Zepplin_Pronko_Magento_Festival Hall 1_Final (20)

Anuncio

Zepplin_Pronko_Magento_Festival Hall 1_Final

  1. 1. Legal Notice Copyright © 2014 Magento, Inc. All Rights Reserved. Magento®, eBay Enterprise™ and their respective logos are trademarks, service marks, registered trademarks, or registered service marks of eBay, Inc. or its subsidiaries. Other trademarks or service marks contained in this presentation are the property of the respective companies with which they are associated. This presentation is for informational and discussion purposes only and should not be construed as a commitment of Magento, Inc. or GSI Commerce, Inc. d/b/a eBay Enterprise (“eBay Enterprise”) or of any of their subsidiaries or affiliates. While we attempt to ensure the accuracy, completeness and adequacy of this presentation, neither Magento, Inc., eBay Enterprise nor any of their subsidiaries or affiliates are responsible for any errors or will be liable for the use of, or reliance upon, this presentation or any of the information contained in it. Unauthorized use, disclosure or dissemination of this information is expressly prohibited.
  2. 2. Magento 2 Development Practices: Rolling up the Sleeves
  3. 3. Ben Marks Magento Evangelist
  4. 4. Magento 2 Platform Goals
  5. 5. Magento 2 Platform Goals •  Update Technology Stack •  Streamline Customization Process •  Enable Easier Upgrades •  Improve Performance and Scalability •  Maintain High Quality •  Closely Engage with Community
  6. 6. Max Pronko Engineering Manager Commerce Services, Magento
  7. 7. A Day with Magento Team
  8. 8. Today’s Agenda 1.  Magento 2 Installation 2.  Building an Extension 3.  Contribution to Magento 2
  9. 9. Magento 2 Installation1
  10. 10. First you need to know… Technology Stack 5.4+ 5.1+ 2.2+ 3.7+
  11. 11. Technology Stack - Client Side user  interface  
  12. 12. Get latest Magento 2 git  clone  https://github.com/magento/magento2   magento/magento2
  13. 13. Before you install… 1.  local.xml file shouldn’t exist 2.  Writable directories: –  pub/media   –  pub/static   –  var   3.  Create database $  mysql>  create  database  magento2;  
  14. 14. Magento 2 Installation Wizard
  15. 15. Magento 2 Installation Tool <magento>/dev/shell/install.php   Install Application example: $  php  -­‐f  install.php  -­‐-­‐  [-­‐-­‐<install_option_name>  <option_value>,  ...]   Uninstall Application example: $  php  -­‐f  install.php  -­‐-­‐  -­‐-­‐uninstall   Display Available install options: $  php  -­‐f  install.php  -­‐-­‐  -­‐-­‐show_install_options  
  16. 16. Building an Extension2
  17. 17. Your Development Environment •  Xdebug PHP extension: –  stack and function traces in error messages –  memory allocation –  code coverage analysis –  … and more •  Apache mod_env module
  18. 18. Your Development Environment •  Developer mode •  Magento Profiler (csv, firebug, html) <VirtualHost  *:80>      SetEnv  MAGE_MODE  "developer"      SetEnv  MAGE_PROFILER  “firebug"     </VirtualHost>   <magento>/.htaccess  file  
  19. 19. Application Mode Default Developer Production •  Not optimized •  Static files materialization •  Errors in var/report •  Exception is displayed in output •  System logging •  Optimized •  Disabled fallback mechanism for view files •  Errors in var/report
  20. 20. Magento 2 Coding Standards PHP •  PSRs •  Zend Framework •  PHPMD and PMD JavaScript •  Google JavaScript Style Guide
  21. 21. PHP Standard Recommendation PSR-0: Autoloader Standard PSR-1: Basic Coding Standard PSR-2: Coding Style •  Top level namespace “Vendor Name” •  Lower and upper cases for names •  File <?php or <?= tags only •  UTF-8 for PHP code •  StudlyCaps class names •  UPPER_CASE constants •  camelCase method names •  Spaces •  Line length •  Opening braces •  Method and properties visibility •  Opening parenthesis
  22. 22. PSR-0: Autoloader Standard lib/Magento/Framework/Code/Minifier.php   namespace  MagentoFrameworkCode;     use  MagentoFrameworkFilesystemDirectoryRead;     class  Minifier   {          //some  code   }   1   2   3   4   5   6   7   8  
  23. 23. PSR-1 and PSR-2 namespace  MagentoFrameworkApp;     class  Area  implements  AreaInterface   {          const  AREA_FRONTEND  =  ‘frontend’;            public  function  detectDesign($request  =  null)    {      if  ($this-­‐>_code  ==  self::AREA_FRONTEND)  {        $isDesignException  =  $request  &&  $this-­‐>_apply($request);        if  ($isDesignException)  {          $this-­‐>_design-­‐>loadChange(            $this-­‐>_scopeResolver-­‐>getScope()-­‐>getId()          );          }      }    }   }   1   2   3   4   5   6   7   8   9   10   11   12   13   14   15   16   17   18  
  24. 24. Documentation Blocks Coding Standard http://www.phpdoc.org Magento Coding Standard for Documentation Blocks Developer's Guide / Coding Standards /** * Short description * * @param string $argument * @return bool * @link http://example.com */
  25. 25. Magento 2 Product Documentation Guides Product Updates Webinars Backwards Incompatible Changes http://wiki.magento.com
  26. 26. Going to Production?3
  27. 27. We are going to production Testing Deployment Preparation Production Mode
  28. 28. Available Tests TestsUnit Integration JavaScript Performance Static Code Analysis Integrity, Legacy Functional
  29. 29. Running tests •  Bulk run     •  Test suite $  php  -­‐f  dev/tools/tests.php  -­‐-­‐  type::all   $  phpunit  dev/tests/<test_type>/  testsuite  
  30. 30. Running tests in IDE
  31. 31. Functional Tests •  Requirements –  Selenium WebDriver –  Magento Testing Framework (MTF) •  Install MTF with composer •  Run tests
  32. 32. Magento Testing Framework git  clone  https://github.com/magento/mtf   Magento Testing Framework Guidelines Developer's Guide / Testing magento/mtf
  33. 33. Pre-deployment Tools
  34. 34. Internalization – I18n Tool 2 columns CSV-file example "Add to Cart","Zum Warenkobrn hinzufügen" "Add to Compare","Hinzufügen um zu vergleichen" Files location <magento>/app/code/Magento/Checkout/i18n/pt_BR.csv   <magento>/app/design/frontend/magento_demo/i18n/pt_BR.csv   <magento>/dev/tools/Magento/Tools/I18n/  
  35. 35. Internalization – I18n Tool Recover phrases from source code $  php  –f  generator.php  -­‐-­‐  -­‐d  page/to/Magento/source/code  >   generated.csv   <magento>/dev/tools/Magento/Tools/I18n/   $  php  -­‐f  pack.php  -­‐-­‐  -­‐l  de_DE  -­‐p  /path/to/target/directory  -­‐s   generated.csv   Result: de_DE.csv Create language package
  36. 36. Definition Compilation Tool Generate Factories Proxies Interceptors Compile Plugin Definitions Class Inheritance $  php  compiler.php  -­‐-­‐  -­‐-­‐help   <magento>/dev/tools/Magento/Tools/Di/  
  37. 37. View Files Deployment Tool •  Templates •  Locale files •  Static files Library Modules Themes adminhtml frontend install System View Files pub/static directory Materializes $  php  deploy.php  -­‐-­‐  -­‐-­‐help   <magento>/dev/tools/Magento/Tools/View/  
  38. 38. Class Map Generator Tool Class Map Generators Log-based File system-based array('MagentoClass'  =>  'app/code/Magento/Class.php')   <magento>/var/classmap.ser   $  php  -­‐f  fs_generator.php  ./app  >  ./var/classmap.ser   <magento>/dev/tools/Magento/Tools/classmap/   Generate class map command example:
  39. 39. Contribution to Magento 24
  40. 40. M2 Public GitHub Repository Status Pull requests 159 Issues 257 Processed, overall Average, month 12+
  41. 41. Verify changes with Travis CI magento/magento2
  42. 42. Contribution to Magento 2 FUN. EASY TO CUSTOMIZE. BEING INVOLVED IN… PLATFORM THAT GROWS
  43. 43. Links https://wiki.magento.com/display/MAGE2DOC https://github.com/magento https://travis-ci.org/magento/magento2
  44. 44. Thank you Q&A mpronko@ebay.comMax Pronko bemarks@ebay.comBen Marks

×