I am using Evolution CMS (Modx) and have several functions declared (in snippets).
Those functions I can include in Evo CMS by calling e.g. $modx->runSnippet('functions_main');.
Now I have an external PHP script (independent from Evo CMS) and would like to use those functions there.
However, I don't know how to properly access them (from the DB) and integrate them as PHP functions.
I thought of building my own version of evalSnippet() (Core.php) but could not get it done yet.
I would need something like include_modx_snippet('functions_main'); which reads the snippet (the defined functions) from the DB and makes them available as PHP functions.
Or I just find out how to parse the snippet content and turn it into PHP functions.
You can do this by first initialising Modx and then running your snippet like you would normally: