import elgg engine from an external applications

Hi, i'm trying to import elgg engine into an external application, but i have some problem trying to retrieve metadata.

i import the engine in such way

include_once (dirname(__FILE__)) . "/../../../../../engine/start.php";

$SESSION['user'] = get_user(2);  // this is super admin

but if i try to get an object, as example like this

$test = get_entity(18043);

var_dump ($test->start_date);

the metadata start_date is null, while if i paste the same code inside elgg it's correct...

anybody know if this is the correct way to import elgg engine or im i doing something wrong?

thanks in advance

luca

  • Hi, looking at elgg core i've found a strange behaviour: get_metastring_id give me always no results if case sensitive parameter is activated, even if i call my metastring with the correct case...

    i've solved the problem forcing get_metastring_id to be case insensitive by default...

    does this fix lead to some weird behaviour in elgg???

    thanks in advance and sorry for the bad english...

    bye luca

  • This might lead to weird problems.  Can you provide information about your version of MySQL and the collations used for your Elgg database and tables?

  • Hi Brett, I think i've found the problem, even if i still don't know if it's all working correctly... i'm using mysql 5 with utf 8 general, but the problem is METASTRINGS_CACHE (that is called only if case sensitive parameter is true) wich result NULL and lead to those problems... if i import it manually into my external applications with a $GLOBALS['METASTRINGS_CACHE'] = array() my applications load correctly all metadatas... i'm still investigating if all is working fine, but at the moment i've noticed further problems....

    Thanks

    Luca

  • sorry... i mean "i havn't noticed further problems"... :)