PhpStorm: Tips & Tricks
• Scopes: фокусируемся на важном
• Улучшеная инспекция: статический анализ в реальном времени
• Внешние утилиты и быстрые списки
• CLI утилиты. bin/magento становится ближе
The document discusses using Composer and modules to better organize Magento projects. It recommends:
- Using Composer to install Magento core and modules separately from the project codebase.
- Treating modules as independent, reusable components with their own versioning and maintenance.
- Allowing multiple teams to collaborate on developing the same module for different projects.
- Managing module versions and dependencies flexibly between projects through Composer.
This document provides instructions for setting up and configuring the PhpStorm IDE. PhpStorm is a paid IDE that also offers trial and EAP (Early Access Program) versions. The document discusses downloading and installing PhpStorm, setting IDE preferences like toggling the sidebar and word wrap, installing themes, and using features like navigation, documentation, code completion and live templates.
The Render API in Drupal 7 provides a system for rendering structured data arrays into output like HTML. It is an improved version of the Forms API rendering that uses drupal_render() to generate nearly all page output from render arrays. Render arrays allow elements and pages to be assembled, altered, and cached flexibly through a consistent rendering process. Themes can also interact with render arrays to style output without modifying module code.
The document discusses using Composer and modules to better organize Magento projects. It recommends:
- Using Composer to install Magento core and modules separately from the project codebase.
- Treating modules as independent, reusable components with their own versioning and maintenance.
- Allowing multiple teams to collaborate on developing the same module for different projects.
- Managing module versions and dependencies flexibly between projects through Composer.
This document provides instructions for setting up and configuring the PhpStorm IDE. PhpStorm is a paid IDE that also offers trial and EAP (Early Access Program) versions. The document discusses downloading and installing PhpStorm, setting IDE preferences like toggling the sidebar and word wrap, installing themes, and using features like navigation, documentation, code completion and live templates.
The Render API in Drupal 7 provides a system for rendering structured data arrays into output like HTML. It is an improved version of the Forms API rendering that uses drupal_render() to generate nearly all page output from render arrays. Render arrays allow elements and pages to be assembled, altered, and cached flexibly through a consistent rendering process. Themes can also interact with render arrays to style output without modifying module code.
Phpstorm & Drupal presentation from DrupalCamp NW 2013ixisit
In November 2013 I was lucky enough to be offered the chance to present a session at DrupalCamp NW on why it's time for Drupal developers to be using a proper IDE. The session used JetBrains PhpStorm as an example, but presented the case including other popular IDEs like Eclipse and NetBeans as well.
The document discusses Magento 2, an e-commerce platform. It highlights that Magento 2 aims to have less code in modules, true modularity, and adoption of Composer and Require.js to be simpler. To be faster, it focuses on full page caching, Varnish, and new indexing processes. To offer more features, it includes a REST API, support for LESS and jQuery, and unit tests. The document also discusses dependencies and services in Magento 2, and concludes with a demo and Q&A section.
Functional programming, though far from new, has gained much traction recently. Functional programming characteristics have started to appear in the PHP world, too. Microframeworks including Silex and Slim, middleware architectures (Stack) and even standards (PSR-7) rely on concepts such as lambdas, referential transparency and immutability, all of which come from functional programming.
I’ll give you a crash course in Erlang, a pragmatic functional language to make you feel familiar with the functional paradigm. By comparing code samples between Erlang and PHP, you’ll find out how and why you should employ functional programming in your PHP applications. You’ll see that functional programming is nothing to be scared of. On the contrary, understanding its concepts broadens your programming horizon and provides you with valuable solutions to your problems.
The document discusses changes made to the code structure and architecture of Magento. Key changes include extracting the Magento framework, splitting modules, eliminating code pools, renaming Mage to Magento, and adopting a dependency injection pattern. Unit testing and configuration via XML files are also mentioned. The changes aim to improve the code structure through separation of concerns and dependency injection.
SmartOSC provides Magento development services including building custom modules, themes, and templates. They have experience developing Magento sites since 2008 and serve customers globally. Their developers are experienced with Magento, LAMP stacks, and agile processes. They offer reliable and affordable services through hourly rates or dedicated development teams.
Top 5 magento secure coding best practices Alex ZarichnyiMagento Dev
This document discusses the top 5 Magento secure coding best practices:
1. Validate all input as strictly as possible using whitelist validation and built-in validators.
2. Use parameterized queries to prevent SQL injection instead of concatenating variables into queries.
3. Escape all user input on both the frontend and backend to prevent XSS attacks.
4. Use CSRF tokens on forms to prevent cross-site request forgery attacks.
5. Add security headers to responses to enable protections like XSS filtering and preventing clickjacking.
This document discusses Magento's commerce platform and new features. It highlights Magento 2 as a next generation platform with improved performance, architecture, and business tools. Magento provides ecommerce solutions for retailers and its ecosystem includes thousands of developers, partners and customers. The platform is equipped to help businesses address trends in analytics, payments and commerce.
Rock-solid Magento Development and Deployment WorkflowsAOE
This document discusses continuous integration and delivery best practices for a Magento project. It covers topics like version control, code reviews, static analysis, testing at different stages (unit, integration, acceptance), and continuous deployment to staging and production. The goal is to establish a robust pipeline to ensure code quality and prevent defects from making it to production.
Introduction to setting up an online shop using the Magento eCommerce platform. Contains some quotes from "Mastering Magento", available at
http://goo.gl/dsdEE .
A Successful Magento Project From Design to DeploymentJoshua Warren
Magento is a complex open source eCommerce platform. It’s open source nature and welcoming community means anyone can pick it up, learn it and launch it. After working on over 300 different Magento sites in the past 6 years, however, I’ve learned that many of the misconceptions about Magento - it’s slow, hard to work with, buggy or unstable come from projects that were built by first-timers who weren’t aware of Magento best practices. In this tutorial, I walk you through the entire process of creating, testing and deploying a high-performing, fast Magento-based eCommerce website.
In this session we show how to organize Magento projects using Version control and how to have a full development and deployment process in place to assure highest quality with many developers involved and teams spread over different continents. This talk covers how to run a continuous integration pipeline that takes care of testing various aspects of the webshop (unit tests, acceptance tests, performance test,…). Covers: Continuous integration, automation, Vagrant/Chef, Testing pipeline, unit/acceptance/performance tests, monitoring, deployment workflows, development best practices
VueJS is a progressive framework for building user interfaces. It introduces key concepts like the MVVM pattern, reactivity system, lifecycle hooks and components. The document discusses various aspects of VueJS including using .vue files with different languages for templates, styles and scripts. It also covers Vuex for state management, Vue Router for routing, VueStrap for Bootstrap components, and integrating JWT authentication with Auth0.
Everyone must migrate to PHP 7! Take advantage of exceptional performance improvements, cut your hardware use in half and enjoy the best of PHP. This workshop is for everyone that is still eyeing PHP 7 while still using PHP 5, and wants to review their 1 million LOC project before jumping to PHP 7. When migrating, we need to check old code and target only the interesting issues. This session will connect the backward incompatibilities and new features to their actual location in the code, relying on static analysis to quickly process a large code base. Based on our accumulated experience and tools, we'll review the issues, diagnose criticality, select the best fixes and prioritize the tasks. All tools are Open Source, and ready to be integrated into your project lifecycle.
Improvement of PHP code quality (by Alexander Makhomet) - Web Back-End Tech H...Innovecs
On Saturday, 12 of April, regular quarterly meeting of Tech Hangout Community took place in Creative Space 12, the cultural and educational center based in Kiev! The event was held under the motto «One day of inspiring talks on Web Back-End». This time Python, Ruby and PHP developers gathered to make peace and learn the Force.
*TECH HANGOUT COMMUNITY was found in 2012 by the developers for the developers for knowledge and experience sharing. Such meetings are the part of Innovecs Educational Project that actively develops sphere of internal trainings and knowledge exchange program among professionals. This Initiative was born within the walls of Innovecs and has proved to be extremely popular and high-demand. In a short period of time it gained its own Facebook group with more than 90 members, blog with more than 40 posts and constant quarterly external meeting of Tech hangout community with more than 80 participants. The concept of the event proposes a 30-minute report on the topic previously defined, and the discussion in a roundtable session format.
Join to discuss - https://www.facebook.com/groups/techhangout/
Ігор Карпиленко — PHPStorm for drupal developerLEDC 2016
Розгляд та аналіз інфструментів PHPStorm для drupal розробника: QA tools, Xdebug, Issue Tracking System, Drush, інструменти для роботи з Vagrant, Docker і базами даних. Корисні плагіни.
Phpstorm & Drupal presentation from DrupalCamp NW 2013ixisit
In November 2013 I was lucky enough to be offered the chance to present a session at DrupalCamp NW on why it's time for Drupal developers to be using a proper IDE. The session used JetBrains PhpStorm as an example, but presented the case including other popular IDEs like Eclipse and NetBeans as well.
The document discusses Magento 2, an e-commerce platform. It highlights that Magento 2 aims to have less code in modules, true modularity, and adoption of Composer and Require.js to be simpler. To be faster, it focuses on full page caching, Varnish, and new indexing processes. To offer more features, it includes a REST API, support for LESS and jQuery, and unit tests. The document also discusses dependencies and services in Magento 2, and concludes with a demo and Q&A section.
Functional programming, though far from new, has gained much traction recently. Functional programming characteristics have started to appear in the PHP world, too. Microframeworks including Silex and Slim, middleware architectures (Stack) and even standards (PSR-7) rely on concepts such as lambdas, referential transparency and immutability, all of which come from functional programming.
I’ll give you a crash course in Erlang, a pragmatic functional language to make you feel familiar with the functional paradigm. By comparing code samples between Erlang and PHP, you’ll find out how and why you should employ functional programming in your PHP applications. You’ll see that functional programming is nothing to be scared of. On the contrary, understanding its concepts broadens your programming horizon and provides you with valuable solutions to your problems.
The document discusses changes made to the code structure and architecture of Magento. Key changes include extracting the Magento framework, splitting modules, eliminating code pools, renaming Mage to Magento, and adopting a dependency injection pattern. Unit testing and configuration via XML files are also mentioned. The changes aim to improve the code structure through separation of concerns and dependency injection.
SmartOSC provides Magento development services including building custom modules, themes, and templates. They have experience developing Magento sites since 2008 and serve customers globally. Their developers are experienced with Magento, LAMP stacks, and agile processes. They offer reliable and affordable services through hourly rates or dedicated development teams.
Top 5 magento secure coding best practices Alex ZarichnyiMagento Dev
This document discusses the top 5 Magento secure coding best practices:
1. Validate all input as strictly as possible using whitelist validation and built-in validators.
2. Use parameterized queries to prevent SQL injection instead of concatenating variables into queries.
3. Escape all user input on both the frontend and backend to prevent XSS attacks.
4. Use CSRF tokens on forms to prevent cross-site request forgery attacks.
5. Add security headers to responses to enable protections like XSS filtering and preventing clickjacking.
This document discusses Magento's commerce platform and new features. It highlights Magento 2 as a next generation platform with improved performance, architecture, and business tools. Magento provides ecommerce solutions for retailers and its ecosystem includes thousands of developers, partners and customers. The platform is equipped to help businesses address trends in analytics, payments and commerce.
Rock-solid Magento Development and Deployment WorkflowsAOE
This document discusses continuous integration and delivery best practices for a Magento project. It covers topics like version control, code reviews, static analysis, testing at different stages (unit, integration, acceptance), and continuous deployment to staging and production. The goal is to establish a robust pipeline to ensure code quality and prevent defects from making it to production.
Introduction to setting up an online shop using the Magento eCommerce platform. Contains some quotes from "Mastering Magento", available at
http://goo.gl/dsdEE .
A Successful Magento Project From Design to DeploymentJoshua Warren
Magento is a complex open source eCommerce platform. It’s open source nature and welcoming community means anyone can pick it up, learn it and launch it. After working on over 300 different Magento sites in the past 6 years, however, I’ve learned that many of the misconceptions about Magento - it’s slow, hard to work with, buggy or unstable come from projects that were built by first-timers who weren’t aware of Magento best practices. In this tutorial, I walk you through the entire process of creating, testing and deploying a high-performing, fast Magento-based eCommerce website.
In this session we show how to organize Magento projects using Version control and how to have a full development and deployment process in place to assure highest quality with many developers involved and teams spread over different continents. This talk covers how to run a continuous integration pipeline that takes care of testing various aspects of the webshop (unit tests, acceptance tests, performance test,…). Covers: Continuous integration, automation, Vagrant/Chef, Testing pipeline, unit/acceptance/performance tests, monitoring, deployment workflows, development best practices
VueJS is a progressive framework for building user interfaces. It introduces key concepts like the MVVM pattern, reactivity system, lifecycle hooks and components. The document discusses various aspects of VueJS including using .vue files with different languages for templates, styles and scripts. It also covers Vuex for state management, Vue Router for routing, VueStrap for Bootstrap components, and integrating JWT authentication with Auth0.
Everyone must migrate to PHP 7! Take advantage of exceptional performance improvements, cut your hardware use in half and enjoy the best of PHP. This workshop is for everyone that is still eyeing PHP 7 while still using PHP 5, and wants to review their 1 million LOC project before jumping to PHP 7. When migrating, we need to check old code and target only the interesting issues. This session will connect the backward incompatibilities and new features to their actual location in the code, relying on static analysis to quickly process a large code base. Based on our accumulated experience and tools, we'll review the issues, diagnose criticality, select the best fixes and prioritize the tasks. All tools are Open Source, and ready to be integrated into your project lifecycle.
Improvement of PHP code quality (by Alexander Makhomet) - Web Back-End Tech H...Innovecs
On Saturday, 12 of April, regular quarterly meeting of Tech Hangout Community took place in Creative Space 12, the cultural and educational center based in Kiev! The event was held under the motto «One day of inspiring talks on Web Back-End». This time Python, Ruby and PHP developers gathered to make peace and learn the Force.
*TECH HANGOUT COMMUNITY was found in 2012 by the developers for the developers for knowledge and experience sharing. Such meetings are the part of Innovecs Educational Project that actively develops sphere of internal trainings and knowledge exchange program among professionals. This Initiative was born within the walls of Innovecs and has proved to be extremely popular and high-demand. In a short period of time it gained its own Facebook group with more than 90 members, blog with more than 40 posts and constant quarterly external meeting of Tech hangout community with more than 80 participants. The concept of the event proposes a 30-minute report on the topic previously defined, and the discussion in a roundtable session format.
Join to discuss - https://www.facebook.com/groups/techhangout/
Ігор Карпиленко — PHPStorm for drupal developerLEDC 2016
Розгляд та аналіз інфструментів PHPStorm для drupal розробника: QA tools, Xdebug, Issue Tracking System, Drush, інструменти для роботи з Vagrant, Docker і базами даних. Корисні плагіни.
Рано или поздно возникает необходимость в собственных инструментах по разным причинам: либо не хватает готовых, либо есть какая-то особенность в проекте. Разработка инструментов, работающих в браузере, является непростой задачей. Самое сложное — чтобы они умели работать удаленно, вне страницы. Это многих пугает — нужно много сделать и во многом разобраться. Но если большая часть проблем уже решена, и можно сосредоточиться лишь на основной функции инструмента? Что если такие инструменты смогут работать в произвольном WebView, будь оно встроено в браузер, редактор или другое приложение на любом устройстве? Доклад про удалённые инструменты: какие есть сложности и как их обойти, как перестать бояться и начать делать инструменты под свои задачи и технологический стек.
Юрий Василевский «Автоматизация в XCode»
Yandex Mobile Camp в Санкт-Петербурге 2012
http://events.yandex.ru/events/yamobcamp/spb-may-2012/
Xcode — основной инструментарий разработки приложений под Mac OS X и Apple iOS. Он обладает широкими возможностями как для редактирования кода, так и для автоматизации задач. Мы обсудим некоторые из аспектов автоматизации (Code Sense, Targets, Services, Help), связанные с нумерацией сборок билдов, форматированием и контролем стиля кода, анализом дублированных участков кода, управлением внешними библиотеками.
Yandex Mobile Camp в Санкт-Петербурге, 30 мая 2012
Юрий Василевский, ведущий разработчик EPAM Systems, Mobile Solutions
Тема: Автоматизация в XCode
Тезисы:
Xcode — основной инструментарий разработки приложений под Mac OS X и Apple iOS. Он обладает широкими возможностями как для редактирования кода, так и для автоматизации задач.
Мы рассмотрим некоторые из аспектов автоматизации (Code Sense, Targets, Services, Help), связанные с нумерацией сборок билдов, форматированием и контролем стиля кода, анализом дублированных участков кода, управлением внешними библиотеками.
The document discusses Magento 2's front-end architecture and how to create themes. It covers Magento 2's goals of improving performance, making upgrades easier, and using high-quality code. It also discusses how consumers use multiple devices for purchases and how to get started with Magento 2 on GitHub. The document then provides instructions on how to create a theme by defining its configuration file and structure, working with CSS by extending and overriding styles, manipulating layout using XML, and overriding templates.
The document discusses importing a large number of entities (~1 million) into an EAV (Entity-Attribute-Value) database model. Standard row-by-row imports do not scale well for large amounts of data due to validation overhead. The proposed solution is to use bulk loading via MySQL's "LOAD DATA INFILE" command to minimize validation and import the data in bulk. This improves performance significantly but reduces data integrity checks. Some techniques like pre-processing and post-processing are discussed to balance integrity and performance for unpredictable data sources. Test results show substantial speed improvements for bulk loading large amounts of data.
The document discusses Gearman, an open source software framework for distributing tasks across multiple machines. It describes how Gearman allows for asynchronous task processing by queuing jobs on a central job server that workers on other machines can pick up. The key advantages of Gearman include high performance, scalability, load balancing, and the ability to perform tasks asynchronously and in parallel. The document also provides code examples of how to use the Gearman PHP client and worker APIs to process jobs. It discusses challenges like handling task failures and explores ways to retry failed tasks, such as by scheduling suspended jobs to be executed again at increasing time intervals.
2. Scopes
Scope – это набор файлов с которыми можно проделывать разные операции,
а именно:
Навигация
Поиск использований
Инспекция кода
Цветовое отображение в режиме дебага
Settings | Appearance and Behavior | Scopes
Ctrl + Alt + Shift + F7 - Find Usages Settings, Edit | Find
3.
4.
5.
6. Code Sniffer, Mess Detector
Утилиты статического анализа кода
Code Sniffer – инструмент для обнаружения исправления нарушений
определенных стандартов оформления кода
Mess Detector – user-friendly обертка для получения метрик измеряемых
PHP Depend. Анализирует код на:
Возможные баги
Неоптимальный код
Чрезмерно усложненные выражения
Неиспользуемые параметры, методы, свойства
Settings | Languages & Frameworks | PHP | Code Sniffer, Mess Detector
Совет: Обратить внимание на плагин
Php Inspections (EA Extended)
7. Code Sniffer, Mess Detector
Утилиты статического анализа кода
Для включения инспекции кода Magento2 с использованием Code Sniffer и
Mess Detector необходимо выполнить следующее:
Composer Install/Update (обе библиотеки прописаны "require-dev")
В Settings | Languages & Frameworks | PHP | Code Sniffer, Mess Detector
создать конфигурацию указав пути к исполняемым файлам утилит:
/vendor/bin/phpmd.bat и /vendor/bin/phpcs.bat соответственно
В Settings | Editor | Inspections | PHP включить чекбоксы для обеих
утилит
Settings | Languages & Frameworks | PHP | Code Sniffer, Mess Detector
8.
9.
10. External Tools
External Tools – это отдельные CLI приложения: генераторы кода,
анализаторы, пре- и постпроцессоры, утилиты базы данных и т.д.
Как параметр можно передавать контекстную информацию (путь текущего
файла, путь текущего проекта), отображать вывод командной строки и
т.д.
Доступ к утилитам можно получить через меню Tools и контекстное меню;
можно назначить горячую клавишу.
Settings | Tools | External Tools
11.
12.
13. Quick Lists
Quick List – это всплывающее меню сконфигурированных пользователем
команд, доступное по горячей клавише или комбинации клавиш.
Команды External Tools могут быть объединены в Quick List:
Создать команду в External Tools: Settings | Tools | External Tools
Создать Quick List в Settings | Appearance and Behavior | Quick Lists
Назначить Quick List горячую клавишу в Settings | Keymap
Settings | Appearance and Behavior | Quick Lists
14.
15.
16. Scratches
Scratch – это временный файл-черновик для редактирования текста или
кода, выполнения операций поиска, исследовательских целей и т.д.
В PhpStorm доступны два вида черновиков:
Scratch files – полнофункциональные файлы с возможностью выполнения
и дебага
Scratch buffers – простые .txt файлы предназначенные исключительно
для текста
Settings | Appearance and Behavior | Quick Lists
Ctrl + Shift + Alt + Insert
Ctrl + Shift + A, New Scratch Buffer
17. Command Line Tool Support
PHP-специфичные и PHP-агностические CLI команды доступные через удобный
интерфейс PhpStorm.
Для интеграции команды bin/magento выполнить:
Открыть Settings | Tools | Command Line Tool Support
Add new tool, Custom tool
Tool path: $PhpExecutable$ $ProjectFileDir$/bin/magento, Alias: m
После создания команды, выбрать, - нажать “Open definition in editor”, и
заменить контент файла на gist: https://gist.github.com/ygrigoriev/56811dc64e296b8fb3a1ca7b52df630b
Settings | Tools | Command Line Tool Support
Ctrl + Shift + X -
Command Line Tool Console