EKCCMS Documentation for Developers
If you are a developer seeking technical help that is not available here, click here to send us an email. We will personally respond to your request, and update this documentation.
EKCCMS Debugging Window
EKCCMS includes a powerful debugging window for PHP developers using this framework. When a variable is sent to the debugging screen, the file and line containing the debugging output is displayed, along with a dump of the variable data. This has many advantages in greatly streamlining development, facilitating native cross-browser development and testing, etc.
See the screenshot below for an example.
The EKCCMS debugging window can be enabled:
1. Log in as admin, then choose "Global Configuration" from the Administrative links. (If you do not have Admin Links module activated, you can navigate directly by going to /admin/global_configuration.php).
2. Search for the lines that say:
DEBUG_MESSAGE_TRACKING: check the box.
DEBUG_LEVEL: set this value to -1 (minus one).
To send data to the debugging window, use this command within your PHP code:
EKCore::EKDebug("VARIABLE NAME",$my_variable);
This will cause the variable $my_variable to be dumped to the debugging window at the bottom of your page, including the stack trace showing the file and line that generated the variable dump.
All of the included templates generate the debug window at the bottom of the page. However, you can manually output the debugging window in any location by adding this line to your PHP:
echo EKCore::EKDebugWindowHtml();
Click here for larger Debugging Window Screenshot
...Less...
EKCCMS Debugging Window
EKCCMS includes a powerful debugging window for PHP developers using this framework. When a variable is sent to the debugging screen, the file and ...More...
EKCCMS Debugging Window Advanced Feature
Built into the debugging mechanism is the ability to set a "debugging level" for debug messages. The debug level is an arbitrary value that you can set to messages to allow only messages of that level or higher to be displayed. When the debug level is not set, a debug level of 0 (zero) is assumed.
For example, to set a debug level of 50, you could use this command:
EKCore::EKDebug("VARIABLE NAME",$my_variable, 50);
In the Global Configuration, the DEBUG_LEVEL value must be less than or equal to 50 (and DEBUG_MESSAGE_TRACKING enabled) for this debug message to be displayed.
This mechanism removes the "var_dump" clutter when writing new classes, modules, etc.
...Less...
EKCCMS Debugging Window Advanced Feature
Built into the debugging mechanism is the ability to set a "debugging level" for debug messages. The debug level is an arbitrary value that you can...More...
Module development overview
There are many benefits to using the EKCCMS module API, some of which include:
Automatic configuration interface.
- EKCCMS generates the config GUI based upon the configuration variables that are defined.
- In other words, developers spend ZERO TIME developing configuration interfaces.
- Optional instructions for users can be built strait into the module using the ->get_instructions() method.
Easy enough for new developers, powerful enough for pros
- To fully integrate into EKCCMS, a module only needs one method to be customized: ->get_html()
- The only other required method is ->get_config_object, which should be copied from the template module (mod_template.php).
Quickest path to develop a new module:
- On your development server, go to the /modules folder and copy mod_template.php to your new module file (i.e. we'll use mod_example.php for the sake of example).
- Open mod_example.php, and change the class name from mod_template to mod_example and save the file.
- Change the configuration variables in the ->get_config_object method to suit your needs.
- Change the HTML output in the ->get_html() method to suit your needs.
- That's all! Your module can now be added to any content block.
The EKCCMS module API is activated by using specific naming conventions for module files and classes. Here is a crash course on EKCCMS modules for experienced developers:
- Module file must reside in /modules directory.
- Module file must begin with "mod_".
- Module classname must be the same as the module filename without the PHP extension. (e.g. mod_articles.php must contain "class mod_articles { }" or the system will crash.
If these conventions are observed, then EKCCMS will attempt to use the following methods of the module class (most of which should be relatively self-explantory to an experienced developer):
- ->get_html()
- ->get_direct_html_output()
- ->get_config_object()
- ->get_instructions()
These special variables are also important if they are used:
- ->config = The internal "configuration object" variable which is serialized and stored in the content_metadata field of the content table.
- ->config->file = Auto-generates a file popup configuration option for a server-based file.
- ->file_dir = Root directory for ->config->file popup.
- ->config->dir = Same as ->config->file, but for directories only.
- ->config->src_dir = Root directory for ->config->dir option.
...Less...
Module development overview
There are many benefits to using the EKCCMS module API, some of which include:...More...