This fails-- class foo { // Also tried with __construct() function ff() { print "fff"; global $phpbb_root_path, $phpEx, $user, $db, $config, $cache, $template,$auth; define('IN_PHPBB', true); $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './'; $phpEx = substr(strrchr(__FILE__, '.'), 1); include($phpbb_root_path . 'common.' . $phpEx); include($phpbb_root_path . 'includes/functions_posting.' . $phpEx); include($phpbb_root_path . 'includes/functions_display.' . $phpEx); include($phpbb_root_path . 'includes/message_parser.' . $phpEx); include_once 'ForumLegion/FLumil.php'; $umil = new umil(true,$db); // Ensure necessary tables exist. $j = $umil->table_exists('phpbb_FLforums'); $umil->table_add('phpbb_FLforums', array( 'COLUMNS' => array( 'topic' => array('VCHAR',''), 'native_topic_id' => array('UINT', '0') ), 'PRIMARY_KEY' => 'topic', 'KEYS' => array( 'topic' => array('INDEX', 'topic'), ), )); } } $a = new foo; $a->ff(); ?> This succeeds- table_exists('phpbb_FLforums'); $umil->table_add('phpbb_FLforums', array( 'COLUMNS' => array( 'topic' => array('VCHAR',''), 'native_topic_id' => array('UINT', '0') ), 'PRIMARY_KEY' => 'topic', 'KEYS' => array( 'topic' => array('INDEX', 'topic'), ), )); ?>