DownloadCross-Interpreter Communication (CiC) ? WordPress & Joomla Case Study
???? ? ?????? ?????????? ??????? ??? ?? Ascoos OS ???????? ?? ??????? CiC (Cross?Interpreter Communication) ??? ?? ????????? WordPress ??? Joomla ?? ????? runtime. ???? ??? ???? ??????????, ???? CMS ?????????? ?? ????????? ???????????? ??? ?????? ?? ???????, ?? ?????????? ??? ?? ??????????? ?????? ?? ?????????? ?????, ?????????? ??? ????? ??? ?????????????????? Web5 ??? WebAI.
??????
-
???????? WordPress hooks ?? ????? interpreter
-
????????? hooks ?? ???????????? ?? ????????
-
???????? Joomla API calls ???? bridge
-
?????????? ????????????? ?? ?????? render
-
???????? Web5 interoperability ?? CiC
?????? ??????? ??? Ascoos OS
-
TWordpressInterpreterHandler
???????? WordPress hooks ?? ??????????? ???????
-
TWordpressHookTranslatorHandler
????????? hooks ?? ???????????? ?? ????????
-
TJoomlaApiBridgeHandler
???????? Joomla API calls ??? ????????? ?????????
-
TMacroHandler
????????? ??? ???????? conditional macros ??? ???????? CMS
-
TErrorMessageHandler
?????????? ????????? ??? ????????? ?????????
???? ???????
? ????????? ????????? ?? ??? ?????? PHP:
- wp_joomla_in_aos.php
???????????? ??? ?? ??????: ???????? WordPress hooks, ????????? ?? macros, ???????? Joomla API ??? ????????? ?????????????.
??????????????
-
PHP ? 8.2
-
????????????? ?? Ascoos OS ? ??
AWES 26
-
????????? autoloaders ??? WordPress ??? Joomla ???????
??? ?????????
-
?????????? ? ??????? ??? WordPress ??? ??? Joomla ???? autoloaders.
-
? WordPress hook `add_action('wp_head', 'my_custom_head', 10, 1)` ??????????? ??? ??? `TWordpressInterpreterHandler`.
-
? hook ???????????? ?? macro ???? `TWordpressHookTranslatorHandler`.
-
? macro ????????? ??? `TMacroHandler` ?? conditional ????????.
-
? `TJoomlaApiBridgeHandler` ????? ?? API `JFactory::getUser`.
-
? `TMacroHandler` ??????? ??? ?? conditional macros.
-
???????????? ?? ???????????? ??? ??????????? ?????? render.
?????????? ??????
$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']})";
??????????? ??????????
@render_combined(Ascoos user)
?????
??????????
???????? ?? ??????????? ?? CiC ?? ????????????? interpreters (?.?. Drupal, Python APIs) ? ?? ?????????? ???? translators ??? ??? ??????? hooks. ????? ?? CONTRIBUTING.md ??? ???????.
????? ??????
???? ? ?????? ?????????? ??? ??? Ascoos General License (AGL). ????? ?? LICENSE.md. |