here is sample code
class ForumsController extends AppController
{
function index(){
define('PUN_ROOT', dirname(dirname(__FILE__)).DIRECTORY_SEPARATOR.'webroot'.DIRECTORY_SEPARATOR.'forum'.DIRECTORY_SEPARATOR);
require PUN_ROOT.'include'.DIRECTORY_SEPARATOR.'common.php';
}
}
here is a crude debug report after manualy hacking the global $db
please note in the end how the array lose their data becuase the checked againt $pun_config which is null
becuase declared global $pun_config
smarty:you can delete this post after reading becuase its take lot of space and i don't know how clear it is for readers
pun user -> var_dump()
array(11) { ["id"]=> string(2) "24" ["user_name"]=> string(4) "test" ["email_address"]=> string(18) "sufinoon@gmail.com" ["full_name"]=> string(3) "ass" ["password"]=> string(32) "e10adc3949ba59abbe56e057f20f883e" ["show_name"]=> string(1) "0" ["created"]=> string(19) "2007-05-15 09:45:12" ["user_profile_id"]=> string(2) "16" ["email_authenticated"]=> string(1) "1" ["email_token"]=> NULL ["email_token_expires"]=> NULL }
hihiobject(DBLayer)#13 (5) { ["prefix"]=> string(0) "" ["link_id"]=> object(mysqli)#14 (0) { } ["query_result"]=> NULL ["saved_queries"]=> array(0) { } ["num_queries"]=> int(0) }
in the middle (common.php line 116)
before check cookie (common.php line 140)
var_dump($db) ->
object(DBLayer)#13 (5) { ["prefix"]=> string(0) "" ["link_id"]=> object(mysqli)#14 (0) { } ["query_result"]=> NULL ["saved_queries"]=> array(0) { } ["num_queries"]=> int(0) }
******
* in check user *
********** (functions.php line 37)
NULL -> var_dump($db);
*****
default users
**** (functions.php line 143)
pun_config (functions.php line 157)
NULL -> var_dump($pun_config);
in set_default_user (functions.php line 166)
array(56) { ["id"]=> string(1) "1" ["group_id"]=> string(1) "3" ["username"]=> string(5) "Guest" ["password"]=> string(5) "Guest" ["email"]=> string(0) "" ["title"]=> NULL ["realname"]=> string(0) "" ["url"]=> NULL ["jabber"]=> NULL ["icq"]=> NULL ["msn"]=> NULL ["aim"]=> NULL ["yahoo"]=> NULL ["location"]=> NULL ["use_avatar"]=> string(1) "0" ["signature"]=> NULL ["disp_topics"]=> NULL ["disp_posts"]=> NULL ["email_setting"]=> string(1) "1" ["save_pass"]=> string(1) "1" ["notify_with_post"]=> string(1) "0" ["show_smilies"]=> string(1) "1" ["show_img"]=> string(1) "1" ["show_img_sig"]=> string(1) "1" ["show_avatars"]=> string(1) "1" ["show_sig"]=> string(1) "1" ["timezone"]=> string(1) "0" ["language"]=> string(7) "English" ["style"]=> string(6) "Oxygen" ["num_posts"]=> string(1) "0" ["last_post"]=> NULL ["registered"]=> string(1) "0" ["registration_ip"]=> string(7) "0.0.0.0" ["last_visit"]=> string(1) "0" ["admin_note"]=> NULL ["activate_string"]=> NULL ["activate_key"]=> NULL ["g_id"]=> string(1) "3" ["g_title"]=> string(5) "Guest" ["g_user_title"]=> NULL ["g_read_board"]=> string(1) "1" ["g_post_replies"]=> string(1) "0" ["g_post_topics"]=> string(1) "0" ["g_post_polls"]=> string(1) "0" ["g_edit_posts"]=> string(1) "0" ["g_delete_posts"]=> string(1) "0" ["g_delete_topics"]=> string(1) "0" ["g_set_title"]=> string(1) "0" ["g_search"]=> string(1) "1" ["g_search_users"]=> string(1) "1" ["g_edit_subjects_interval"]=> string(1) "0" ["g_post_flood"]=> string(1) "0" ["g_search_flood"]=> string(1) "0" ["g_pm"]=> string(1) "1" ["g_pm_limit"]=> string(2) "20" ["logged"]=> string(10) "1179213445" }
**********
AFTER defaukt init
************
(functions.php line 197)
array(57) { ["id"]=> string(1) "1" ["group_id"]=> string(1) "3" ["username"]=> string(5) "Guest" ["password"]=> string(5) "Guest" ["email"]=> string(0) "" ["title"]=> NULL ["realname"]=> string(0) "" ["url"]=> NULL ["jabber"]=> NULL ["icq"]=> NULL ["msn"]=> NULL ["aim"]=> NULL ["yahoo"]=> NULL ["location"]=> NULL ["use_avatar"]=> string(1) "0" ["signature"]=> NULL ["disp_topics"]=> NULL ["disp_posts"]=> NULL ["email_setting"]=> string(1) "1" ["save_pass"]=> string(1) "1" ["notify_with_post"]=> string(1) "0" ["show_smilies"]=> string(1) "1" ["show_img"]=> string(1) "1" ["show_img_sig"]=> string(1) "1" ["show_avatars"]=> string(1) "1" ["show_sig"]=> string(1) "1" ["timezone"]=> NULL ["language"]=> NULL ["style"]=> NULL ["num_posts"]=> string(1) "0" ["last_post"]=> NULL ["registered"]=> string(1) "0" ["registration_ip"]=> string(7) "0.0.0.0" ["last_visit"]=> string(1) "0" ["admin_note"]=> NULL ["activate_string"]=> NULL ["activate_key"]=> NULL ["g_id"]=> string(1) "3" ["g_title"]=> string(5) "Guest" ["g_user_title"]=> NULL ["g_read_board"]=> string(1) "1" ["g_post_replies"]=> string(1) "0" ["g_post_topics"]=> string(1) "0" ["g_post_polls"]=> string(1) "0" ["g_edit_posts"]=> string(1) "0" ["g_delete_posts"]=> string(1) "0" ["g_delete_topics"]=> string(1) "0" ["g_set_title"]=> string(1) "0" ["g_search"]=> string(1) "1" ["g_search_users"]=> string(1) "1" ["g_edit_subjects_interval"]=> string(1) "0" ["g_post_flood"]=> string(1) "0" ["g_search_flood"]=> string(1) "0" ["g_pm"]=> string(1) "1" ["g_pm_limit"]=> string(2) "20" ["logged"]=> string(10) "1179213445" ["is_guest"]=> bool(true) }
after check cookie (common.php line 145)
array(57) { ["id"]=> string(1) "1" ["group_id"]=> string(1) "3" ["username"]=> string(5) "Guest" ["password"]=> string(5) "Guest" ["email"]=> string(0) "" ["title"]=> NULL ["realname"]=> string(0) "" ["url"]=> NULL ["jabber"]=> NULL ["icq"]=> NULL ["msn"]=> NULL ["aim"]=> NULL ["yahoo"]=> NULL ["location"]=> NULL ["use_avatar"]=> string(1) "0" ["signature"]=> NULL ["disp_topics"]=> NULL ["disp_posts"]=> NULL ["email_setting"]=> string(1) "1" ["save_pass"]=> string(1) "1" ["notify_with_post"]=> string(1) "0" ["show_smilies"]=> string(1) "1" ["show_img"]=> string(1) "1" ["show_img_sig"]=> string(1) "1" ["show_avatars"]=> string(1) "1" ["show_sig"]=> string(1) "1" ["timezone"]=> NULL ["language"]=> NULL ["style"]=> NULL ["num_posts"]=> string(1) "0" ["last_post"]=> NULL ["registered"]=> string(1) "0" ["registration_ip"]=> string(7) "0.0.0.0" ["last_visit"]=> string(1) "0" ["admin_note"]=> NULL ["activate_string"]=> NULL ["activate_key"]=> NULL ["g_id"]=> string(1) "3" ["g_title"]=> string(5) "Guest" ["g_user_title"]=> NULL ["g_read_board"]=> string(1) "1" ["g_post_replies"]=> string(1) "0" ["g_post_topics"]=> string(1) "0" ["g_post_polls"]=> string(1) "0" ["g_edit_posts"]=> string(1) "0" ["g_delete_posts"]=> string(1) "0" ["g_delete_topics"]=> string(1) "0" ["g_set_title"]=> string(1) "0" ["g_search"]=> string(1) "1" ["g_search_users"]=> string(1) "1" ["g_edit_subjects_interval"]=> string(1) "0" ["g_post_flood"]=> string(1) "0" ["g_search_flood"]=> string(1) "0" ["g_pm"]=> string(1) "1" ["g_pm_limit"]=> string(2) "20" ["logged"]=> string(10) "1179213445" ["is_guest"]=> bool(true) }
in !isset (common.php line 150)
array(57) { ["id"]=> string(1) "1" ["group_id"]=> string(1) "3" ["username"]=> string(5) "Guest" ["password"]=> string(5) "Guest" ["email"]=> string(0) "" ["title"]=> NULL ["realname"]=> string(0) "" ["url"]=> NULL ["jabber"]=> NULL ["icq"]=> NULL ["msn"]=> NULL ["aim"]=> NULL ["yahoo"]=> NULL ["location"]=> NULL ["use_avatar"]=> string(1) "0" ["signature"]=> NULL ["disp_topics"]=> NULL ["disp_posts"]=> NULL ["email_setting"]=> string(1) "1" ["save_pass"]=> string(1) "1" ["notify_with_post"]=> string(1) "0" ["show_smilies"]=> string(1) "1" ["show_img"]=> string(1) "1" ["show_img_sig"]=> string(1) "1" ["show_avatars"]=> string(1) "1" ["show_sig"]=> string(1) "1" ["timezone"]=> NULL ["language"]=> NULL ["style"]=> NULL ["num_posts"]=> string(1) "0" ["last_post"]=> NULL ["registered"]=> string(1) "0" ["registration_ip"]=> string(7) "0.0.0.0" ["last_visit"]=> string(1) "0" ["admin_note"]=> NULL ["activate_string"]=> NULL ["activate_key"]=> NULL ["g_id"]=> string(1) "3" ["g_title"]=> string(5) "Guest" ["g_user_title"]=> NULL ["g_read_board"]=> string(1) "1" ["g_post_replies"]=> string(1) "0" ["g_post_topics"]=> string(1) "0" ["g_post_polls"]=> string(1) "0" ["g_edit_posts"]=> string(1) "0" ["g_delete_posts"]=> string(1) "0" ["g_delete_topics"]=> string(1) "0" ["g_set_title"]=> string(1) "0" ["g_search"]=> string(1) "1" ["g_search_users"]=> string(1) "1" ["g_edit_subjects_interval"]=> string(1) "0" ["g_post_flood"]=> string(1) "0" ["g_search_flood"]=> string(1) "0" ["g_pm"]=> string(1) "1" ["g_pm_limit"]=> string(2) "20" ["logged"]=> string(10) "1179213445" ["is_guest"]=> bool(true) }
Attempt to load the common language file (common.php line 155)
There is no valid language pack '' installed. Please reinstall a language of that name.