This document provides tools and tips for Moodle developers. It discusses various debugging techniques for PHP and JavaScript code using print statements and log functions. It also covers profiling performance, running automated tests with PHPUnit and Behat, linting code quality, and testing email functionality and accessibility. The Moodle Development Kit (MDK) and moodle-plugin-ci project are introduced to help integrate development tasks and testing into continuous integration workflows.
Learn about best practices for developing Moodle code from custom plugins to submitting bug fixes for core Moodle code. Topics covered will include:
Overview of Moodle plugin systems and available API's
Working with the Moodle tracker
Peer review process
Maintaining a custom plugin using Github
Submitting core patches / bug fixes to Moodle HQ
Creating and breaking a module in Drupal 8.
Configuration Steps: https://www.gitbook.com/book/zivtech/debug-tools-for-drupal8/details
Debug your PHP code efficiently without Devel module’s dpm(Drupal Print Message). With Drupal 8’s adoption of Symfony and object-oriented architecture, we need to adjust how we debug our code. Up until now, many of us have been using the convenient dpm function for debugging and introspection. However, dpm cannot print protected properties or provide information about methods of an object.
This makes it difficult to debug objects and classes. It’s time to learn a new approach! We will look at alternative methods to solve this problem such as:
Xdebug with PHPStorm configuration - http://xdebug.org
Devel and the WebProfiler (D8+) Drupal module https://www.drupal.org/project/devel
Using the continuous integration tool Probo CI to speed up the testing and approval process - http://probo.ci/
We will create a module, break it and use the above tools to debug, test and fix the code. Whether you are dipping your toes into object-oriented PHP or you're an advanced developer, everyone can benefit from debugging their code more efficiently.
Need start to finish help on getting Drupal 8 up and running locally? Ready to start contributing code?
This will help you get everything installed locally including Drush and gives basic information about Configuration for those new to it.
How to create a joomla component from scratchTim Plummer
In this presentation, Tim Plummer shows you how you can create your own Joomla component by forking Hello World, then adding some improvements to make it more like a typical third party Joomla extension. Files and code used in this presentation will be available for download.
Learn about best practices for developing Moodle code from custom plugins to submitting bug fixes for core Moodle code. Topics covered will include:
Overview of Moodle plugin systems and available API's
Working with the Moodle tracker
Peer review process
Maintaining a custom plugin using Github
Submitting core patches / bug fixes to Moodle HQ
Creating and breaking a module in Drupal 8.
Configuration Steps: https://www.gitbook.com/book/zivtech/debug-tools-for-drupal8/details
Debug your PHP code efficiently without Devel module’s dpm(Drupal Print Message). With Drupal 8’s adoption of Symfony and object-oriented architecture, we need to adjust how we debug our code. Up until now, many of us have been using the convenient dpm function for debugging and introspection. However, dpm cannot print protected properties or provide information about methods of an object.
This makes it difficult to debug objects and classes. It’s time to learn a new approach! We will look at alternative methods to solve this problem such as:
Xdebug with PHPStorm configuration - http://xdebug.org
Devel and the WebProfiler (D8+) Drupal module https://www.drupal.org/project/devel
Using the continuous integration tool Probo CI to speed up the testing and approval process - http://probo.ci/
We will create a module, break it and use the above tools to debug, test and fix the code. Whether you are dipping your toes into object-oriented PHP or you're an advanced developer, everyone can benefit from debugging their code more efficiently.
Need start to finish help on getting Drupal 8 up and running locally? Ready to start contributing code?
This will help you get everything installed locally including Drush and gives basic information about Configuration for those new to it.
How to create a joomla component from scratchTim Plummer
In this presentation, Tim Plummer shows you how you can create your own Joomla component by forking Hello World, then adding some improvements to make it more like a typical third party Joomla extension. Files and code used in this presentation will be available for download.
Node JS Express : Steps to Create Restful Web AppEdureka!
Node.js uses JavaScript - a language known to millions of developers worldwide - thus giving it a much lower learning curve even for complete beginners. Using Node.js you can build simple Command Line programs or complex enterprise level web applications with equal ease. Node.js is an event-driven, server-side, asynchronous development platform with lightning speed execution. It is open source and cross-platform, running on OS X, Linux and Windows. It also has an open source community that produces amazing modules available for use in your project for additional functionalities. Node.js helps you to code the most complex functionalities in just a few lines of code. The topics covered in the presentation are :
1. Understanding NodeJS Express
2. Creating Restful Web App
3. What is NPM
4.Templates in Express
Unleashing Creative Freedom with MODX (2015-09-08 at PHPAmersfoort)Mark Hamstra
The fourth stop for my little MODX Tour, this time at PHPAmersfoort. About the MODX content management platform, with a basic introduction and a more technical overview of some extension opportunities.
Relevant links:
http://MODX.com => official website
http://rtfm.modx.com => official documentation
https://github.com/modxcms/revolution => source code
https://MODX.today => daily links/articles about MODX
https://www.modmore.com => premium extras for MODX
https://joind.in/talk/view/15171 => talk feedback
Node JS Express : Steps to Create Restful Web AppEdureka!
Node.js uses JavaScript - a language known to millions of developers worldwide - thus giving it a much lower learning curve even for complete beginners. Using Node.js you can build simple Command Line programs or complex enterprise level web applications with equal ease. Node.js is an event-driven, server-side, asynchronous development platform with lightning speed execution. It is open source and cross-platform, running on OS X, Linux and Windows. It also has an open source community that produces amazing modules available for use in your project for additional functionalities. Node.js helps you to code the most complex functionalities in just a few lines of code. The topics covered in the presentation are :
1. Understanding NodeJS Express
2. Creating Restful Web App
3. What is NPM
4.Templates in Express
Unleashing Creative Freedom with MODX (2015-09-08 at PHPAmersfoort)Mark Hamstra
The fourth stop for my little MODX Tour, this time at PHPAmersfoort. About the MODX content management platform, with a basic introduction and a more technical overview of some extension opportunities.
Relevant links:
http://MODX.com => official website
http://rtfm.modx.com => official documentation
https://github.com/modxcms/revolution => source code
https://MODX.today => daily links/articles about MODX
https://www.modmore.com => premium extras for MODX
https://joind.in/talk/view/15171 => talk feedback
An attempt to explain Moodle to our staff or anyone else by using an analogy with modular Lego bricks.
Background details and accompanying video clip available at: http://tomazlasic.net
Free to use, translate and share for non-commercial purposes.
Enjoy
Tomaz Lasic
http://tomazlasic.net
Twitter @lasic
This is a presentation I prepared for a local meetup. The audience is a mix of web designers and developers who have a wide range of development experience.
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.
You need to write a script you can call from cron to upload a directory of files to S3. Or perhaps zip log files and E-mail them? Or import a CSV into the DB. What do you use? Bash? Python? Node? No silly, you use CFML! ColdFusion developers have been able to write pure CLI scripts with CommandBox CLI for years now and it beats the pants of bash or Node. There's tools for creating interactive wizards, progress bar animations, colored console text output, and easy parameter handling. And the best thing is, CommandBox Task Runners are written in CFML so they can do anything CFML can do. Come learn how quick and easy Task Runners are to use so CFML can become the go-to language to use for anything.
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...Puppet
Here are the slides from David Lutterkort's PuppetConf 2016 presentation called The Challenges with Container Configuration. Watch the videos at https://www.youtube.com/playlist?list=PLV86BgbREluVjwwt-9UL8u2Uy8xnzpIqa
Introducing containers into your infrastructure brings new capabilities, but also new challenges, in particular around configuration. This talk will take a look under the hood at some of those operational challenges including:
* The difference between runtime and build-time configuration, and the importance of relating the two together.
* Configuration drift, immutable mental models and mutable container file systems.
* Who configures the orchestrators?
* Emergent vs. model driven configuration.
In the process we will identify some common problems and talk about potential solutions.
Talk from PuppetConf 2016
Ordering System IP2buildclasses.netbeans_automatic_buildO.docxhopeaustin33688
Ordering System IP2/build/classes/.netbeans_automatic_build
Ordering System IP2/build/classes/.netbeans_update_resources
Ordering System IP2/build/classes/online/ordering/system/ip1/OnlineOrderingSystemIP1.classpackage online.ordering.system.ip1;
publicsynchronizedclass OnlineOrderingSystemIP1 {
public void OnlineOrderingSystemIP1();
privatestatic String getStringInput(String);
privatestatic double totalCost(int, double, double);
publicstatic void main(String[]);
}
Ordering System IP2/build.xml
Builds, tests, and runs the project Online Ordering System IP1.
Ordering System IP2/manifest.mf
Manifest-Version: 1.0
X-COMMENT: Main-Class will be added automatically by build
Ordering System IP2/nbproject/build-impl.xml
.
Slides from a presentation that David Lopez (@lopezator) and me made for the students of the University of the Basque Country (UPV/EHU) where we talk about current technologies and methodologies used in professional web development.
CSS3, jQuery, Composer, MVC, Clean Code, Git, etc. are different items we talked about.
Some examples shown in the presentation available at:
http://ojoven.es/labs/ehu2014/
Presentation for azPHP on setting up a new project using Zend_Tool. Also goes over creating basic modules, controllers, actions, models and layouts.
All code in the presentation has not necessarily been tested. Will update presentation when done.
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.
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024Neo4j
Neha Bajwa, Vice President of Product Marketing, Neo4j
Join us as we explore breakthrough innovations enabled by interconnected data and AI. Discover firsthand how organizations use relationships in data to uncover contextual insights and solve our most pressing challenges – from optimizing supply chains, detecting fraud, and improving customer experiences to accelerating drug discoveries.
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
Pushing the limits of ePRTC: 100ns holdover for 100 daysAdtran
At WSTS 2024, Alon Stern explored the topic of parametric holdover and explained how recent research findings can be implemented in real-world PNT networks to achieve 100 nanoseconds of accuracy for up to 100 days.
Removing Uninteresting Bytes in Software FuzzingAftab Hussain
Imagine a world where software fuzzing, the process of mutating bytes in test seeds to uncover hidden and erroneous program behaviors, becomes faster and more effective. A lot depends on the initial seeds, which can significantly dictate the trajectory of a fuzzing campaign, particularly in terms of how long it takes to uncover interesting behaviour in your code. We introduce DIAR, a technique designed to speedup fuzzing campaigns by pinpointing and eliminating those uninteresting bytes in the seeds. Picture this: instead of wasting valuable resources on meaningless mutations in large, bloated seeds, DIAR removes the unnecessary bytes, streamlining the entire process.
In this work, we equipped AFL, a popular fuzzer, with DIAR and examined two critical Linux libraries -- Libxml's xmllint, a tool for parsing xml documents, and Binutil's readelf, an essential debugging and security analysis command-line tool used to display detailed information about ELF (Executable and Linkable Format). Our preliminary results show that AFL+DIAR does not only discover new paths more quickly but also achieves higher coverage overall. This work thus showcases how starting with lean and optimized seeds can lead to faster, more comprehensive fuzzing campaigns -- and DIAR helps you find such seeds.
- These are slides of the talk given at IEEE International Conference on Software Testing Verification and Validation Workshop, ICSTW 2022.
PHP Frameworks: I want to break free (IPC Berlin 2024)Ralf Eggert
In this presentation, we examine the challenges and limitations of relying too heavily on PHP frameworks in web development. We discuss the history of PHP and its frameworks to understand how this dependence has evolved. The focus will be on providing concrete tips and strategies to reduce reliance on these frameworks, based on real-world examples and practical considerations. The goal is to equip developers with the skills and knowledge to create more flexible and future-proof web applications. We'll explore the importance of maintaining autonomy in a rapidly changing tech landscape and how to make informed decisions in PHP development.
This talk is aimed at encouraging a more independent approach to using PHP frameworks, moving towards a more flexible and future-proof approach to PHP development.
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.
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...SOFTTECHHUB
The choice of an operating system plays a pivotal role in shaping our computing experience. For decades, Microsoft's Windows has dominated the market, offering a familiar and widely adopted platform for personal and professional use. However, as technological advancements continue to push the boundaries of innovation, alternative operating systems have emerged, challenging the status quo and offering users a fresh perspective on computing.
One such alternative that has garnered significant attention and acclaim is Nitrux Linux 3.5.0, a sleek, powerful, and user-friendly Linux distribution that promises to redefine the way we interact with our devices. With its focus on performance, security, and customization, Nitrux Linux presents a compelling case for those seeking to break free from the constraints of proprietary software and embrace the freedom and flexibility of open-source computing.
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/
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
In his public lecture, Christian Timmerer provides insights into the fascinating history of video streaming, starting from its humble beginnings before YouTube to the groundbreaking technologies that now dominate platforms like Netflix and ORF ON. Timmerer also presents provocative contributions of his own that have significantly influenced the industry. He concludes by looking at future challenges and invites the audience to join in a discussion.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
Dr. Sean Tan, Head of Data Science, Changi Airport Group
Discover how Changi Airport Group (CAG) leverages graph technologies and generative AI to revolutionize their search capabilities. This session delves into the unique search needs of CAG’s diverse passengers and customers, showcasing how graph data structures enhance the accuracy and relevance of AI-generated search results, mitigating the risk of “hallucinations” and improving the overall customer journey.
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
9. PHPUnit
Test authoring tips:
• Use most specific assertion possible
• Make use of @dataProvider to
reduce duplication and get better
errors
• Remember we have data generators
to simplify setup code
/**
* Data provider for test_get_real_size().
*
* @return array An array of arrays contain test data
*/
public function data_for_test_get_real_size() {
return array(
array('8KB', 8192),
array('8G', 8589934592),
);
}
/**
* @dataProvider data_for_test_get_real_size
*/
public function test_get_real_size($input, $expectedbytes) {
$this->assertEquals($expectedbytes,get_real_size($input));
}
There was 1 failure:
1) core_setuplib_testcase::test_get_real_size with data set #0
('8KB', 8193)
Failed asserting that 8192 matches expected 8193.
the world’s open source learning platform
10. Behat
Useful CLI Options:
Filtering
—tags @block_online_users
—name “Add the online users on course
page and see other logged in users”
Rerun
—rerun
Profiles
—profile chrome
$CFG->behat_profiles = array(
'phantomjs' => array(
'browser' => ‘chrome’,
'wd_host' => ‘http://10.0.0.3:4444/wd/hub',
));
the world’s open source learning platform
11. Behat
Tips:
• Solutions for headless running:
• All platforms: Phantom JS
• Linux: Xvfb - X virtual framebuffer
• Mac: Fast user switching - with background user
• $x() in web developer console extremely useful for constructing
XPath queries
the world’s open source learning platform
13. • Analysing code for potential errors
• Good feedback loop
• Ensure consistency
• Integrate with your development workflow FTW!
Code Linting
the world’s open source learning platform
14. • Code-checker (local_codechecker)
• Available from Plugins Directory
• Uses PHP Code-sniffer underneath
• Integrations configured with path to local_codechecker/moodle/
location
Moodle Code Linters: PHP
the world’s open source learning platform
15. • ESLint
• New in Moodle 3.2 (MDL-52127), replaced jshint
• grunt js: checks for errors on AMD modules and YUI modules
• Integrations usually work without configuration ( eslintrc bundled)
Moodle Code Linters: Javascript
the world’s open source learning platform
16. • Packages: linter
• linter-phpcs
• linter-eslint
• Config:
"linter-phpcs":
codeStandardOrConfigFile: “/path/to/moodle-
Lint in your editor: Atom
the world’s open source learning platform
17. • Package: syntastic
• vimrc:
let g:syntastic_javascript_checkers = ['eslint']
let g:syntastic_php_checkers = ['php', 'phpcs']
let g:syntastic_php_phpcs_args='--standard="/
path/to/moodle-local_codechecker/moodle/"'
Lint in your editor: vim
the world’s open source learning platform
18. Lint in your editor: PHPStorm
Configured in Editor > Inspections:
• PHP > PHP Code SnifferValidation
• Select ‘Custom’ coding standard and
choose path to local_codechecker/
moodle/
• Javascript > Code Quality Tools >
ESLint
the world’s open source learning platform
20. Lint in your editor….
I’m sure their is an emacs integration too 🙄😘
the world’s open source learning platform
21. the world’s open source learning platform
“The goal of this project is to facilitate the running of
tests and code analysis tools against a Moodle plugin in
Travis CI.”
• https://github.com/moodlerooms/moodle-plugin-ci
• Created by Mark Nielsen (Moodlerooms)
• Extremely simple and comprehensive way to add CI to
your plugin
moodle-plugin-ci
23. the world’s open source learning platform
“A collection of tools meant to make developers' lives easier.”
• https://github.com/FMCorz/mdk
• Created by Frédéric Massart (Moodle HQ)
• Python tools - works with Linux and Mac
• (Windows patches welcomed!)
• Developed for core development tasks, but useful for non-core
work too
Moodle Development Kit (mdk)
24. • mdk create
• mdk upgrade
• mdk install
• mdk run
• mdk remove
MDK: Instance management
the world’s open source learning platform
25. • mdk phpunit
• init
• mdk behat
• init
• fail dumps
• seleneium server start
MDK: Testing
the world’s open source learning platform
26. • mdk fix
• mdk pull
• mdk push
MDK: Fixing issues
the world’s open source learning platform
27. • mdk fix
• mdk pull
• mdk push
MDK: Fixing continued
the world’s open source learning platform
28. the world’s open source learning platform
Email testing: config options
// Disable all Email.
$CFG->noemailever = true;
// Divert all outgoing emails to this address to test and debug emailing features
$CFG->divertallemailsto = 'youremail@example.com';
// Except for certain email addresses you want to let through for testing. Accepts
// a comma separated list of regexes.
$CFG->divertallemailsexcept = 'tester@dev.com, fred(+.*)?@example.com';
29. Email testing: mailcatcher
$CFG->smtphosts = 'localhost:1025';
$ gem install mailcatcher
$ mailcatcher
Starting MailCatcher
==> smtp://127.0.0.1:1025
==> http://127.0.0.1:1080
*** MailCatcher runs as a daemon by default.
Go to the web interface to quit.
the world’s open source learning platform
30. the world’s open source learning platform
Accessibility testing
• ChromeVox
• Chrome Extension - Quick and straight forward to get started
• Not JAWS but better than nothing
• Accessibility Developer Tools - Accessibility audit useful