The Ringfree Communications Portal, internally designated as “Papal” or “Papal Mainframe” supports extensible functionality by way of installable modules. Module development is a fairly straightforward process and should be accessible to anyone with PHP experience in a capacity beyond the introductory.
The Portal is implemented targeting PHP 7.0, which should be the minimum target version for all module code for the time being. There are and will be no plans to support older 5.x versions of PHP. The Portal uses a fairly standard LAMP application stack with Apache’s mod_rewrite and mod_headers enabled. With minimal configuration, the Portal could be deployed in a number of similar environments such as LEMP, WAMP, etc.
Portal modules, at a minimum, require two components: a directory with a unique name limited to alphanumeric characters and hypens, and a file within that directory named “meta.txt” containing some basic information about the module. Such a module would accomplish nothing other than a demonstration of proof-of-concept, but functionally that’s all that is required to implement a module.
To add functionality to the module, all files within the module directory ending with a .php extension will be evaluated. As such, a module developer has some options regarding how to structure the project. For a simple module it may make sense to place all of the code in one or two PHP files directly beside the meta.txt file in the module directory. For a more complex module it would perhaps be better to organize the code in subdirectories and have a single base level PHP file that includes the appropriate files from the subdirectories. The only “correct” way to approach this is the one that makes the most sense given the scope of the module being worked on.
The Portal’s core code makes use of programming concepts such as namespaces, recursion, inheritance, and static functions. It’s advisable for any module developer to be reasonably familiar with these concepts and to implement them appropriately within their module. In fact some functionality requires classes to exist within specific namespaces (these situations will be pointed out later).
What follows is a guide that will walk you through the development of a module including structuring the meta.txt file, making use of the Portal’s registration features, and implementing a view. To start, let’s take a deeper look at the basic building blocks: