In agile world when requirements changes faster than tasks got "done" status, we forced to make fast solutions that will work here and now. Being under pressure and in strict dead lines it easy to ignore code standards, "drupal way", and best practices that could be found in top Drupal sites. Tools and tips to keep your code clean.
https://drupalcampkyiv.org/node/37
Con la versione 7 di Drupal è stato introdotto il concetto di Entity, poi evoluto con la versione 8, utilizzato come base di buona parte degli elementi core (nodi, tassonomie, utenti, ...), ma - soprattutto - è stata data la possibilità di costruire entity custom. L'utilizzo di queste apre le possibilità di personalizzazione dello strumento ad un livello superiore velocizzando notevolmente lo sviluppo.
Verranno mostrate le potenzialità nell'uso delle Entity custom e le integrazioni possibili.
Your code sucks, let's fix it - PHP Master Series 2012Rafael Dohms
Performance and testing are just one aspect of code, to really be successful your code needs to be readable, maintainable and generally easier to comprehend and work with. This talk draws from my own experience in applying the techniques of object calisthenics and code readability, within an existing team. It will help you identify trouble areas, learn how to refactor them and train you to write better code in future projects avoiding common pitfalls.
Con la versione 7 di Drupal è stato introdotto il concetto di Entity, poi evoluto con la versione 8, utilizzato come base di buona parte degli elementi core (nodi, tassonomie, utenti, ...), ma - soprattutto - è stata data la possibilità di costruire entity custom. L'utilizzo di queste apre le possibilità di personalizzazione dello strumento ad un livello superiore velocizzando notevolmente lo sviluppo.
Verranno mostrate le potenzialità nell'uso delle Entity custom e le integrazioni possibili.
Your code sucks, let's fix it - PHP Master Series 2012Rafael Dohms
Performance and testing are just one aspect of code, to really be successful your code needs to be readable, maintainable and generally easier to comprehend and work with. This talk draws from my own experience in applying the techniques of object calisthenics and code readability, within an existing team. It will help you identify trouble areas, learn how to refactor them and train you to write better code in future projects avoiding common pitfalls.
It's back...
AND it's better than ever, DBTNG (Database: The Next Generation) is nothing to be scared of and we'll show how easy it is to create both static and dynamic query statements for use in your custom modules and Drupal 6 to Drupal 7 module migration work. In this session we'll take a look at the Drupal 7 database abstraction layer and the database API and cover:
To db_query or not to db_query?
Dynamic query syntax and fluid interfaces
Working with result sets
Joins, conditional statements, subselects and sorting with db_select
Tagging your db_select queries for hook awareness
Decorator patterns for db_select -
db_update, db_insert, db_delete and our new friend, db_merge
Explore alternatives to views and how and when to make that call.
After this session attendees will be ready for Drupal III: Drupalicon Takes Manhattan
Your code sucks, let's fix it - DPC UnConRafael Dohms
How do you measure the quality of your code? Performance and testing are just one aspect of code, in order to meet deadlines and make maintenance quicker you also need your code to be readable, decoupled and generally easier to comprehend and work with. This talk will go over tips and exercises to help you identify trouble areas, refactor them and train you to write better code in future projects. Come make your code look and function better.
With modern JavaScript frameworks like ExtJS, SproutCore or qooxdoo, it is possible to create very rich user interfaces using only open web standards. But how do they do it? How do they work internally?
In this talk I will open the thorax of a simple qooxdoo widget and look at the various layers and building blocks used to implement it. You will learn how the widget is represented in the DOM, how events are handled, and how the layout engine works. Often there is more than a single way to achieve something. In those cases the different options and qooxdoo's specific design decision will be presented.
Your code sucks, let's fix it (CakeFest2012)Rafael Dohms
How do you measure the quality of your code? Performance and testing are just one aspect of code, in order to meet deadlines and make maintenance quicker you also need your code to be readable, decoupled and generally easier to comprehend and work with. This talk will go over tips and exercises to help you identify trouble areas, refactor them and train you to write better code in future projects. Come make your code look and function better.
As presented at Dutch PHP Conference 2015, an introduction to command buses, how to implement your own in PHP and why they're both useful but unimportant.
The most hated thing a developer can imagine is writing documentation but on the other hand nothing can compare with a well documented source code if you want to change or extend some code. PhpDocumentor is one of many tools enabling you to parse the inline documentation and generate well structured and referenced documents. This tallk will show you how to get the most out of phpDocumentor and shall enable you to write fantastic documentation.
Closing keynote, as presented at Codemotion 2014, LaraconEU 2014, Redevelop 2014, CodeConnexx 2013 and PHP North East 2014.
This presentation makes a reference to a reading list I received. For those interested, the release consists of most of the general classics, such as Gang Of Four "Design Patterns", The Pragmatic Programmer, Structure and Interpretation of Computer Programs, Domain Driven Design and a few others. The actual list remains tucked away in a box somewhere.
Caching and Scaling WordPress using Fragment CachingErick Hitter
Using what I’ve learned working on the WordPress.com VIP platform, this presentation discusses caching techniques applicable to WordPress installations of almost any size.
Presented February 18, 2012 at WordCamp Miami.
Original HTML5 slides are available at http://www.ethitter.com/2012/02/caching-and-scaling-wcmia/.
Ralph Schindler (of Zend Framework) and Jon Wage (of Doctrine) presented these slides for a webinar hosted by zend.com (webinar available online).
Links are contained within the slides to the demo application that was also used during the webinar.
PT.BUZOO INDONESIA is No1 Japanese offshore development company in Indonesia.
We are professional of web solution and smartphone apps. We can support Japanese, English and Indonesia.
We are hiring now at http://buzoo.co.id/
Top Ten Reasons to Use EntityFieldQuery in DrupalFredric Mitchell
Drupal 7 introduced a great class, EntityFieldQuery (EFQ), to easily grab information from entities that was not available in Drupal 6.
This session will explore why you should be already using EFQ in your development practices. We'll also review how to use it and explore it's relationship with Drupal view modes and block entities (Beans).
This session will also explore comparisons with Views, and how EFQ should replace some of the common development practices using Views as a query tool.
EFQ Top Ten
Core
Well Documented
Simple
Consumable
Object-Oriented
Extensible
Alterable
Exception Handling
View Modes
Beans
It's back...
AND it's better than ever, DBTNG (Database: The Next Generation) is nothing to be scared of and we'll show how easy it is to create both static and dynamic query statements for use in your custom modules and Drupal 6 to Drupal 7 module migration work. In this session we'll take a look at the Drupal 7 database abstraction layer and the database API and cover:
To db_query or not to db_query?
Dynamic query syntax and fluid interfaces
Working with result sets
Joins, conditional statements, subselects and sorting with db_select
Tagging your db_select queries for hook awareness
Decorator patterns for db_select -
db_update, db_insert, db_delete and our new friend, db_merge
Explore alternatives to views and how and when to make that call.
After this session attendees will be ready for Drupal III: Drupalicon Takes Manhattan
Your code sucks, let's fix it - DPC UnConRafael Dohms
How do you measure the quality of your code? Performance and testing are just one aspect of code, in order to meet deadlines and make maintenance quicker you also need your code to be readable, decoupled and generally easier to comprehend and work with. This talk will go over tips and exercises to help you identify trouble areas, refactor them and train you to write better code in future projects. Come make your code look and function better.
With modern JavaScript frameworks like ExtJS, SproutCore or qooxdoo, it is possible to create very rich user interfaces using only open web standards. But how do they do it? How do they work internally?
In this talk I will open the thorax of a simple qooxdoo widget and look at the various layers and building blocks used to implement it. You will learn how the widget is represented in the DOM, how events are handled, and how the layout engine works. Often there is more than a single way to achieve something. In those cases the different options and qooxdoo's specific design decision will be presented.
Your code sucks, let's fix it (CakeFest2012)Rafael Dohms
How do you measure the quality of your code? Performance and testing are just one aspect of code, in order to meet deadlines and make maintenance quicker you also need your code to be readable, decoupled and generally easier to comprehend and work with. This talk will go over tips and exercises to help you identify trouble areas, refactor them and train you to write better code in future projects. Come make your code look and function better.
As presented at Dutch PHP Conference 2015, an introduction to command buses, how to implement your own in PHP and why they're both useful but unimportant.
The most hated thing a developer can imagine is writing documentation but on the other hand nothing can compare with a well documented source code if you want to change or extend some code. PhpDocumentor is one of many tools enabling you to parse the inline documentation and generate well structured and referenced documents. This tallk will show you how to get the most out of phpDocumentor and shall enable you to write fantastic documentation.
Closing keynote, as presented at Codemotion 2014, LaraconEU 2014, Redevelop 2014, CodeConnexx 2013 and PHP North East 2014.
This presentation makes a reference to a reading list I received. For those interested, the release consists of most of the general classics, such as Gang Of Four "Design Patterns", The Pragmatic Programmer, Structure and Interpretation of Computer Programs, Domain Driven Design and a few others. The actual list remains tucked away in a box somewhere.
Caching and Scaling WordPress using Fragment CachingErick Hitter
Using what I’ve learned working on the WordPress.com VIP platform, this presentation discusses caching techniques applicable to WordPress installations of almost any size.
Presented February 18, 2012 at WordCamp Miami.
Original HTML5 slides are available at http://www.ethitter.com/2012/02/caching-and-scaling-wcmia/.
Ralph Schindler (of Zend Framework) and Jon Wage (of Doctrine) presented these slides for a webinar hosted by zend.com (webinar available online).
Links are contained within the slides to the demo application that was also used during the webinar.
PT.BUZOO INDONESIA is No1 Japanese offshore development company in Indonesia.
We are professional of web solution and smartphone apps. We can support Japanese, English and Indonesia.
We are hiring now at http://buzoo.co.id/
Top Ten Reasons to Use EntityFieldQuery in DrupalFredric Mitchell
Drupal 7 introduced a great class, EntityFieldQuery (EFQ), to easily grab information from entities that was not available in Drupal 6.
This session will explore why you should be already using EFQ in your development practices. We'll also review how to use it and explore it's relationship with Drupal view modes and block entities (Beans).
This session will also explore comparisons with Views, and how EFQ should replace some of the common development practices using Views as a query tool.
EFQ Top Ten
Core
Well Documented
Simple
Consumable
Object-Oriented
Extensible
Alterable
Exception Handling
View Modes
Beans
All about web application security and common threats and how to counter measure these threats
The content of this presentation was derived from several notable Drupal SA team like Greg Knaddison, Khalid Baheyeldin, Heine Deelstra, and Dave Reid.
Special thanks to Greg's book "Cracking Drupal: A Drop in the Bucket".
Slides from a talk I gave at MongoNYC on using MongoDB with Drupal. I will most likely be doing this as a webcast and giving this presentation at Drupalcamp NYC 8 this July.
This workshop is a hands-on training where a real Zend Framework application is used as an example to start improving QA using tools to test, document and perform software metric calculations to indicate where the software can be improved. I also explain the reports produced by a CI system.
This upload requires better support for ODP formatForest Mars
I uplopaded this version in Open Office .ODP format, which is presumably the reason slideshare messed up the formatting. Slideshare, can we get some better support for open formats, stat?
If you'd like to view these slides, I've re-uploaded this talk in .ppt format.
Speed up the site building with Drupal's Bootstrap Layout BuilderDrupalCamp Kyiv
Layout Builder in Drupal 8 and 9 is a game-changer, let's maximize its efficiency with some add-ons modules and learn more about the best practices in using it with atomic design.
Watch the session recording on our Youtube channel: https://www.youtube.com/c/drupalcampkyiv
Performance Monitoring with Google LighthouseDrupalCamp Kyiv
In this session, you will learn how to track down performance and accessibility issues before they get deployed to the server.
Watch the session recording on our Youtube channel: https://www.youtube.com/c/drupalcampkyiv
Oleg Bogut - Decoupled Drupal: how to build stable solution with JSON:API, Re...DrupalCamp Kyiv
"Let's talk about Decoupled Drupal - most modern way for building websites with Drupal as web service.
The main key points are:
1. What is decoupled Drupal?
2. Decouple architecture: how and why we can use it?
3. Decoupled vs monolithic.
4. Advantages and disadvantages of decoupling.
5. Drupal web services ecosystem and JSON:API. JSON:API vs GraphQL.
6. ReactJS: how we can use it in a decoupled solution?
7. Elasticsearch as the basis for the site search system.
8. Performance tuning and caching for high-load decoupled websites.
9. Troubleshooting and use cases."
Acquia BLT for the Win, or How to speed up the project setup, development an...DrupalCamp Kyiv
Nikita Pohrebniak, Imagex
There are so many tools that can help you with every step of the development and deployment process. In this talk, we’ll explain why our company picked Acquia BLT, what it can do for you and how it can be customized to satisfy your needs.
Drupal Virtual Cafe #2, by DrupalCamp Kyiv
https://www.facebook.com/drupalcampkyiv/
Welcome “The Internet of Things” (IoT). If you have not been living in the forest last 5 years :), you might have heard this term. But if you decided to visit this DrupalCamp for the first time since you moved to the forest let’s dive into the world of IoT and at the same time look at where is Drupal in this world.
In a nutshell, the Internet of Things is the network of devices, applications, software, and many other things connected and used data to provide value to the end user.
In this session I am going to cover the following topics:
- What’s the Internet of Things?
- The Internet of Things market
- Drupal and the Internet of Things
- Examples of using the IoT in real projects
- The Future and what should we expect
In this session, I will share my experience and vision of where the IoT sphere is going and what place Drupal takes in the world of the Internet of things, and I will show you a real example of using IoT in conjunction with Drupal.
https://drupalcampkyiv.org/node/50
WHAT WE LEARNED FROM OPEN SOCIAL IN 3 YEARS, MOVING FROM AN AGENCY TO A PRODU...DrupalCamp Kyiv
This presentation will teach you the things that went well, and the things that did not go well in our journey to move our 20 people Drupal agency from a service company (bill by the hour) to a product SaaS company (bill per product, per month) called Open Social.
We will talk about funding your product, building a product, how to do marketing, sales and business development and how to grow internationally. We hope to discuss some questions as how to work with open-source and SaaS and does it help us or limit us competing with proprietary software vendors.
If you are thinking about building a product on Drupal or building a SaaS company, this is your session!
https://drupalcampkyiv.org/node/54
It is difficult to improve what is not measurable! Profiling an application should always be the first step in trying to improve its performance. With this workshop, learn how to identify performance issues in your application and adopt the best application profiling tools in your daily development habits. This workshop will guide you through the use of PHP profiling tools such as Blackfire.io to help you identify performance leaks.
Overview of the main ways to store data in Drupal 8 depending on data and needs. A detailed description of each way and examples of how to work with storages.
https://drupalcampkyiv.org/node/44
This is when things get real.
Emailing with hours for preparing replies is no more.
Now it’s you and your teammate at the table.
Face-to-face live conversation, with immediate responses on hard topics.
But you can prepare yourself.
There are checklists how to plan 1-1 meeting.
There are tricks on how to act during 1-1 meeting.
We'll discuss those.
Preliminary structure
1. Goals of 1-1 meeting
2. Preparation checklist
3. 1-1 meeting structure
4. Follow-ups
5. Tricks and obstacles: real-life examples (Drupal inclusive)
To whom it may concern
- Team leaders
- HRs
- CxOs
who host and facilitate such meetings.
https://drupalcampkyiv.org/node/49
UX DURING MODULE INSTALLATION AND CONFIGURATIONDrupalCamp Kyiv
I bet everyone in his/her life used OS Windows. There are a lot of opinions on it, but, to be honest, there is one huge advantage it has - installation wizards. Almost every programme that is being installed has some kind of interaction with end user. This gives at least the illusion of control over your system and of course it allows to have already preconfigured first time experience inside application. Some wizards give more options, some less, but it is nice to have it in the first place.
So, let's think about a Drupal user, that wants to install such a complex module like Metatags or Commerce. Although there are a lot of tutorials, documents and other help materials, there is always something that prevents end users from completing this "piece of cake" for developers task on his/her own. But all that he/she needs is only make it possible to add Metatags, let's say of OG type, to content type article.
https://drupalcampkyiv.org/node/57
SWITCHING FROM QA ENGINEER TO PROJECT MANAGER - LEVEL UP OR DOWN?DrupalCamp Kyiv
I’d like to tell my story of career path with practical advice to those who is longing the same dream. Also I’m willing to describe benefits and pitfalls of such changes.
Please see below the approximate plan of my speech:
- Brief statistics data: QAs moved to PMs. Why?
- How to start? Practical advice based on my own experience.
- Cross the Rubicon. When you need to make your decisive step.
- Small tips for stress resistance and time management.
- Negative points of being PM.
- Conclusion.
https://drupalcampkyiv.org/node/51
TECHNOLOGIES-POWERED WEB AND THE POST-BROWSER ERADrupalCamp Kyiv
Digital technologies development has been on a constant rise in the past several years. Technologies such as the blockchain, AR and VR were mere whispers at the beginning of the 21st century. Today, we see these and other technologies all around us thanks to increased computing power and visionary inventors.
How new user experiences and technologies change the way we build the web, such as machine learning, voice assistants, the blockchain, VR and AR. During this session, I would like to look into the technological history starting from the invention of the web up to the looking into the future on how our interaction with technologies will look like and how we’ll build the web in the post-browser era.
https://drupalcampkyiv.org/node/56
PROTECTED CONTENT: END-TO-END PGP ENCRYPTION FOR DRUPALDrupalCamp Kyiv
In this session I wish to explain Protected Content (just released its dev version: https://www.drupal.org/project/proc), the newest Drupal wrapper for OpenPGPjs. Luckly we will see also how to integrate its Exclusive Access Links into a content type.
https://drupalcampkyiv.org/node/83
For several years, we did numerous audits for small to big websites, small agencies and huge corporations, and always faced the same issues. What should you look for when running a website audit? What tools could help you? At which level of disaster you should advice your customer to recode entirely the website?
This session covers a methodology and set of tools to organize efficiently your Drupal websites audits
https://drupalcampkyiv.org/node/73
FROM DISTRO TO CUSTOM - HOW WE CREATE GREAT COMMUNITIES FOR EVERY ORGANIZATIO...DrupalCamp Kyiv
GoalGorilla build with Open Social one of the biggest Distributions in Drupal. This distribution builds the foundation for over 1000 communities world wide. We build ourselfs some big communities for clients like the UN, Greenpeace, the Dutch Government and others. All of this clients have a very specific profile and very specific needs. All of them are from different sectors: From NGOs, to Goverment organizations, Voluntary platforms, learning platforms and much more. As well all of our clients have at core a community the goals of the community and the key features for them to reach those goals are different every time. As much as we can rely on the distribution to cover the basics and a even more, every client is different and most bigger communities needs customizations to make the step from a good to a great community.
With every new client new challenges arise. With this talk I want to share some of the insights we gathered over the last 3 years, talk about how to navigate the pitfalls of customizing a Distribution and show how we fit different platforms to the specific requirements of different clients.
This talk is for:
- Developers who use or want to use Open Social (We will discuss some modules we use and technical choices, but it will not be primarily a technical talk)
- Professionals working with online communities
- Project managers or Designers that need to conceptualize projects that are based on a Distribution
https://drupalcampkyiv.org/node/77
SEARCH API: TIPS AND TRICKS - FROM BEGINNING TO CUSTOM SOLUTIONSDrupalCamp Kyiv
I'm planning to introduce developers with Search API system during the presentation :
- What is Search API and how to deal with it;
- Overview of the most used search backends for Search API;
- What is the difference between Drupal 7 and 8 Search API;
- Faceted and fulltext search and how to use it;
- Tips and tricks regarding customization and extending of Search API / Faceted search.
Level: from Beginners to Middle+
DEVOPS & THE DEATH AND REBIRTH OF CHILDHOOD INNOCENCEDrupalCamp Kyiv
Remember when the internet was pure and unspoiled? In our innocence we saw the promise of renewal of the world through connecting, sharing, and creating online. We became developers and hackers because we wanted to understand how things work, to take them apart, and build quirky (and sometimes useful) things just for the pleasure of it.
In the earliest decades of the Internet Epoch the Internet was a playground. We happily coded directly on production systems. And it was fine, as many Great Things were created. But the Internet has matured, and has now become Big Business. Developers have matured too, and good thing they did! So many people now rely on what we’ve built, for security, for privacy, for the paycheck at the end of the month. We matter.
Maturity has come at a price though, and deploying well tested code into complex applications with polyglot teams working with heterogeneous stacks, all while maintaining compliance with GDPR, HIPAA, PCI, etc. has taken all of the childhood innocence out of the web. Now even the simplest website seems like Hard Work.
In this talk I will show how we can, and should, regain our joyful demeanor, how we can use the maturity of the most innovative tools around us to start hacking like crazy again. Without regressing on agility, testing, compliance, scalability or robustness. I use the metaphor of childhood innocence to explain how the complexity of modern cloud computing, in combination with increasing quality expectations and compliancy, has curtailed the creative freedom of developers, and as a whole, organisational motivation.
Together with a lack of resources and idea time, this leads to lower and slower product innovation. We are, however, at the brink of a paradigm shift in cloud computing that will give developers and hackers their mojo again. This talk will zoom into the key elements of this paradigm shift, and provide an overview of the basic concepts and operational practices of the new age of developer innocence.
https://drupalcampkyiv.org/node/81
Francesca Gottschalk - How can education support child empowerment.pptxEduSkills OECD
Francesca Gottschalk from the OECD’s Centre for Educational Research and Innovation presents at the Ask an Expert Webinar: How can education support child empowerment?
A Strategic Approach: GenAI in EducationPeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
Honest Reviews of Tim Han LMA Course Program.pptxtimhan337
Personal development courses are widely available today, with each one promising life-changing outcomes. Tim Han’s Life Mastery Achievers (LMA) Course has drawn a lot of interest. In addition to offering my frank assessment of Success Insider’s LMA Course, this piece examines the course’s effects via a variety of Tim Han LMA course reviews and Success Insider comments.
Read| The latest issue of The Challenger is here! We are thrilled to announce that our school paper has qualified for the NATIONAL SCHOOLS PRESS CONFERENCE (NSPC) 2024. Thank you for your unwavering support and trust. Dive into the stories that made us stand out!
Palestine last event orientationfvgnh .pptxRaedMohamed3
An EFL lesson about the current events in Palestine. It is intended to be for intermediate students who wish to increase their listening skills through a short lesson in power point.
Acetabularia Information For Class 9 .docxvaibhavrinwa19
Acetabularia acetabulum is a single-celled green alga that in its vegetative state is morphologically differentiated into a basal rhizoid and an axially elongated stalk, which bears whorls of branching hairs. The single diploid nucleus resides in the rhizoid.
Synthetic Fiber Construction in lab .pptxPavel ( NSTU)
Synthetic fiber production is a fascinating and complex field that blends chemistry, engineering, and environmental science. By understanding these aspects, students can gain a comprehensive view of synthetic fiber production, its impact on society and the environment, and the potential for future innovations. Synthetic fibers play a crucial role in modern society, impacting various aspects of daily life, industry, and the environment. ynthetic fibers are integral to modern life, offering a range of benefits from cost-effectiveness and versatility to innovative applications and performance characteristics. While they pose environmental challenges, ongoing research and development aim to create more sustainable and eco-friendly alternatives. Understanding the importance of synthetic fibers helps in appreciating their role in the economy, industry, and daily life, while also emphasizing the need for sustainable practices and innovation.
The French Revolution, which began in 1789, was a period of radical social and political upheaval in France. It marked the decline of absolute monarchies, the rise of secular and democratic republics, and the eventual rise of Napoleon Bonaparte. This revolutionary period is crucial in understanding the transition from feudalism to modernity in Europe.
For more information, visit-www.vavaclasses.com
The French Revolution Class 9 Study Material pdf free download
ONE MORE TIME ABOUT CODE STANDARDS AND BEST PRACTICES
1. One more time about code
standards and best practices
Iryna Vedkal
2. Why do we need to follow?
What does mean good code quality?
● Readability
● Maintainability
● Security
● Find errors more easily
● Common development way
● Less codebase
● Less bugs
● Better organized code
3. Common rules for Drupal development
● Follow code standards
● Everything should be in code
● Use configuration before code
● Use contrib before custom
● Never hack core or contrib
● Avoid too many modules (keep balance between module quantity and size)
● Keep business logic separate from template layer
4.
5. Steps to setup working environment
❏ Setup Code Sniffer - https://www.drupal.org/docs/8/modules/code-review-module/installing-coder-sniffer
❏ Install Coder - https://www.drupal.org/project/coder
❏ Setup pre-commit hooks - https://www.drupal.org/project/dcq
❏ Setup your IDE (PhpStorm, Visual Studio Code, etc)
❏ Run Code Check - https://www.drupal.org/node/1587138
❏ Setup Code Analyzer Tools (SonarQube)
6. Steps to follow after getting task & before coding
❏ Check is it covered with core functionality
❏ Check is it possible to reach with configuration
❏ Search for already exists decisions:
❏ Contrib modules
❏ Patches
❏ Already created code
❏ Search for alternatives that could be reused
❏ Contrib modules that have almost the same functionality
❏ Already exists solutions close to requirements
❏ Came with custom solution
❏ Approve solution with team
8. Benefits
● We do not need to develop big part of code;
● It is already covered with security policy;
● There chance that it covered with tests;
● There chance that fount bugs will be fixed with Drupal community;
● We will have all updates, bug fixes, security issues;
● We can propose to client to use additional functionality (left 60%);
● We can propose to add functionality we developed additionally to contrib module
maintainer;
● etc.
9. Custom VS Alternative
Custom:
● Time to develop, setup, test, bug fixes
● Found bugs should be fixed ourselves - no
other options
● All updates should be done ourselves
● Tests done only by our testers
● Need to take care about security
Alternative:
● Only time to configure & theming
● Found bugs could be fixed with Drupal
community
● Community works on updates
● Tested by community (depends on module
usage)
● Already covered with security policy
10. Approve solution with team
● While discussing better solution could be found;
● Teammates could know issues you will face while developing;
● Teammates could know code that you can reuse;
● No need to redevelop everything if your solution not approved;
● Better communication in team;
● etc.
12. 1. Avoid to make potential issues to exists core functionality,
even if you not use this functionality right now
if ($userAccess == true) {
echo "<p><a href="/admin/config/search/"
class="button">Click here</a></p>";
}
13. Issues:
1. Language prefix will be missed for multilanguage site
2. Changes for base_path will not work
3. Page query will be missed (pager, destination, etc.)
3. Translations will not work
17. 5. Always keep in mind security questions
$text = t("This is !name's website", array('!name' => $username));
$text = t("This is @name's website", array('@name' => $username));
$text = t("This is %name's website", array('%name' => $username));
It depends on what you use as a placeholder:
!variable: Inserted as is. Use this for text that has already been sanitized.
@variable: Escaped to HTML using check_plain(). Use this for anything displayed on a page on the site.
%variable: Escaped as a placeholder for user-submitted content using drupal_placeholder(), which shows up
as emphasized text.
19. 7. Avoid to create your own functions to replace exists one
function mymodule_load_nodes() {
$ournewtype = 'product';
$sql = 'SELECT nid FROM {node} n WHERE n.type = :type';
$result = db_query($sql, array(':type' => $ournewtype));
$nodeids = array();
foreach ($result as $row) {
$nodeids[] = $row->nid;
}
return $nodeids;
}
Also avoid to create your custom queries
20. 8. Avoid very specific cases
function <mytheme>_preprocess_block(&$variables) {
if ($variables['block_html_id'] === 'block-<some name>') {
if (!user_is_logged_in()) {
$string = '<li><a href="/node/1">Node 1</a></li>';
$variables['content'] = str_replace($string, '', $variables['content']);
}
}
}
1. Specific block
2. Specific content