Cross-Interpreter Communication (CiC) ? WordPress & Joomla Case Study
This case study demonstrates how Ascoos OS implements the CiC (Cross?Interpreter Communication) standard to combine WordPress and Joomla in a shared runtime. Instead of simple integration, each CMS acts as an autonomous interpreter capable of executing, translating, and exchanging logic in real time, paving the way for Web5 and WebAI interoperability.
Purpose
-
Interpret WordPress hooks in a common interpreter
-
Translate hooks into conditional macros
-
Execute Joomla API calls via bridge
-
Combine results into a unified render
-
Demonstrate Web5 interoperability through CiC
Main Classes of Ascoos OS
-
TWordpressInterpreterHandler
Interprets WordPress hooks into logic objects
-
TWordpressHookTranslatorHandler
Translates hooks into conditional macros
-
TJoomlaApiBridgeHandler
Executes Joomla API calls and returns data
-
TMacroHandler
Unifies and executes conditional macros from multiple CMSs
-
TErrorMessageHandler
Handles errors and execution messages
File Structure
The implementation resides in a single PHP file:
- wp_joomla_in_aos.php
It contains the full logic: WordPress hook interpretation, translation into macros, Joomla API execution, and result combination.
Prerequisites
-
PHP ? 8.2
-
Installed Ascoos OS or
AWES 26
-
Available autoloaders for WordPress and Joomla cores
Execution Flow
-
Load the WordPress and Joomla cores via autoloaders.
-
The WordPress hook `add_action('wp_head', 'my_custom_head', 10, 1)` is interpreted by `TWordpressInterpreterHandler`.
-
The hook is translated into a macro via `TWordpressHookTranslatorHandler`.
-
The macro is inserted into `TMacroHandler` with conditional execution.
-
`TJoomlaApiBridgeHandler` calls the API `JFactory::getUser`.
-
`TMacroHandler` executes all conditional macros.
-
Results are combined and displayed in a unified render.
Code Example
$wpInterpreter = new TWordpressInterpreterHandler(['cms' => ['cmsType' => 'wordpress']]);
$wpHook = $wpInterpreter->interpretHooks("add_action('wp_head', 'my_custom_head', 10, 1)");
$wpTranslator = new TWordpressHookTranslatorHandler();
$wpMacro = $wpTranslator->translate($wpHook, ['hook' => 'wp_head']);
$macroEngine->addConditionalMacro(
$wpMacro->condition->condition,
fn(...$p) => $wpMacro->executeIfTrue(...$p)
);
$joomlaApiBridge = new TJoomlaApiBridgeHandler();
$userData = $joomlaApiBridge->bridge('JFactory::getUser', []);
$macroEngine->runAllConditional();
echo "@render_combined({$userData['name']})";
Expected Result
@render_combined(Ascoos user)
Resources
Contribution
You can extend CiC with more interpreters (e.g., Drupal, Python APIs) or improve translators for more complex hooks. See CONTRIBUTING.md for guidelines.
License
This case study is covered by the Ascoos General License (AGL). See LICENSE.md.