The latest edition of PHP, the programming language in which the Moodle core is written, is a promising revamp of the otherwise primeval tool. PHP 7 has shown to be significantly faster and more versatile than previous releases.
Still, at every new revision of a solution on which we come to rely, the many misplaced or reshaped functionality can be the bane of the dev’s existence. In order to spare you at least part of it, we’ve made this quick guide to composure-rewarding PHP 7.
What is PHP?
PHP: Hypertext Preprocessor is a programming language designed for software that requires the user to make requests involving tools and data from a server over the internet, and the server to produce customized responses. Like all programming languages, it has ideal case scenarios but is a general-purpose language that today supports most programming paradigms. And, of course, it is open source.
What made it the best choice for the Moodle core?
How do I get started with it?
The easiest way to make use of PHP, especially if you want to use it for Moodle, is to download the LAMP (in Linux) or WAMP (in Windows) bundle, which ships Apache (server), MySQL (database) and PHP languages. This assortment gives a full toolset for Moodle development, as well as many popular, Open Source systems today, including WordPress.
Regarding learning PHP, it is fairly easy to hit the ground running and there are lots of tutorials, interactive tools or course-long videos. Since it allows for many programming paradigms, perhaps the easiest to understand in an actionable way is “Object Oriented Programming”: Objects are individual entities made out of attributes (variables) which may or may not change, and things they are capable of (methods or functions) including changing attributes of themselves or other objects. Just like you and me! Objects can contain other objects, and can create, be created, destroy and be destroyed by other objects.
What can I do with it?
Moodle plugins! PHP 7 is the language required for Moodle 3.5 and soon will become the de facto language for Moodle. PHP is necessary to interact with the functions available in each Activity. To access data, PHP code must open a line of communication with the database using the Activity’s API (Application Programming Interface).■
This Moodle Technology related post is made possible by: Moonami a company that provides a full range of Moodle services that combine the flexibility, scalability, and power of Amazon’s world-leading cloud platform (AWS) with fanatical Moodle support. Click here to learn more.