PHP Classes

File: README.md

Recommend this page to a friend!
  Packages of Christos Drogidis   Ascoos OS - CiC (Cross-Interpreter Communication)   README.md   Download  
File: README.md
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: Ascoos OS - CiC (Cross-Interpreter Communication)
combine WordPress and Joomla in a shared runtime
Author: By
Last change:
Date: 4 months ago
Size: 3,597 bytes
 

Contents

Class file image Download

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

  1. PHP ? 8.2
  2. Installed Ascoos OS or AWES 26
  3. Available autoloaders for WordPress and Joomla cores

Execution Flow

  1. Load the WordPress and Joomla cores via autoloaders.
  2. The WordPress hook `add_action('wp_head', 'my_custom_head', 10, 1)` is interpreted by `TWordpressInterpreterHandler`.
  3. The hook is translated into a macro via `TWordpressHookTranslatorHandler`.
  4. The macro is inserted into `TMacroHandler` with conditional execution.
  5. `TJoomlaApiBridgeHandler` calls the API `JFactory::getUser`.
  6. `TMacroHandler` executes all conditional macros.
  7. 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.