Rubidyn Library is a plugin with a library of functions and classes that can be utilised by other projects, providing consistant application for feature needs. For example, it can act as an abstract to apply a function across different PHP versions or WordPress API versions without changing the code of the other projects. It also standardises the user interface and access to features used by Rubidyn based projects
Parts of Rubidyn Library
The library is separated into class files, each may contain several PHP classes. They are divided into the following types:
- Common
- Web – web and html based functionality, creating HTML based code and related code, and web service features such as GET and POST requests
- WordPress – specific WordPress features and functionality
- Data
Common
Core functionality, generally intended to be PHP coding oriented. The common classes are often utilised by other classes or otherwise generic.
Library
The rdLibrary class is the main hub to all of the Rubidyn Library features and classes.
Cache
An array with cached values based on version and expiry, both optional with defaults used when not supplied. It does not store the cache, letting the code using it to decide where and how it will be stored.
Properties
Rubidyn Properties String, is a typed value string with a key/value pair. Each key/value pair is called a Property, and is separated with a colon (:). The rdProperties and rdProperty classes works with Rubidyn Properties Strings.
Data
Classes when working with data. Introduced in version 8.4 with functions for dealing with conversion of database date/time values into PHP date/time values, supporting an implied null value for a strongly typed datetime variable. They work with rdLibrary functions handling null values for date and datetime values.
Web
Core web functionality, to generate HTML or work with requested data sent to a page or other service such as API and AJAX requests.
Web
The rdWeb class is the main hub to all of the Rubidyn Library Web-based features and classes.
One of the main features is to wrap the testing for the request type and using get or post arrays into single request functions. Most of the request functions include a default if the request data is not there, and there are strongly typed versions.
For example, request_value(name,default) returns the value as it would normally be returned, but request_int(name,default) will always return an integer value, and return 0 (or the default) if it cannot be converted into an integer.
HTML
HTML is more than one class, assisting to produce HTML code from simple <input> elements to complex tab and table structures.
Map
Working with maps can be complex. The mapping classes help wrap the complexity of working with maps into a simpler coding experience.
The mapping system is designed to allow alternate mapping providers, however, as of Rubidyn Library 8.4, only Google Maps is supported.
WordPress
The rdWordPress class handles WordPress specific functionality. While the rest of the classes may include WordPress specific functionality to achieve its purpose in the best way within WordPress, the features in here as particular to WordPress only.