diff --git a/doc/html/annotated.html b/doc/html/annotated.html index fd894e4ff..f72aed486 100644 --- a/doc/html/annotated.html +++ b/doc/html/annotated.html @@ -120,19 +120,18 @@ $(document).ready(function(){initNavTree('annotated.html','');});
Referenced by dba\__construct().
-Referenced by FriendicaSmarty\__construct(), App\__construct(), acl_init(), admin_page_logs_post(), admin_page_plugins(), admin_page_site(), admin_page_site_post(), admin_page_themes(), admin_page_users_post(), api_content(), api_direct_messages_box(), api_direct_messages_new(), api_favorites(), api_format_messages(), api_get_user(), api_login(), api_post(), api_statuses_f(), api_statuses_home_timeline(), api_statuses_mentions(), api_statuses_public_timeline(), api_statuses_show(), api_statuses_update(), api_statuses_user_timeline(), api_user(), attach_store(), authenticate_success(), bbcode(), bbtoevent(), best_link_url(), App\build_pagehead(), channel_aside(), channel_content(), check_config(), check_form_security_token(), community_content(), connections_aside(), connections_content(), connections_post(), construct_page(), consume_feed(), create_account(), create_identity(), crepair_init(), crepair_post(), current_theme(), del_config(), del_pconfig(), del_xconfig(), delegate_content(), detect_language(), directory_content(), dirfind_init(), dirsearch_content(), encode_rel_links(), events_content(), events_post(), feed_init(), filerm_content(), get_atom_elements(), App\get_baseurl(), get_browser_language(), get_item_elements(), get_max_import_size(), get_my_address(), get_my_url(), get_plink(), get_public_feed(), Item\get_template_data(), group_add(), group_rmv(), hcard_init(), import_post(), import_xchan(), info(), intro_content(), invite_post(), item_post(), item_store(), item_store_update(), lang_selector(), load_contact_links(), local_delivery(), local_user(), lostpass_content(), lrdd(), magic_init(), mail_store(), message_content(), message_post(), mood_content(), mood_init(), nav(), navbar_complete(), network_content(), network_init(), network_query_get_sel_tab(), new_channel_content(), nogroup_init(), notice(), notifications_content(), oexchange_content(), parse_url_content(), photo_upload(), photos_content(), photos_post(), ping_init(), poco_init(), poco_load(), poke_content(), poke_init(), post_activity_item(), printable(), probe_content(), proc_run(), process_delivery(), profile_photo_post(), profile_sidebar(), profile_tabs(), profiles_post(), dba\q(), qsearch_init(), redir_init(), register_content(), register_post(), regmod_content(), remote_user(), removeme_post(), saved_searches(), search_ac_init(), search_content(), search_init(), search_post(), service_class_allows(), service_class_fetch(), App\set_baseurl(), settings_post(), setup_content(), setup_init(), siteinfo_init(), suggest_init(), t(), tagrm_post(), tt(), validate_channelname(), wall_upload_post(), webfinger_content(), wfinger_init(), xchan_content(), z_fetch_url(), and zfinger_init().
+Referenced by FriendicaSmarty\__construct(), App\__construct(), acl_init(), admin_page_logs_post(), admin_page_plugins(), admin_page_site(), admin_page_site_post(), admin_page_themes(), admin_page_users_post(), api_content(), api_direct_messages_box(), api_direct_messages_new(), api_favorites(), api_format_messages(), api_get_user(), api_login(), api_post(), api_statuses_f(), api_statuses_home_timeline(), api_statuses_mentions(), api_statuses_public_timeline(), api_statuses_show(), api_statuses_update(), api_statuses_user_timeline(), api_user(), attach_store(), authenticate_success(), bbcode(), bbtoevent(), best_link_url(), App\build_pagehead(), channel_aside(), channel_content(), check_config(), check_form_security_token(), community_content(), connections_aside(), connections_content(), connections_post(), construct_page(), consume_feed(), create_account(), create_identity(), crepair_init(), crepair_post(), current_theme(), del_config(), del_pconfig(), del_xconfig(), delegate_content(), detect_language(), directory_content(), dirfind_init(), dirsearch_content(), encode_rel_links(), events_content(), events_post(), feed_init(), filerm_content(), get_atom_elements(), App\get_baseurl(), get_browser_language(), get_item_elements(), get_max_import_size(), get_my_address(), get_my_url(), get_plink(), get_public_feed(), Item\get_template_data(), group_add(), group_rmv(), hcard_init(), import_post(), import_xchan(), info(), intro_content(), invite_post(), item_post(), item_store(), item_store_update(), lang_selector(), load_contact_links(), local_delivery(), local_user(), lostpass_content(), lrdd(), magic_init(), mail_store(), message_content(), message_post(), mood_content(), mood_init(), nav(), navbar_complete(), network_content(), network_init(), network_query_get_sel_tab(), new_channel_content(), nogroup_init(), notice(), notifications_content(), oexchange_content(), parse_url_content(), photo_upload(), photos_content(), photos_post(), ping_init(), poco_init(), poco_load(), poke_content(), poke_init(), post_activity_item(), printable(), probe_content(), proc_run(), process_delivery(), profile_photo_post(), profile_sidebar(), profile_tabs(), profiles_post(), qsearch_init(), redir_init(), register_content(), register_post(), regmod_content(), remote_user(), removeme_post(), saved_searches(), search_ac_init(), search_content(), search_init(), search_post(), service_class_allows(), service_class_fetch(), App\set_baseurl(), settings_post(), setup_content(), setup_init(), siteinfo_init(), suggest_init(), t(), tagrm_post(), tt(), validate_channelname(), wall_upload_post(), webfinger_content(), wfinger_init(), xchan_content(), z_fetch_url(), and zfinger_init().
Referenced by admin_page_dbsync(), admin_page_site_post(), admin_page_users(), allfriends_content(), api_content(), api_post(), apps_content(), attach_init(), authenticate_success(), channel_content(), channel_init(), chanview_content(), check_account_email(), check_account_invite(), check_form_security_std_err_msg(), check_keys(), check_php(), common_content(), common_init(), community_content(), connections_content(), connections_post(), crepair_content(), crepair_post(), delegate_content(), directory_content(), dirfind_content(), display_content(), drop_item(), editpost_content(), events_content(), events_post(), follow_init(), fsuggest_content(), fsuggest_post(), group_add(), group_content(), group_post(), hcard_init(), import_post(), import_xchan(), intro_content(), intro_post(), invite_content(), invite_post(), item_post(), like_content(), load_database(), lostpass_content(), lostpass_post(), magic_init(), manage_content(), match_content(), message_content(), message_post(), mood_content(), network_content(), network_init(), new_channel_content(), new_channel_post(), nogroup_content(), notifications_content(), notifications_post(), oexchange_content(), page_content(), photos_content(), photos_post(), poke_content(), post_init(), profile_content(), profile_init(), profile_load(), profile_photo_post(), profiles_content(), profiles_init(), profiles_post(), profperm_content(), dba\q(), register_content(), register_post(), regmod_content(), search_content(), settings_post(), setup_content(), suggest_content(), tagrm_post(), user_allow(), user_deny(), viewconnections_content(), viewsrc_content(), wall_attach_post(), wall_upload_post(), and xchan_content().
+Referenced by admin_page_dbsync(), admin_page_site_post(), admin_page_users(), allfriends_content(), api_content(), api_post(), apps_content(), attach_init(), authenticate_success(), channel_content(), channel_init(), chanview_content(), check_account_email(), check_account_invite(), check_form_security_std_err_msg(), check_keys(), check_php(), common_content(), common_init(), community_content(), connections_content(), connections_post(), crepair_content(), crepair_post(), delegate_content(), directory_content(), dirfind_content(), display_content(), drop_item(), editpost_content(), events_content(), events_post(), follow_init(), fsuggest_content(), fsuggest_post(), group_add(), group_content(), group_post(), hcard_init(), import_post(), import_xchan(), intro_content(), intro_post(), invite_content(), invite_post(), item_post(), like_content(), load_database(), lostpass_content(), lostpass_post(), magic_init(), manage_content(), match_content(), message_content(), message_post(), mood_content(), network_content(), network_init(), new_channel_content(), new_channel_post(), nogroup_content(), notifications_content(), notifications_post(), oexchange_content(), page_content(), photos_content(), photos_post(), poke_content(), post_init(), profile_content(), profile_init(), profile_load(), profile_photo_post(), profiles_content(), profiles_init(), profiles_post(), profperm_content(), register_content(), register_post(), regmod_content(), search_content(), settings_post(), setup_content(), suggest_content(), tagrm_post(), user_allow(), user_deny(), viewconnections_content(), viewsrc_content(), wall_attach_post(), wall_upload_post(), and xchan_content().
Public Attributes |
dba_driver::install | +( | ++ | $server, | +
+ | + | + | $user, | +
+ | + | + | $pass, | +
+ | + | + | $db | +
+ | ) | ++ |
Referenced by __construct().
+Referenced by __construct(), dba_mysqli\connect(), and dba_mysql\connect().
+Referenced by __construct(), dba_mysqli\connect(), dba_mysql\connect(), and install().
-Protected Member Functions | |
+Public Member Functions | |
connect ($server, $user, $pass, $db) | |
q ($sql) | |
close () | |
-Additional Inherited Members | |
![]() | |
connect ($server, $user, $pass, $db) | |
close () | |
__construct ($server, $user, $pass, $db, $install=false) | |
__construct ($server, $user, $pass, $db, $install=false) | |
install ($server, $user, $pass, $db) | |
+Additional Inherited Members | ||||||||
![]() | ||||||||
$connected = false | ||||||||
|
- -protected | -
|
- -protected | -
|
- -protected | -
|
- -protected | -
B |
T |
T |
I |
I |
C |
E |
Z |
E |
Z |
Referenced by add_fcontact(), advanced_profile(), age(), api_account_rate_limit_status(), api_date(), api_rss_extra(), atom_entry(), attach_store(), authenticate_success(), cal(), channel_content(), Cache\clear(), consume_feed(), create_account(), create_identity(), crepair_post(), cronhooks_run(), delete_item_lowlevel(), deliver_run(), dlogger(), dob(), ev_compare(), event_store(), events_content(), events_post(), first_post_date(), format_event_diaspora(), format_event_html(), fsuggest_post(), get_atom_elements(), get_birthdays(), get_events(), get_feed_for(), get_first_dim(), get_item_elements(), get_mail_elements(), get_profile_elements(), Item\get_template_data(), import_directory_profile(), invite_post(), item_post(), item_store(), item_store_update(), like_content(), local_delivery(), logger(), FKOAuth1\loginUser(), magic_init(), mail_store(), message_content(), network_content(), new_contact(), new_follower(), notification(), notifier_run(), onepoll_run(), photo_upload(), photos_post(), ping_init(), poco_load(), poller_run(), posted_dates(), profile_photo_post(), profiles_content(), profiles_post(), dba_mysqli\q(), dba_mysql\q(), dba\q(), queue_run(), relative_date(), send_message(), send_reg_approval_email(), Cache\set(), settings_post(), Photo\store(), update_modtime(), update_queue_time(), z_birthday(), zot_feed(), zot_process_response(), zot_refresh(), and zotfeed_init().
+Referenced by add_fcontact(), advanced_profile(), age(), api_account_rate_limit_status(), api_date(), api_rss_extra(), atom_entry(), attach_store(), authenticate_success(), cal(), channel_content(), Cache\clear(), consume_feed(), create_account(), create_identity(), crepair_post(), cronhooks_run(), delete_item_lowlevel(), deliver_run(), dlogger(), dob(), ev_compare(), event_store(), events_content(), events_post(), first_post_date(), format_event_diaspora(), format_event_html(), fsuggest_post(), get_atom_elements(), get_birthdays(), get_events(), get_feed_for(), get_first_dim(), get_item_elements(), get_mail_elements(), get_profile_elements(), Item\get_template_data(), import_directory_profile(), invite_post(), item_post(), item_store(), item_store_update(), like_content(), local_delivery(), logger(), FKOAuth1\loginUser(), magic_init(), mail_store(), message_content(), network_content(), new_contact(), new_follower(), notification(), notifier_run(), onepoll_run(), photo_upload(), photos_post(), ping_init(), poco_load(), poller_run(), posted_dates(), profile_photo_post(), profiles_content(), profiles_post(), dba_mysqli\q(), dba_mysql\q(), queue_run(), relative_date(), send_message(), send_reg_approval_email(), Cache\set(), settings_post(), Photo\store(), update_modtime(), update_queue_time(), z_birthday(), zot_feed(), zot_process_response(), zot_refresh(), and zotfeed_init().
-Variables | |
$a = new App | |
$lang = get_best_language() | |
$db = new dba($db_host, $db_user, $db_pass, $db_data, false) | |
$build = get_config('system','build') | |
$a = new App | -
Referenced by FriendicaSmarty\__construct(), Item\__construct(), Template\_replcb_if(), Template\_replcb_inc(), _well_known_init(), acl_init(), admin_content(), admin_page_dbsync(), admin_page_logs(), admin_page_logs_post(), admin_page_plugins(), admin_page_site(), admin_page_site_post(), admin_page_summary(), admin_page_themes(), admin_page_users(), admin_page_users_post(), admin_post(), advanced_profile(), allfriends_content(), allowed_email(), allowed_url(), alt_pager(), api_account_verify_credentials(), api_apply_template(), api_call(), api_content(), api_direct_messages_all(), api_direct_messages_box(), api_direct_messages_conversation(), api_direct_messages_inbox(), api_direct_messages_new(), api_direct_messages_sentbox(), api_favorites(), api_followers_ids(), api_format_as(), api_format_items(), api_friends_ids(), api_get_user(), api_item_get_user(), api_login(), api_post(), api_rss_extra(), api_status_show(), api_statuses_destroy(), api_statuses_f(), api_statuses_followers(), api_statuses_friends(), api_statuses_home_timeline(), api_statuses_mediap(), api_statuses_mentions(), api_statuses_public_timeline(), api_statuses_repeat(), api_statuses_show(), api_statuses_update(), api_statuses_user_timeline(), api_statusnet_config(), api_users_show(), apps_content(), atom_entry(), attribute_contains(), authenticate_success(), avatar_img(), bbcode(), best_link_url(), cal(), categories_widget(), channel_aside(), channel_content(), channel_init(), channel_remove(), chanview_content(), check_config(), check_form_security_token(), check_form_security_token_ForbiddenOnErr(), check_form_security_token_redirectOnErr(), check_htaccess(), clean_urls(), cli_startup(), common_aside(), common_content(), common_friends_visitor_widget(), common_init(), community_content(), connections_aside(), connections_content(), connections_init(), connections_post(), construct_page(), consume_feed(), contact_block(), contact_select(), create_identity(), crepair_content(), crepair_init(), crepair_post(), current_theme(), current_theme_url(), del_config(), del_pconfig(), del_xconfig(), delegate_content(), deliver_run(), dfrn_deliver(), directory_aside(), directory_content(), directory_init(), dirfind_content(), dirfind_init(), dirsearch_init(), display_content(), dlogger(), drop_item(), editpost_content(), ev_compare(), event_store(), events_content(), events_post(), expand_acl(), expand_groups(), fbrowser_content(), fetch_url(), fileas_widget(), filer_content(), filerm_content(), findpeople_widget(), fix_private_photos(), follow_init(), format_event_diaspora(), fsuggest_content(), fsuggest_post(), BaseObject\get_app(), get_app(), get_best_language(), get_birthdays(), Item\get_comment_box(), get_config(), get_events(), get_feed_for(), get_form_security_token(), get_max_import_size(), get_pconfig(), get_plink(), Item\get_template_data(), get_theme_screenshot(), get_xconfig(), gprobe_run(), group_aside(), group_content(), group_post(), group_select(), guess_image_type(), handle_tag(), hcard_aside(), hcard_init(), help_content(), hostxrd_init(), import_channel_photo(), import_profile_photo(), info(), intro_aside(), intro_content(), invite_content(), invite_post(), is_site_admin(), item_content(), item_post(), lang_selector(), like_content(), link_compare(), load_config(), load_contact_links(), load_database(), load_pconfig(), load_translation_table(), load_xconfig(), local_delivery(), logger(), login(), login_content(), FKOAuth1\loginUser(), lostpass_content(), lostpass_post(), lrdd(), magic_init(), manual_config(), match_content(), message_aside(), message_content(), message_post(), mood_init(), msearch_post(), nav(), nav_set_selected(), network_content(), network_init(), new_contact(), new_follower(), nogroup_content(), nogroup_init(), notice(), notification(), notifications_content(), notifications_post(), notifier_run(), notify_content(), notify_init(), oembed_fetch_url(), oembed_format_object(), oembed_iframe(), oexchange_content(), oexchange_init(), onepoll_run(), opensearch_init(), page_content(), paginate(), photos_content(), photos_init(), photos_post(), ping_init(), poco_init(), poco_load(), poke_init(), poller_run(), pop_lang(), post_init(), post_url(), preg_heart(), prepare_body(), probe_content(), proc_run(), profile_activity(), profile_aside(), profile_content(), profile_create_sidebar(), profile_init(), profile_load(), profile_photo_aside(), profile_photo_init(), profile_photo_post(), profile_sidebar(), profile_tabs(), profiles_aside(), profiles_content(), profiles_init(), profiles_post(), profperm_aside(), profperm_content(), profperm_init(), push_lang(), dba\q(), queue_run(), randprof_init(), redbasic_form(), redbasic_init(), redir_init(), register_content(), regmod_content(), relative_date(), removeme_content(), removeme_post(), replace_macros(), rmagic_post(), saved_searches(), scale_external_images(), search(), search_ac_init(), search_content(), search_init(), search_post(), send_message(), service_class_allows(), service_class_fetch(), set_config(), Conversation\set_mode(), set_pconfig(), set_xconfig(), settings_aside(), settings_post(), setup_content(), setup_post(), siteinfo_content(), siteinfo_init(), smilies(), subthread_content(), suggest_aside(), suggest_content(), t(), tag_deliver(), tagger_content(), tagrm_content(), tagrm_post(), tags_sort(), terminate_friendship(), tgroup_check(), theme_content(), theme_include(), timezone_cmp(), toggle_mobile_init(), tt(), uexport_init(), update_channel_content(), update_community_content(), update_display_content(), update_network_content(), update_suggestions(), user_allow(), viewconnections_aside(), viewconnections_content(), viewconnections_init(), viewsrc_content(), wall_upload_post(), wfinger_init(), what_next(), xrd_init(), z_fetch_url(), z_path(), z_root(), zid_init(), and zotfeed_init().
- -$build = get_config('system','build') | -
Referenced by check_config().
- -$db = new dba($db_host, $db_user, $db_pass, $db_data, false) | -
Referenced by cli_startup(), dbesc(), dbg(), dbq(), dlogger(), load_database(), logger(), q(), setup_content(), and setup_post().
- -$lang = get_best_language() | -
Referenced by get_best_language(), get_browser_language(), help_content(), po2php_run(), and regmod_content().
- --Classes | |
class | dba |
-Functions | |
printable ($s) | |
dbg ($state) | |
dbesc ($str) | |
q ($sql) | |
dbq ($sql) | |
dbesc_array_cb (&$item, $key) | |
dbesc_array (&$arr) | |
dbesc | -( | -- | $str | ) | -- |
Referenced by account_verify_password(), acl_init(), add_fcontact(), allowed_public_recips(), api_direct_messages_new(), api_get_user(), api_status_show(), api_statuses_mentions(), api_user(), api_users_show(), attach_by_hash(), attach_by_hash_nodata(), attach_count_files(), attach_list_files(), attach_store(), authenticate_success(), change_channel(), channel_content(), channelx_by_hash(), channelx_by_n(), channelx_by_nick(), chanview_content(), check_account_email(), check_account_invite(), check_webbie(), Cache\clear(), common_friends(), connections_content(), consume_feed(), contact_remove(), contactgroup_content(), count_common_friends(), create_account(), create_identity(), crepair_post(), dbesc_array_cb(), del_config(), del_pconfig(), del_xconfig(), delegate_content(), delete_imported_item(), delete_item_lowlevel(), deliver_run(), dirsearch_content(), display_content(), editpost_content(), event_store(), events_content(), expand_groups(), fbrowser_content(), feed_init(), fetch_post_tags(), file_tag_file_query(), file_tag_save_file(), file_tag_unsave_file(), filerm_content(), fix_attached_photo_permissions(), fix_contact_ssl_policy(), fix_private_photos(), fix_system_urls(), fsuggest_post(), generate_user_guid(), Cache\get(), get_all_perms(), get_birthdays(), get_config(), get_events(), get_feed_for(), get_pconfig(), get_xconfig(), gprobe_run(), group_add(), group_add_member(), group_byname(), group_content(), group_post(), group_rec_byhash(), group_rmv(), group_rmv_member(), groups_containing(), handle_tag(), import_author_xchan(), import_directory_keywords(), import_directory_profile(), import_post(), import_profile_photo(), import_xchan(), invite_post(), item_message_id(), item_permissions_sql(), item_post(), item_store(), item_store_update(), like_content(), load_config(), load_pconfig(), load_xconfig(), local_delivery(), lockview_content(), FKOAuth1\loginUser(), FKOAuthDataStore\lookup_consumer(), FKOAuthDataStore\lookup_nonce(), FKOAuthDataStore\lookup_token(), lostpass_content(), lostpass_post(), magic_init(), mail_store(), member_of(), msearch_post(), network_content(), network_init(), FKOAuthDataStore\new_access_token(), new_contact(), new_cookie(), new_follower(), FKOAuthDataStore\new_request_token(), notification(), notifications_content(), notifier_run(), notify_init(), oauth_get_client(), onepoll_run(), page_content(), perm_is_allowed(), permissions_sql(), photo_init(), photo_new_resource(), photo_upload(), photos_album_exists(), photos_album_get_db_idstr(), photos_album_rename(), photos_content(), photos_post(), ping_init(), poco_init(), poco_load(), poller_run(), post_init(), post_post(), private_messages_drop(), private_messages_fetch_conversation(), private_messages_fetch_message(), private_messages_list(), process_delivery(), process_mail_delivery(), profile_init(), profile_load(), profile_photo_post(), profiles_init(), profiles_post(), public_permissions_sql(), public_recips(), qsearch_init(), queue_run(), red_zrl_callback(), redir_init(), register_post(), remove_all_xchan_resources(), remove_queue_item(), rmagic_init(), rmagic_post(), search_ac_init(), search_content(), search_init(), send_message(), send_reg_approval_email(), send_status_notifications(), Cache\set(), set_config(), set_pconfig(), set_xconfig(), settings_post(), siteinfo_init(), Photo\store(), store_item_tag(), stringify_array_elms(), subthread_content(), suggest_init(), suggestion_query(), sync_directories(), syncdirs(), tag_deliver(), tagger_content(), tagrm_post(), term_query(), update_modtime(), update_queue_time(), user_allow(), user_deny(), vcard_from_xchan(), wall_attach_post(), wall_upload_post(), wfinger_init(), xchan_content(), xchan_mail_query(), xchan_query(), xrd_init(), z_readdir(), zfinger_init(), zid_init(), zot_finger(), zot_get_hubloc(), zot_gethub(), zot_process_response(), zot_refresh(), and zotfeed_init().
- -dbesc_array | -( | -& | -$arr | ) | -- |
Referenced by import_post(), item_store(), item_store_update(), local_delivery(), mail_store(), and profiles_init().
- -dbesc_array_cb | -( | -& | -$item, | -
- | - | - | $key | -
- | ) | -- |
dbg | -( | -- | $state | ) | -- |
dbq | -( | -- | $sql | ) | -- |
Raw db query, no arguments
- -Referenced by import_post(), item_store(), item_store_update(), local_delivery(), mail_store(), and profiles_init().
- -printable | -( | -- | $s | ) | -- |
Referenced by dba_mysqli\q(), dba_mysql\q(), and dba\q().
- -q | -( | -- | $sql | ) | -- |
This will happen occasionally trying to store the session data after abnormal program termination
- -Referenced by abook_connections(), abook_self(), abook_toggle_flag(), account_total(), account_verify_password(), acl_init(), add_fcontact(), admin_content(), admin_page_dbsync(), admin_page_summary(), admin_page_users(), admin_page_users_post(), all_friends(), allfriends_content(), allowed_public_recips(), api_direct_messages_box(), api_direct_messages_new(), api_favorites(), api_ff_ids(), api_format_items(), api_get_user(), api_status_show(), api_statuses_f(), api_statuses_home_timeline(), api_statuses_mentions(), api_statuses_public_timeline(), api_statuses_repeat(), api_statuses_show(), api_statuses_user_timeline(), api_user(), api_users_show(), attach_by_hash(), attach_by_hash_nodata(), attach_count_files(), attach_list_files(), attach_store(), authenticate_success(), categories_widget(), change_channel(), channel_content(), channel_remove(), channelx_by_hash(), channelx_by_n(), channelx_by_nick(), chanview_content(), check_account_email(), check_account_invite(), check_config(), check_webbie(), Cache\clear(), collect_recipients(), common_friends(), common_friends_zcid(), common_init(), community_content(), connections_content(), connections_init(), connections_post(), consume_feed(), contact_block(), contact_profile_assign(), contact_remove(), contact_select(), contactgroup_content(), contacts_not_grouped(), count_all_friends(), count_common_friends(), count_common_friends_zcid(), create_account(), create_identity(), crepair_content(), crepair_init(), crepair_post(), del_config(), del_pconfig(), del_xconfig(), delegate_content(), delete_imported_item(), delete_item_lowlevel(), deliver_run(), dfrn_deliver(), directory_run(), dirsearch_content(), display_content(), drop_item(), editpost_content(), encode_item(), event_store(), events_content(), expand_groups(), expire_run(), fbrowser_content(), feed_init(), fetch_post_tags(), file_tag_save_file(), file_tag_unsave_file(), file_tag_update_pconfig(), fileas_widget(), filer_content(), filerm_content(), first_post_date(), fix_attached_photo_permissions(), fix_contact_ssl_policy(), fix_private_photos(), fix_system_urls(), fsuggest_content(), fsuggest_post(), generate_user_guid(), Cache\get(), get_all_perms(), get_birthdays(), get_config(), get_events(), get_feed_for(), get_pconfig(), get_xconfig(), gprobe_run(), group_add(), group_add_member(), group_byname(), group_content(), group_get_members(), group_post(), group_rec_byhash(), group_rmv(), group_rmv_member(), group_select(), group_side(), groups_containing(), handle_tag(), identity_basic_export(), identity_check_service_class(), import_author_xchan(), import_directory_keywords(), import_directory_profile(), import_post(), import_profile_photo(), import_xchan(), intro_content(), intro_post(), invite_post(), item_expire(), item_message_id(), item_post(), item_store(), item_store_update(), like_content(), load_config(), load_contact_links(), load_pconfig(), load_translation_table(), load_xconfig(), local_delivery(), lockview_content(), FKOAuth1\loginUser(), FKOAuthDataStore\lookup_consumer(), FKOAuthDataStore\lookup_nonce(), FKOAuthDataStore\lookup_token(), lose_follower(), lose_sharer(), lostpass_content(), lostpass_post(), magic_init(), mail_store(), manage_content(), match_content(), member_of(), message_content(), mini_group_select(), mood_init(), msearch_post(), network_content(), network_init(), FKOAuthDataStore\new_access_token(), new_contact(), new_cookie(), new_follower(), FKOAuthDataStore\new_request_token(), notification(), notifications_content(), notifications_post(), notifier_run(), notify_content(), notify_init(), oauth_get_client(), onepoll_run(), page_content(), perm_is_allowed(), photo_init(), photo_new_resource(), photo_upload(), photos_album_exists(), photos_album_get_db_idstr(), photos_album_rename(), photos_albums_list(), photos_content(), photos_post(), ping_init(), poco_init(), poco_load(), poke_content(), poke_init(), poller_run(), post_init(), post_post(), private_messages_drop(), private_messages_fetch_conversation(), private_messages_fetch_message(), private_messages_list(), process_delivery(), process_mail_delivery(), profile_content(), profile_init(), profile_load(), profile_photo_post(), profile_sidebar(), profiles_content(), profiles_init(), profiles_post(), profperm_content(), public_recips(), qsearch_init(), queue_run(), random_profile(), red_zrl_callback(), redir_init(), register_content(), register_post(), remove_all_xchan_resources(), remove_queue_item(), rmagic_init(), rmagic_post(), saved_searches(), search_ac_init(), search_content(), search_init(), search_saved_searches(), send_message(), send_reg_approval_email(), send_status_notifications(), service_class_allows(), service_class_fetch(), Cache\set(), set_config(), set_default_login_identity(), set_pconfig(), set_xconfig(), settings_aside(), settings_post(), setup_content(), share_init(), siteinfo_content(), siteinfo_init(), starred_init(), Photo\store(), store_item_tag(), stream_perms_api_uids(), subthread_content(), suggest_init(), suggestion_query(), sync_directories(), syncdirs(), tag_deliver(), tagadelic(), tagger_content(), tagrm_content(), tagrm_post(), tgroup_check(), update_modtime(), update_queue_time(), update_suggestions(), user_allow(), user_deny(), vcard_from_xchan(), viewconnections_content(), viewsrc_content(), wall_attach_post(), wall_upload_post(), wfinger_init(), xchan_content(), xchan_mail_query(), xchan_query(), xrd_init(), z_readdir(), zfinger_init(), zid_init(), zot_feed(), zot_finger(), zot_get_hubloc(), zot_gethub(), zot_import(), zot_process_response(), zot_refresh(), and zotfeed_init().
- -+Functions | |
dba_factory ($server, $user, $pass, $db, $install=false) | |
printable ($s) | |
dbg ($state) | |
dbesc ($str) | |
q ($sql) | |
dbq ($sql) | |
dbesc_array_cb (&$item, $key) | |
dbesc_array (&$arr) | |
dba_factory | +( | ++ | $server, | +
+ | + | + | $user, | +
+ | + | + | $pass, | +
+ | + | + | $db, | +
+ | + | + | $install = false |
+
+ | ) | ++ |
Referenced by cli_startup(), and setup_post().
+ +dbesc | +( | ++ | $str | ) | ++ |
Referenced by account_verify_password(), acl_init(), add_fcontact(), allowed_public_recips(), api_direct_messages_new(), api_get_user(), api_status_show(), api_statuses_mentions(), api_user(), api_users_show(), attach_by_hash(), attach_by_hash_nodata(), attach_count_files(), attach_list_files(), attach_store(), authenticate_success(), change_channel(), channel_content(), channelx_by_hash(), channelx_by_n(), channelx_by_nick(), chanview_content(), check_account_email(), check_account_invite(), check_webbie(), Cache\clear(), common_friends(), connections_content(), consume_feed(), contact_remove(), contactgroup_content(), count_common_friends(), create_account(), create_identity(), crepair_post(), dbesc_array_cb(), del_config(), del_pconfig(), del_xconfig(), delegate_content(), delete_imported_item(), delete_item_lowlevel(), deliver_run(), dirsearch_content(), display_content(), editpost_content(), event_store(), events_content(), expand_groups(), fbrowser_content(), feed_init(), fetch_post_tags(), file_tag_file_query(), file_tag_save_file(), file_tag_unsave_file(), filerm_content(), fix_attached_photo_permissions(), fix_contact_ssl_policy(), fix_private_photos(), fix_system_urls(), fsuggest_post(), generate_user_guid(), Cache\get(), get_all_perms(), get_birthdays(), get_config(), get_events(), get_feed_for(), get_pconfig(), get_xconfig(), gprobe_run(), group_add(), group_add_member(), group_byname(), group_content(), group_post(), group_rec_byhash(), group_rmv(), group_rmv_member(), groups_containing(), handle_tag(), import_author_xchan(), import_directory_keywords(), import_directory_profile(), import_post(), import_profile_photo(), import_xchan(), invite_post(), item_message_id(), item_permissions_sql(), item_post(), item_store(), item_store_update(), like_content(), load_config(), load_pconfig(), load_xconfig(), local_delivery(), lockview_content(), FKOAuth1\loginUser(), FKOAuthDataStore\lookup_consumer(), FKOAuthDataStore\lookup_nonce(), FKOAuthDataStore\lookup_token(), lostpass_content(), lostpass_post(), magic_init(), mail_store(), member_of(), msearch_post(), network_content(), network_init(), FKOAuthDataStore\new_access_token(), new_contact(), new_cookie(), new_follower(), FKOAuthDataStore\new_request_token(), notification(), notifications_content(), notifier_run(), notify_init(), oauth_get_client(), onepoll_run(), page_content(), perm_is_allowed(), permissions_sql(), photo_init(), photo_new_resource(), photo_upload(), photos_album_exists(), photos_album_get_db_idstr(), photos_album_rename(), photos_content(), photos_post(), ping_init(), poco_init(), poco_load(), poller_run(), post_init(), post_post(), private_messages_drop(), private_messages_fetch_conversation(), private_messages_fetch_message(), private_messages_list(), process_delivery(), process_mail_delivery(), profile_init(), profile_load(), profile_photo_post(), profiles_init(), profiles_post(), public_permissions_sql(), public_recips(), qsearch_init(), queue_run(), red_zrl_callback(), redir_init(), register_post(), remove_all_xchan_resources(), remove_queue_item(), rmagic_init(), rmagic_post(), search_ac_init(), search_content(), search_init(), send_message(), send_reg_approval_email(), send_status_notifications(), Cache\set(), set_config(), set_pconfig(), set_xconfig(), settings_post(), siteinfo_init(), Photo\store(), store_item_tag(), stringify_array_elms(), subthread_content(), suggest_init(), suggestion_query(), sync_directories(), syncdirs(), tag_deliver(), tagger_content(), tagrm_post(), term_query(), update_modtime(), update_queue_time(), user_allow(), user_deny(), vcard_from_xchan(), wall_attach_post(), wall_upload_post(), wfinger_init(), xchan_content(), xchan_mail_query(), xchan_query(), xrd_init(), z_readdir(), zfinger_init(), zid_init(), zot_finger(), zot_get_hubloc(), zot_gethub(), zot_process_response(), zot_refresh(), and zotfeed_init().
+ +dbesc_array | +( | +& | +$arr | ) | ++ |
Referenced by import_post(), item_store(), item_store_update(), local_delivery(), mail_store(), and profiles_init().
+ +dbesc_array_cb | +( | +& | +$item, | +
+ | + | + | $key | +
+ | ) | ++ |
dbg | +( | ++ | $state | ) | ++ |
dbq | +( | ++ | $sql | ) | ++ |
Raw db query, no arguments
+ +Referenced by import_post(), item_store(), item_store_update(), local_delivery(), mail_store(), and profiles_init().
+ +printable | +( | ++ | $s | ) | ++ |
Referenced by dba_mysqli\q(), and dba_mysql\q().
+ +q | +( | ++ | $sql | ) | ++ |
This will happen occasionally trying to store the session data after abnormal program termination
+ +Referenced by abook_connections(), abook_self(), abook_toggle_flag(), account_total(), account_verify_password(), acl_init(), add_fcontact(), admin_content(), admin_page_dbsync(), admin_page_summary(), admin_page_users(), admin_page_users_post(), all_friends(), allfriends_content(), allowed_public_recips(), api_direct_messages_box(), api_direct_messages_new(), api_favorites(), api_ff_ids(), api_format_items(), api_get_user(), api_status_show(), api_statuses_f(), api_statuses_home_timeline(), api_statuses_mentions(), api_statuses_public_timeline(), api_statuses_repeat(), api_statuses_show(), api_statuses_user_timeline(), api_user(), api_users_show(), attach_by_hash(), attach_by_hash_nodata(), attach_count_files(), attach_list_files(), attach_store(), authenticate_success(), categories_widget(), change_channel(), channel_content(), channel_remove(), channelx_by_hash(), channelx_by_n(), channelx_by_nick(), chanview_content(), check_account_email(), check_account_invite(), check_config(), check_webbie(), Cache\clear(), collect_recipients(), common_friends(), common_friends_zcid(), common_init(), community_content(), connections_content(), connections_init(), connections_post(), consume_feed(), contact_block(), contact_profile_assign(), contact_remove(), contact_select(), contactgroup_content(), contacts_not_grouped(), count_all_friends(), count_common_friends(), count_common_friends_zcid(), create_account(), create_identity(), crepair_content(), crepair_init(), crepair_post(), del_config(), del_pconfig(), del_xconfig(), delegate_content(), delete_imported_item(), delete_item_lowlevel(), deliver_run(), dfrn_deliver(), directory_run(), dirsearch_content(), display_content(), drop_item(), editpost_content(), encode_item(), event_store(), events_content(), expand_groups(), expire_run(), fbrowser_content(), feed_init(), fetch_post_tags(), file_tag_save_file(), file_tag_unsave_file(), file_tag_update_pconfig(), fileas_widget(), filer_content(), filerm_content(), first_post_date(), fix_attached_photo_permissions(), fix_contact_ssl_policy(), fix_private_photos(), fix_system_urls(), fsuggest_content(), fsuggest_post(), generate_user_guid(), Cache\get(), get_all_perms(), get_birthdays(), get_config(), get_events(), get_feed_for(), get_pconfig(), get_xconfig(), gprobe_run(), group_add(), group_add_member(), group_byname(), group_content(), group_get_members(), group_post(), group_rec_byhash(), group_rmv(), group_rmv_member(), group_select(), group_side(), groups_containing(), handle_tag(), identity_basic_export(), identity_check_service_class(), import_author_xchan(), import_directory_keywords(), import_directory_profile(), import_post(), import_profile_photo(), import_xchan(), intro_content(), intro_post(), invite_post(), item_expire(), item_message_id(), item_post(), item_store(), item_store_update(), like_content(), load_config(), load_contact_links(), load_pconfig(), load_translation_table(), load_xconfig(), local_delivery(), lockview_content(), FKOAuth1\loginUser(), FKOAuthDataStore\lookup_consumer(), FKOAuthDataStore\lookup_nonce(), FKOAuthDataStore\lookup_token(), lose_follower(), lose_sharer(), lostpass_content(), lostpass_post(), magic_init(), mail_store(), manage_content(), match_content(), member_of(), message_content(), mini_group_select(), mood_init(), msearch_post(), network_content(), network_init(), FKOAuthDataStore\new_access_token(), new_contact(), new_cookie(), new_follower(), FKOAuthDataStore\new_request_token(), notification(), notifications_content(), notifications_post(), notifier_run(), notify_content(), notify_init(), oauth_get_client(), onepoll_run(), page_content(), perm_is_allowed(), photo_init(), photo_new_resource(), photo_upload(), photos_album_exists(), photos_album_get_db_idstr(), photos_album_rename(), photos_albums_list(), photos_content(), photos_post(), ping_init(), poco_init(), poco_load(), poke_content(), poke_init(), poller_run(), post_init(), post_post(), private_messages_drop(), private_messages_fetch_conversation(), private_messages_fetch_message(), private_messages_list(), process_delivery(), process_mail_delivery(), profile_content(), profile_init(), profile_load(), profile_photo_post(), profile_sidebar(), profiles_content(), profiles_init(), profiles_post(), profperm_content(), public_recips(), qsearch_init(), queue_run(), random_profile(), red_zrl_callback(), redir_init(), register_content(), register_post(), remove_all_xchan_resources(), remove_queue_item(), rmagic_init(), rmagic_post(), saved_searches(), search_ac_init(), search_content(), search_init(), search_saved_searches(), send_message(), send_reg_approval_email(), send_status_notifications(), service_class_allows(), service_class_fetch(), Cache\set(), set_config(), set_default_login_identity(), set_pconfig(), set_xconfig(), settings_aside(), settings_post(), setup_content(), share_init(), siteinfo_content(), siteinfo_init(), starred_init(), Photo\store(), store_item_tag(), stream_perms_api_uids(), subthread_content(), suggest_init(), suggestion_query(), sync_directories(), syncdirs(), tag_deliver(), tagadelic(), tagger_content(), tagrm_content(), tagrm_post(), tgroup_check(), update_modtime(), update_queue_time(), update_suggestions(), user_allow(), user_deny(), vcard_from_xchan(), viewconnections_content(), viewsrc_content(), wall_attach_post(), wall_upload_post(), wfinger_init(), xchan_content(), xchan_mail_query(), xchan_query(), xrd_init(), z_readdir(), zfinger_init(), zid_init(), zot_feed(), zot_finger(), zot_get_hubloc(), zot_gethub(), zot_import(), zot_process_response(), zot_refresh(), and zotfeed_init().
+ +Referenced by activity_sanitise(), add_fcontact(), api_rss_extra(), array_sanitise(), attach_store(), check_account_admin(), check_account_email(), check_account_invite(), check_account_password(), check_list_permissions(), check_webbie(), connections_content(), construct_page(), contact_block(), contact_select(), create_account(), create_identity(), dbesc_array(), directory_content(), event_store(), feature_enabled(), fetch_xrd_links(), find_xchan_in_array(), get_all_perms(), get_atom_elements(), get_features(), get_item_elements(), get_mail_elements(), get_mood_verbs(), get_poke_verbs(), get_profile_elements(), Item\get_template_data(), get_terms_oftype(), App\get_widgets(), group_select(), identity_basic_import(), ids_to_querystr(), import_directory_profile(), import_post(), import_xchan(), item_getfeedattach(), item_store(), item_store_update(), like_content(), load_database(), lrdd(), magic_init(), mail_store(), mood_init(), network_content(), new_channel_post(), new_contact(), parse_url_content(), perm_is_allowed(), photo_upload(), photos_album_get_db_idstr(), photos_create_item(), photos_post(), ping_init(), po2php_run(), poke_init(), post_activity_item(), post_post(), prepare_body(), proc_run(), process_delivery(), process_mail_delivery(), process_profile_delivery(), profile_activity(), profile_sidebar(), profile_tabs(), profiles_content(), register_post(), send_reg_approval_email(), service_class_allows(), service_class_fetch(), App\set_apps(), settings_post(), sort_by_date(), stringify_array_elms(), subthread_content(), suggest_content(), tagger_content(), tagrm_content(), tagrm_post(), validate_channelname(), wfinger_init(), xchan_mail_query(), xchan_query(), xml2array(), xrd_init(), zfinger_init(), zid(), zid_init(), zot_fetch(), zot_get_hubloc(), zot_gethub(), zot_import(), zot_process_response(), and zot_register_hub().
+Referenced by activity_sanitise(), add_fcontact(), api_rss_extra(), array_sanitise(), attach_store(), check_account_admin(), check_account_email(), check_account_invite(), check_account_password(), check_list_permissions(), check_webbie(), connections_content(), construct_page(), contact_block(), contact_select(), create_account(), create_identity(), dbesc_array(), directory_content(), event_store(), feature_enabled(), fetch_xrd_links(), find_xchan_in_array(), get_all_perms(), get_atom_elements(), get_features(), get_item_elements(), get_mail_elements(), get_mood_verbs(), get_poke_verbs(), get_profile_elements(), Item\get_template_data(), get_terms_oftype(), App\get_widgets(), group_select(), identity_basic_import(), ids_to_querystr(), import_directory_profile(), import_post(), import_xchan(), item_getfeedattach(), item_store(), item_store_update(), like_content(), load_database(), lrdd(), magic_init(), mail_store(), mood_init(), network_content(), new_channel_post(), new_contact(), parse_url_content(), perm_is_allowed(), photo_upload(), photos_album_get_db_idstr(), photos_create_item(), photos_post(), ping_init(), po2php_run(), poke_init(), post_activity_item(), post_post(), prepare_body(), proc_run(), process_delivery(), process_mail_delivery(), process_profile_delivery(), profile_activity(), profile_sidebar(), profile_tabs(), profiles_content(), register_post(), send_reg_approval_email(), service_class_allows(), service_class_fetch(), App\set_apps(), settings_post(), sort_by_date(), stringify_array_elms(), subthread_content(), suggest_content(), tagger_content(), tagrm_content(), tagrm_post(), validate_channelname(), wfinger_init(), xchan_mail_query(), xchan_query(), xml2array(), xrd_init(), zfinger_init(), zid(), zid_init(), zot_fetch(), zot_get_hubloc(), zot_gethub(), zot_import(), zot_process_response(), and zot_register_hub().
Referenced by Template\_build_nodes(), Template\_replcb_node(), admin_page_themes(), attribute_contains(), base64url_decode(), base64url_encode(), bb_tag_preg_replace(), bb_translate_video(), bbtoevent(), bbtovcal(), chanlink_hash(), chanlink_url(), datetime_convert(), day_translate(), detect_language(), diaspora2bb(), diaspora_ol(), diaspora_ul(), expand_acl(), fetch_url(), file_tag_decode(), file_tag_encode(), file_tag_file_query(), fix_mce_lf(), fix_private_photos(), format_term_for_display(), get_bb_tag_pos(), get_tags(), html2bb_video(), info(), is_a_date_arg(), legal_webbie(), linkify(), magic_link(), network_to_name(), normalise_openid(), notice(), notifier_run(), oembed_iframe(), oembed_replacecb(), oexchange_content(), parse_xml_string(), photos_post(), poco_load(), post_url(), prepare_body(), printable(), private_messages_fetch_conversation(), private_messages_fetch_message(), private_messages_list(), protect_sprintf(), qp(), random_string(), Template\replace(), replace_macros(), scale_external_images(), search(), App\set_widget(), siteinfo_content(), smilies(), stripdcode_br_cb(), t(), template_escape(), template_unescape(), term_query(), unamp(), undo_post_tagging(), unxmlify(), Template\var_replace(), webfinger(), webfinger_dfrn(), x(), z_fetch_url(), z_post_url(), zfinger_init(), and zid().
+Referenced by Template\_build_nodes(), Template\_replcb_node(), admin_page_themes(), attribute_contains(), base64url_decode(), base64url_encode(), bb_tag_preg_replace(), bb_translate_video(), bbtoevent(), bbtovcal(), chanlink_hash(), chanlink_url(), datetime_convert(), day_translate(), detect_language(), diaspora2bb(), diaspora_ol(), diaspora_ul(), expand_acl(), fetch_url(), file_tag_decode(), file_tag_encode(), file_tag_file_query(), fix_mce_lf(), fix_private_photos(), format_term_for_display(), get_bb_tag_pos(), get_tags(), html2bb_video(), info(), is_a_date_arg(), legal_webbie(), linkify(), magic_link(), network_to_name(), normalise_openid(), notice(), notifier_run(), oembed_iframe(), oembed_replacecb(), oexchange_content(), parse_xml_string(), photos_post(), poco_load(), post_url(), prepare_body(), printable(), private_messages_fetch_conversation(), private_messages_fetch_message(), private_messages_list(), protect_sprintf(), qp(), random_string(), Template\replace(), replace_macros(), scale_external_images(), search(), App\set_widget(), siteinfo_content(), smilies(), stripdcode_br_cb(), t(), template_escape(), template_unescape(), term_query(), unamp(), undo_post_tagging(), unxmlify(), Template\var_replace(), webfinger(), webfinger_dfrn(), x(), z_fetch_url(), z_post_url(), zfinger_init(), and zid().
Referenced by dba_driver\__construct(), dba\__construct(), admin_content(), admin_page_dbsync(), admin_page_logs(), admin_page_logs_post(), admin_page_plugins(), admin_page_site(), admin_page_site_post(), admin_page_summary(), admin_page_themes(), admin_page_users(), admin_post(), advanced_profile(), allfriends_content(), alt_pager(), api_content(), api_post(), api_statuses_public_timeline(), apps_content(), attach_by_hash(), attach_by_hash_nodata(), attach_count_files(), attach_init(), attach_list_files(), attach_store(), authenticate_success(), bb_ShareAttributes(), bbcode(), categories_widget(), channel_content(), channel_init(), chanview_content(), check_account_email(), check_account_invite(), check_config(), check_form_security_std_err_msg(), check_funcs(), check_htaccess(), check_htconfig(), check_keys(), check_php(), check_smarty3(), common_content(), common_friends_visitor_widget(), common_init(), community_content(), connections_content(), connections_post(), construct_page(), consume_feed(), contact_block(), contact_poll_interval(), contact_reputation(), create_account(), create_identity(), crepair_content(), crepair_post(), datesel_format(), day_translate(), delegate_content(), directory_content(), dirfind_content(), dirsearch_content(), display_content(), drop_item(), editpost_content(), events_content(), events_post(), fbrowser_content(), file_tag_save_file(), fileas_widget(), filer_content(), findpeople_widget(), fix_attached_photo_permissions(), follow_init(), follow_widget(), format_event_diaspora(), format_event_html(), format_notification(), fsuggest_content(), fsuggest_post(), gender_selector(), get_birthdays(), Item\get_comment_box(), get_events(), get_features(), get_mood_verbs(), get_perms(), get_plink(), get_poke_verbs(), Item\get_template_data(), group_add(), group_content(), group_post(), group_side(), hcard_init(), help_content(), identity_check_service_class(), import_channel_photo(), import_content(), import_post(), import_xchan(), intro_content(), intro_post(), invite_content(), invite_post(), item_post(), item_post_type(), lang_selector(), like_content(), load_database(), localize_item(), lockview_content(), login(), lostpass_content(), lostpass_post(), magic_init(), manage_content(), manual_config(), marital_selector(), match_content(), message_aside(), message_content(), message_post(), mini_group_select(), mood_content(), mood_init(), nav(), network_content(), network_init(), network_to_name(), new_channel_content(), new_channel_post(), new_contact(), new_follower(), nogroup_content(), notification(), notifications_content(), notifications_post(), notify_content(), oembed_bbcode2html(), oembed_iframe(), oexchange_content(), page_content(), paginate(), photo_upload(), photos_album_widget(), photos_content(), photos_init(), photos_post(), ping_init(), poke_content(), poke_init(), populate_acl(), post_activity_item(), post_init(), posted_date_widget(), prepare_body(), profile_activity(), profile_content(), profile_init(), profile_load(), profile_photo_post(), profile_sidebar(), profile_tabs(), profiles_content(), profiles_init(), profiles_post(), profperm_content(), redbasic_form(), register_content(), register_post(), regmod_content(), relative_date(), removeme_content(), rmagic_content(), saved_searches(), scale_external_images(), search(), search_content(), search_saved_searches(), select_timezone(), send_message(), send_reg_approval_email(), send_verification_email(), settings_aside(), settings_post(), setup_content(), sexpref_selector(), siteinfo_content(), subthread_content(), suggest_content(), tagger_content(), tagrm_content(), tagrm_post(), timezone_cmp(), update_channel_content(), update_community_content(), update_display_content(), update_network_content(), upgrade_bool_message(), upgrade_link(), upgrade_message(), user_allow(), user_deny(), validate_channelname(), vcard_from_xchan(), viewconnections_content(), viewsrc_content(), wall_upload_post(), what_next(), xchan_content(), z_readdir(), and zfinger_init().
+Referenced by admin_content(), admin_page_dbsync(), admin_page_logs(), admin_page_logs_post(), admin_page_plugins(), admin_page_site(), admin_page_site_post(), admin_page_summary(), admin_page_themes(), admin_page_users(), admin_post(), advanced_profile(), allfriends_content(), alt_pager(), api_content(), api_post(), api_statuses_public_timeline(), apps_content(), attach_by_hash(), attach_by_hash_nodata(), attach_count_files(), attach_init(), attach_list_files(), attach_store(), authenticate_success(), bb_ShareAttributes(), bbcode(), categories_widget(), channel_content(), channel_init(), chanview_content(), check_account_email(), check_account_invite(), check_config(), check_form_security_std_err_msg(), check_funcs(), check_htaccess(), check_htconfig(), check_keys(), check_php(), check_smarty3(), common_content(), common_friends_visitor_widget(), common_init(), community_content(), connections_content(), connections_post(), construct_page(), consume_feed(), contact_block(), contact_poll_interval(), contact_reputation(), create_account(), create_identity(), crepair_content(), crepair_post(), datesel_format(), day_translate(), delegate_content(), directory_content(), dirfind_content(), dirsearch_content(), display_content(), drop_item(), editpost_content(), events_content(), events_post(), fbrowser_content(), file_tag_save_file(), fileas_widget(), filer_content(), findpeople_widget(), fix_attached_photo_permissions(), follow_init(), follow_widget(), format_event_diaspora(), format_event_html(), format_notification(), fsuggest_content(), fsuggest_post(), gender_selector(), get_birthdays(), Item\get_comment_box(), get_events(), get_features(), get_mood_verbs(), get_perms(), get_plink(), get_poke_verbs(), Item\get_template_data(), group_add(), group_content(), group_post(), group_side(), hcard_init(), help_content(), identity_check_service_class(), import_channel_photo(), import_content(), import_post(), import_xchan(), dba_driver\install(), intro_content(), intro_post(), invite_content(), invite_post(), item_post(), item_post_type(), lang_selector(), like_content(), load_database(), localize_item(), lockview_content(), login(), lostpass_content(), lostpass_post(), magic_init(), manage_content(), manual_config(), marital_selector(), match_content(), message_aside(), message_content(), message_post(), mini_group_select(), mood_content(), mood_init(), nav(), network_content(), network_init(), network_to_name(), new_channel_content(), new_channel_post(), new_contact(), new_follower(), nogroup_content(), notification(), notifications_content(), notifications_post(), notify_content(), oembed_bbcode2html(), oembed_iframe(), oexchange_content(), page_content(), paginate(), photo_upload(), photos_album_widget(), photos_content(), photos_init(), photos_post(), ping_init(), poke_content(), poke_init(), populate_acl(), post_activity_item(), post_init(), posted_date_widget(), prepare_body(), profile_activity(), profile_content(), profile_init(), profile_load(), profile_photo_post(), profile_sidebar(), profile_tabs(), profiles_content(), profiles_init(), profiles_post(), profperm_content(), redbasic_form(), register_content(), register_post(), regmod_content(), relative_date(), removeme_content(), rmagic_content(), saved_searches(), scale_external_images(), search(), search_content(), search_saved_searches(), select_timezone(), send_message(), send_reg_approval_email(), send_verification_email(), settings_aside(), settings_post(), setup_content(), sexpref_selector(), siteinfo_content(), subthread_content(), suggest_content(), tagger_content(), tagrm_content(), tagrm_post(), timezone_cmp(), update_channel_content(), update_community_content(), update_display_content(), update_network_content(), upgrade_bool_message(), upgrade_link(), upgrade_message(), user_allow(), user_deny(), validate_channelname(), vcard_from_xchan(), viewconnections_content(), viewsrc_content(), wall_upload_post(), what_next(), xchan_content(), z_readdir(), and zfinger_init().
Referenced by admin_page_logs(), channel_content(), create_identity(), events_post(), fsuggest_post(), get_atom_elements(), item_post(), item_store(), item_store_update(), local_delivery(), mail_store(), message_content(), message_post(), network_content(), printable(), and profiles_post().
+Referenced by admin_page_logs(), channel_content(), create_identity(), events_post(), fsuggest_post(), get_atom_elements(), item_post(), item_store(), item_store_update(), local_delivery(), mail_store(), message_content(), message_post(), network_content(), printable(), and profiles_post().
Referenced by account_verify_password(), Item\add_child(), Conversation\add_thread(), allowed_public_recips(), api_call(), api_export_basic(), api_favorites(), api_get_user(), api_login(), api_statuses_destroy(), api_statuses_mediap(), api_statuses_repeat(), api_statuses_show(), api_statuses_update(), api_statuses_user_timeline(), authenticate_success(), avatar_img(), base64url_decode(), channel_remove(), chanview_content(), check_config(), check_form_security_token_ForbiddenOnErr(), check_form_security_token_redirectOnErr(), consume_feed(), create_account(), create_identity(), crepair_post(), cronhooks_run(), datetime_convert(), delete_imported_item(), deliver_run(), detect_language(), dfrn_deliver(), directory_content(), directory_run(), display_content(), email_send(), encode_item(), encode_mail(), expire_run(), feed_init(), fetch_lrdd_template(), fetch_xrd_links(), filer_content(), filerm_content(), fix_private_photos(), Conversation\get_template_data(), group_content(), guess_image_type(), http_status_exit(), import_author_xchan(), import_channel_photo(), import_directory_profile(), import_post(), import_profile_photo(), import_xchan(), item_expire(), item_post(), item_store(), item_store_update(), like_content(), limit_body_size(), local_delivery(), FKOAuth1\loginUser(), FKOAuthDataStore\lookup_consumer(), FKOAuthDataStore\lookup_token(), lrdd(), mail_store(), message_content(), message_post(), mini_group_select(), mood_init(), FKOAuthDataStore\new_access_token(), new_contact(), new_keypair(), FKOAuthDataStore\new_request_token(), notification(), notifier_run(), onepoll_run(), parse_url_content(), parse_xml_string(), photo_upload(), photos_post(), ping_init(), poco_init(), poco_load(), poke_init(), poller_run(), post_init(), post_post(), process_delivery(), process_mail_delivery(), process_profile_delivery(), profile_load(), dba_mysqli\q(), dba_mysql\q(), dba\q(), q(), queue_run(), redir_init(), register_content(), Item\remove_child(), remove_queue_item(), scale_external_images(), search_ac_init(), enotify\send(), send_reg_approval_email(), Conversation\set_mode(), subthread_content(), syncdirs(), tag_deliver(), tagger_content(), tgroup_check(), update_imported_item(), update_queue_time(), webfinger(), webfinger_dfrn(), xml2array(), xml_status(), zfinger_init(), zot_build_packet(), zot_fetch(), zot_finger(), zot_gethub(), zot_import(), zot_process_response(), zot_refresh(), and zot_register_hub().
+Referenced by account_verify_password(), Item\add_child(), Conversation\add_thread(), allowed_public_recips(), api_call(), api_export_basic(), api_favorites(), api_get_user(), api_login(), api_statuses_destroy(), api_statuses_mediap(), api_statuses_repeat(), api_statuses_show(), api_statuses_update(), api_statuses_user_timeline(), authenticate_success(), avatar_img(), base64url_decode(), channel_remove(), chanview_content(), check_config(), check_form_security_token_ForbiddenOnErr(), check_form_security_token_redirectOnErr(), consume_feed(), create_account(), create_identity(), crepair_post(), cronhooks_run(), datetime_convert(), delete_imported_item(), deliver_run(), detect_language(), dfrn_deliver(), directory_content(), directory_run(), display_content(), email_send(), encode_item(), encode_mail(), expire_run(), feed_init(), fetch_lrdd_template(), fetch_xrd_links(), filer_content(), filerm_content(), fix_private_photos(), Conversation\get_template_data(), group_content(), guess_image_type(), http_status_exit(), import_author_xchan(), import_channel_photo(), import_directory_profile(), import_post(), import_profile_photo(), import_xchan(), item_expire(), item_post(), item_store(), item_store_update(), like_content(), limit_body_size(), local_delivery(), FKOAuth1\loginUser(), FKOAuthDataStore\lookup_consumer(), FKOAuthDataStore\lookup_token(), lrdd(), mail_store(), message_content(), message_post(), mini_group_select(), mood_init(), FKOAuthDataStore\new_access_token(), new_contact(), new_keypair(), FKOAuthDataStore\new_request_token(), notification(), notifier_run(), onepoll_run(), parse_url_content(), parse_xml_string(), photo_upload(), photos_post(), ping_init(), poco_init(), poco_load(), poke_init(), poller_run(), post_init(), post_post(), process_delivery(), process_mail_delivery(), process_profile_delivery(), profile_load(), dba_mysqli\q(), dba_mysql\q(), q(), queue_run(), redir_init(), register_content(), Item\remove_child(), remove_queue_item(), scale_external_images(), search_ac_init(), enotify\send(), send_reg_approval_email(), Conversation\set_mode(), subthread_content(), syncdirs(), tag_deliver(), tagger_content(), tgroup_check(), update_imported_item(), update_queue_time(), webfinger(), webfinger_dfrn(), xml2array(), xml_status(), zfinger_init(), zot_build_packet(), zot_fetch(), zot_finger(), zot_gethub(), zot_import(), zot_process_response(), zot_refresh(), and zot_register_hub().
Referenced by FriendicaSmarty\__construct(), Item\__construct(), Template\_replcb_if(), Template\_replcb_inc(), _well_known_init(), acl_init(), admin_content(), admin_page_dbsync(), admin_page_logs(), admin_page_logs_post(), admin_page_plugins(), admin_page_site(), admin_page_site_post(), admin_page_summary(), admin_page_themes(), admin_page_users(), admin_page_users_post(), admin_post(), advanced_profile(), allfriends_content(), allowed_email(), allowed_url(), alt_pager(), api_account_verify_credentials(), api_apply_template(), api_call(), api_content(), api_direct_messages_all(), api_direct_messages_box(), api_direct_messages_conversation(), api_direct_messages_inbox(), api_direct_messages_new(), api_direct_messages_sentbox(), api_favorites(), api_followers_ids(), api_format_as(), api_format_items(), api_friends_ids(), api_get_user(), api_item_get_user(), api_login(), api_post(), api_rss_extra(), api_status_show(), api_statuses_destroy(), api_statuses_f(), api_statuses_followers(), api_statuses_friends(), api_statuses_home_timeline(), api_statuses_mediap(), api_statuses_mentions(), api_statuses_public_timeline(), api_statuses_repeat(), api_statuses_show(), api_statuses_update(), api_statuses_user_timeline(), api_statusnet_config(), api_users_show(), apps_content(), atom_entry(), attribute_contains(), authenticate_success(), avatar_img(), bbcode(), best_link_url(), cal(), categories_widget(), channel_aside(), channel_content(), channel_init(), channel_remove(), chanview_content(), check_config(), check_form_security_token(), check_form_security_token_ForbiddenOnErr(), check_form_security_token_redirectOnErr(), check_htaccess(), clean_urls(), cli_startup(), common_aside(), common_content(), common_friends_visitor_widget(), common_init(), community_content(), connections_aside(), connections_content(), connections_init(), connections_post(), construct_page(), consume_feed(), contact_block(), contact_select(), create_identity(), crepair_content(), crepair_init(), crepair_post(), current_theme(), current_theme_url(), del_config(), del_pconfig(), del_xconfig(), delegate_content(), deliver_run(), dfrn_deliver(), directory_aside(), directory_content(), directory_init(), dirfind_content(), dirfind_init(), dirsearch_init(), display_content(), dlogger(), drop_item(), editpost_content(), ev_compare(), event_store(), events_content(), events_post(), expand_acl(), expand_groups(), fbrowser_content(), fetch_url(), fileas_widget(), filer_content(), filerm_content(), findpeople_widget(), fix_private_photos(), follow_init(), format_event_diaspora(), fsuggest_content(), fsuggest_post(), BaseObject\get_app(), get_app(), get_best_language(), get_birthdays(), Item\get_comment_box(), get_config(), get_events(), get_feed_for(), get_form_security_token(), get_max_import_size(), get_pconfig(), get_plink(), Item\get_template_data(), get_theme_screenshot(), get_xconfig(), gprobe_run(), group_aside(), group_content(), group_post(), group_select(), guess_image_type(), handle_tag(), hcard_aside(), hcard_init(), help_content(), hostxrd_init(), import_channel_photo(), import_profile_photo(), info(), intro_aside(), intro_content(), invite_content(), invite_post(), is_site_admin(), item_content(), item_post(), lang_selector(), like_content(), link_compare(), load_config(), load_contact_links(), load_database(), load_pconfig(), load_translation_table(), load_xconfig(), local_delivery(), logger(), login(), login_content(), FKOAuth1\loginUser(), lostpass_content(), lostpass_post(), lrdd(), magic_init(), manual_config(), match_content(), message_aside(), message_content(), message_post(), mood_init(), msearch_post(), nav(), nav_set_selected(), network_content(), network_init(), new_contact(), new_follower(), nogroup_content(), nogroup_init(), notice(), notification(), notifications_content(), notifications_post(), notifier_run(), notify_content(), notify_init(), oembed_fetch_url(), oembed_format_object(), oembed_iframe(), oexchange_content(), oexchange_init(), onepoll_run(), opensearch_init(), page_content(), paginate(), photos_content(), photos_init(), photos_post(), ping_init(), poco_init(), poco_load(), poke_init(), poller_run(), pop_lang(), post_init(), post_url(), preg_heart(), prepare_body(), probe_content(), proc_run(), profile_activity(), profile_aside(), profile_content(), profile_create_sidebar(), profile_init(), profile_load(), profile_photo_aside(), profile_photo_init(), profile_photo_post(), profile_sidebar(), profile_tabs(), profiles_aside(), profiles_content(), profiles_init(), profiles_post(), profperm_aside(), profperm_content(), profperm_init(), push_lang(), queue_run(), randprof_init(), redbasic_form(), redbasic_init(), redir_init(), register_content(), regmod_content(), relative_date(), removeme_content(), removeme_post(), replace_macros(), rmagic_post(), saved_searches(), scale_external_images(), search(), search_ac_init(), search_content(), search_init(), search_post(), send_message(), service_class_allows(), service_class_fetch(), set_config(), Conversation\set_mode(), set_pconfig(), set_xconfig(), settings_aside(), settings_post(), setup_content(), setup_post(), siteinfo_content(), siteinfo_init(), smilies(), subthread_content(), suggest_aside(), suggest_content(), t(), tag_deliver(), tagger_content(), tagrm_content(), tagrm_post(), tags_sort(), terminate_friendship(), tgroup_check(), theme_content(), theme_include(), timezone_cmp(), toggle_mobile_init(), tt(), uexport_init(), update_channel_content(), update_community_content(), update_display_content(), update_network_content(), update_suggestions(), user_allow(), viewconnections_aside(), viewconnections_content(), viewconnections_init(), viewsrc_content(), wall_upload_post(), wfinger_init(), what_next(), xrd_init(), z_fetch_url(), z_path(), z_root(), zid_init(), and zotfeed_init().
+Referenced by api_date(), check_php(), check_webbie(), dbesc(), dba_mysqli\escape(), dba_mysql\escape(), dba\escape(), head_get_css(), head_get_js(), item_store_update(), load_database(), photos_album_get_db_idstr(), photos_post(), posted_dates(), dba\q(), relative_date(), stream_perms_api_uids(), and xmlify().
+Referenced by api_date(), check_php(), check_webbie(), dbesc(), dba_mysqli\escape(), dba_mysql\escape(), head_get_css(), head_get_js(), item_store_update(), load_database(), photos_album_get_db_idstr(), photos_post(), posted_dates(), relative_date(), stream_perms_api_uids(), and xmlify().
diff --git a/include/cli_startup.php b/include/cli_startup.php index 863f97d7c..1be58d855 100644 --- a/include/cli_startup.php +++ b/include/cli_startup.php @@ -14,8 +14,8 @@ function cli_startup() { if(is_null($db)) { @include(".htconfig.php"); - require_once("dba.php"); - $db = new dba($db_host, $db_user, $db_pass, $db_data); + require_once('include/dba/dba_driver.php'); + $db = dba_factory($db_host, $db_user, $db_pass, $db_data); unset($db_host, $db_user, $db_pass, $db_data); }; diff --git a/include/dba.php b/include/dba.php index 004bff423..6f40f64c2 100644 --- a/include/dba.php +++ b/include/dba.php @@ -13,7 +13,7 @@ require_once('include/datetime.php'); * */ - +/* class dba { private $debug = 0; @@ -130,13 +130,13 @@ class dba { logger('dba: ' . $str ); } - +*/ /** * If dbfail.out exists, we will write any failed calls directly to it, * regardless of any logging that may or may nor be in effect. * These usually indicate SQL syntax errors that need to be resolved. */ - +/* if($result === false) { logger('dba: ' . printable($sql) . ' returned false.' . "\n" . $this->error); if(file_exists('dbfail.out')) @@ -190,100 +190,4 @@ class dba { } } - -function printable($s) { - $s = preg_replace("~([\x01-\x08\x0E-\x0F\x10-\x1F\x7F-\xFF])~",".", $s); - $s = str_replace("\x00",'.',$s); - if(x($_SERVER,'SERVER_NAME')) - $s = escape_tags($s); - return $s; -} - -// Procedural functions - -function dbg($state) { - global $db; - if($db) - $db->dbg($state); -} - - -function dbesc($str) { - global $db; - if($db && $db->connected) - return($db->escape($str)); - else - return(str_replace("'","\\'",$str)); -} - - - -// Function: q($sql,$args); -// Description: execute SQL query with printf style args. -// Example: $r = q("SELECT * FROM `%s` WHERE `uid` = %d", -// 'user', 1); - - -function q($sql) { - - global $db; - $args = func_get_args(); - unset($args[0]); - - if($db && $db->connected) { - $stmt = vsprintf($sql,$args); - if($stmt === false) - logger('dba: vsprintf error: ' . print_r(debug_backtrace(),true)); - return $db->q($stmt); - } - - /** - * - * This will happen occasionally trying to store the - * session data after abnormal program termination - * - */ - logger('dba: no database: ' . print_r($args,true)); - return false; - -} - -/** - * - * Raw db query, no arguments - * - */ - - -function dbq($sql) { - - global $db; - if($db && $db->connected) - $ret = $db->q($sql); - else - $ret = false; - return $ret; -} - - -// Caller is responsible for ensuring that any integer arguments to -// dbesc_array are actually integers and not malformed strings containing -// SQL injection vectors. All integer array elements should be specifically -// cast to int to avoid trouble. - - - -function dbesc_array_cb(&$item, $key) { - if(is_string($item)) - $item = dbesc($item); -} - - - -function dbesc_array(&$arr) { - if(is_array($arr) && count($arr)) { - array_walk($arr,'dbesc_array_cb'); - } -} - - +*/ diff --git a/include/dba/dba_driver.php b/include/dba/dba_driver.php new file mode 100644 index 000000000..2f0555718 --- /dev/null +++ b/include/dba/dba_driver.php @@ -0,0 +1,160 @@ +connect($server,$user,$pass,$db); + + return $dba; +} + + +abstract class dba_driver { + + protected $debug = 0; + protected $driver; + protected $db; + public $connected = false; + public $error = false; + + abstract function connect($server,$user,$pass,$db); + abstract function q($sql); + abstract function escape($str); + abstract function close(); + + function __construct($server,$user,$pass,$db,$install = false) { + if($install) + $this->install($server,$user,$pass,$db); + $this->connect($server,$user,$pass,$db); + } + + + function install($server,$user,$pass,$db) { + $server = trim($server); + $user = trim($user); + $pass = trim($pass); + $db = trim($db); + + if (!(strlen($server) && strlen($user))){ + $this->connected = false; + $this->db = null; + return; + } + + if(strlen($server) && ($server !== 'localhost') && ($server !== '127.0.0.1')) { + if(! dns_get_record($server, DNS_A + DNS_CNAME + DNS_PTR)) { + $this->error = sprintf( t('Cannot locate DNS info for database server \'%s\''), $server); + $this->connected = false; + $this->db = null; + return; + } + } + } + + +} + + + +function printable($s) { + $s = preg_replace("~([\x01-\x08\x0E-\x0F\x10-\x1F\x7F-\xFF])~",".", $s); + $s = str_replace("\x00",'.',$s); + if(x($_SERVER,'SERVER_NAME')) + $s = escape_tags($s); + return $s; +} + +// Procedural functions + +function dbg($state) { + global $db; + if($db) + $db->dbg($state); +} + + +function dbesc($str) { + global $db; + if($db && $db->connected) + return($db->escape($str)); + else + return(str_replace("'","\\'",$str)); +} + + + +// Function: q($sql,$args); +// Description: execute SQL query with printf style args. +// Example: $r = q("SELECT * FROM `%s` WHERE `uid` = %d", +// 'user', 1); + + +function q($sql) { + + global $db; + $args = func_get_args(); + unset($args[0]); + + if($db && $db->connected) { + $stmt = vsprintf($sql,$args); + if($stmt === false) + logger('dba: vsprintf error: ' . print_r(debug_backtrace(),true)); + return $db->q($stmt); + } + + /** + * + * This will happen occasionally trying to store the + * session data after abnormal program termination + * + */ + logger('dba: no database: ' . print_r($args,true)); + return false; + +} + +/** + * + * Raw db query, no arguments + * + */ + + +function dbq($sql) { + + global $db; + if($db && $db->connected) + $ret = $db->q($sql); + else + $ret = false; + return $ret; +} + + +// Caller is responsible for ensuring that any integer arguments to +// dbesc_array are actually integers and not malformed strings containing +// SQL injection vectors. All integer array elements should be specifically +// cast to int to avoid trouble. + + + +function dbesc_array_cb(&$item, $key) { + if(is_string($item)) + $item = dbesc($item); +} + + + +function dbesc_array(&$arr) { + if(is_array($arr) && count($arr)) { + array_walk($arr,'dbesc_array_cb'); + } +} diff --git a/include/dba/dba_mysql.php b/include/dba/dba_mysql.php new file mode 100644 index 000000000..05e19903d --- /dev/null +++ b/include/dba/dba_mysql.php @@ -0,0 +1,63 @@ +db = mysql_connect($server,$user,$pass); + if($this->db && mysql_select_db($db,$this->db)) { + $this->connected = true; + } + if($this->connected) { + return true; + } + return false; + } + + + function q($sql) { + if((! $this->db) || (! $this->connected)) + return false; + + $this->error = ''; + $result = @mysql_query($sql,$this->db); + + + if(mysql_errno($this->db)) + $this->error = mysql_error($this->db); + + if($result === false || $this->error) { + logger('dba_mysql: ' . printable($sql) . ' returned false.' . "\n" . $this->error); + if(file_exists('dbfail.out')) + file_put_contents('dbfail.out', datetime_convert() . "\n" . printable($sql) . ' returned false' . "\n" . $this->error . "\n", FILE_APPEND); + } + + if(($result === true) || ($result === false)) + return $result; + + $r = array(); + if(mysql_num_rows($result)) { + while($x = mysql_fetch_array($result,MYSQL_ASSOC)) + $r[] = $x; + mysql_free_result($result); + if($this->debug) + logger('dba_mysql: ' . printable(print_r($r,true))); + } + return $r; + } + + function escape($str) { + if($this->db && $this->connected) { + return @mysql_real_escape_string($str,$this->db); + } + } + + function close() { + if($this->db) + mysql_close($this->db); + $this->connected = false; + } + +} diff --git a/include/dba/dba_mysqli.php b/include/dba/dba_mysqli.php new file mode 100644 index 000000000..10a0a05c2 --- /dev/null +++ b/include/dba/dba_mysqli.php @@ -0,0 +1,62 @@ +db = new mysqli($server,$user,$pass,$db); + if(! mysqli_connect_errno()) { + $this->connected = true; + } + if($this->connected) { + return true; + } + return false; + } + + function q($sql) { + if((! $this->db) || (! $this->connected)) + return false; + + $this->error = ''; + $result = $this->db->query($sql); + + if($this->db->errno) + $this->error = $this->db->error; + + if($result === false || $this->error) { + logger('dba_mysqli: ' . printable($sql) . ' returned false.' . "\n" . $this->error); + if(file_exists('dbfail.out')) + file_put_contents('dbfail.out', datetime_convert() . "\n" . printable($sql) . ' returned false' . "\n" . $this->error . "\n", FILE_APPEND); + } + + if(($result === true) || ($result === false)) + return $result; + + $r = array(); + if($result->num_rows) { + while($x = $result->fetch_array(MYSQLI_ASSOC)) + $r[] = $x; + $result->free_result(); + if($this->debug) { + logger('dba_mysqli: query: ' . printable($sql) . ' returned ' . $result->num_rows . ' results.'); + logger('dba_mysqli: ' . printable(print_r($r,true))); + } + } + return $r; + } + + function escape($str) { + if($this->db && $this->connected) { + return @$this->db->real_escape_string($str); + } + } + + function close() { + if($this->db) + $this->db->close(); + $this->connected = flase; + } + +} \ No newline at end of file diff --git a/index.php b/index.php index 95b7c78a9..d8be14888 100644 --- a/index.php +++ b/index.php @@ -36,10 +36,10 @@ $a->language = get_best_language(); * */ -require_once("dba.php"); +require_once("include/dba/dba_driver.php"); if(! $install) { - $db = new dba($db_host, $db_user, $db_pass, $db_data, $install); + $db = dba_factory($db_host, $db_user, $db_pass, $db_data, $install); unset($db_host, $db_user, $db_pass, $db_data); /** diff --git a/mod/setup.php b/mod/setup.php index cd303205e..b80435f0b 100755 --- a/mod/setup.php +++ b/mod/setup.php @@ -34,12 +34,12 @@ function setup_post(&$a) { $adminmail = notags(trim($_POST['adminmail'])); $siteurl = notags(trim($_POST['siteurl'])); - require_once("dba.php"); + require_once('include/dba/dba_driver.php'); unset($db); - $db = new dba($dbhost, $dbuser, $dbpass, $dbdata, true); + $db = dba_factory($dbhost, $dbuser, $dbpass, $dbdata, true); /*if(get_db_errno()) { unset($db); - $db = new dba($dbhost, $dbuser, $dbpass, '', true); + $db = dba_factory($dbhost, $dbuser, $dbpass, '', true); if(! get_db_errno()) { $r = q("CREATE DATABASE '%s'", @@ -76,7 +76,7 @@ function setup_post(&$a) { // connect to db - $db = new dba($dbhost, $dbuser, $dbpass, $dbdata, true); + $db = dba_factory($dbhost, $dbuser, $dbpass, $dbdata, true); $tpl = get_intltext_template('htconfig.tpl'); $txt = replace_macros($tpl,array( @@ -120,7 +120,7 @@ function setup_content(&$a) { global $install_wizard_pass, $db; $o = ''; $wizard_status = ""; - $install_title = t('Friendica Red Communications Server - Setup'); + $install_title = t('Red Identity/Communications Server - Setup'); @@ -136,7 +136,7 @@ function setup_content(&$a) { $db_return_text=""; if(x($a->data,'db_installed')) { $txt = ''; - $txt .= t('Your Friendica site database has been installed.') . EOL; + $txt .= t('Your site database has been installed.') . EOL; $db_return_text .= $txt; } @@ -233,7 +233,7 @@ function setup_content(&$a) { $o .= replace_macros($tpl, array( '$title' => $install_title, '$pass' => t('Database connection'), - '$info_01' => t('In order to install Friendica we need to know how to connect to your database.'), + '$info_01' => t('In order to install Red we need to know how to connect to your database.'), '$info_02' => t('Please contact your hosting provider or site administrator if you have questions about these settings.'), '$info_03' => t('The database you specify below should already exist. If it does not, please create it before continuing.'), @@ -330,7 +330,7 @@ function check_php(&$phpath, &$checks) { $help = ""; if(!$passed) { $help .= t('Could not find a command line version of PHP in the web server PATH.'). EOL; - $help .= t("If you don't have a command line version of PHP installed on server, you will not be able to run background polling via cron. See 'Activating scheduled tasks'") . EOL ; + $help .= t("If you don't have a command line version of PHP installed on server, you will not be able to run background polling via cron.") . EOL; $help .= EOL . EOL ; $tpl = get_markup_template('field_input.tpl'); $help .= replace_macros($tpl, array( @@ -444,7 +444,7 @@ function check_htconfig(&$checks) { $status=false; $help = t('The web installer needs to be able to create a file called ".htconfig.php" in the top folder of your web server and it is unable to do so.') .EOL; $help .= t('This is most often a permission setting, as the web server may not be able to write files in your folder - even if you can.').EOL; - $help .= t('At the end of this procedure, we will give you a text to save in a file named .htconfig.php in your Friendica top folder.').EOL; + $help .= t('At the end of this procedure, we will give you a text to save in a file named .htconfig.php in your Red top folder.').EOL; $help .= t('You can alternatively skip this procedure and perform a manual installation. Please see the file "install/INSTALL.txt" for instructions.').EOL; } @@ -458,8 +458,8 @@ function check_smarty3(&$checks) { if( !is_writable('view/tpl/smarty3') ) { $status=false; - $help = t('Friendica uses the Smarty3 template engine to render its web views. Smarty3 compiles templates to PHP to speed up rendering.') .EOL; - $help .= t('In order to store these compiled templates, the web server needs to have write access to the directory view/tpl/smarty3/ under the Friendica top level folder.').EOL; + $help = t('Red uses the Smarty3 template engine to render its web views. Smarty3 compiles templates to PHP to speed up rendering.') .EOL; + $help .= t('In order to store these compiled templates, the web server needs to have write access to the directory view/tpl/smarty3/ under the Red top level folder.').EOL; $help .= t('Please ensure that the user that your web server runs as (e.g. www-data) has write access to this folder.').EOL; $help .= t('Note: as a security measure, you should give the web server write access to view/tpl/smarty3/ only--not the template files (.tpl) that it contains.').EOL; } @@ -527,7 +527,7 @@ function what_next() { ."
".t('IMPORTANT: You will need to [manually] setup a scheduled task for the poller.') .t('Please see the file "install/INSTALL.txt".') ."
" - .t("Go to your new Friendica node registration page and register as new user. Remember to use the same email you have entered as administrator email. This will allow you to enter the site admin panel.") + .t("Go to your new Red node registration page and register as new user. Remember to use the same email you have entered as administrator email. This will allow you to enter the site admin panel.") ."
"; } diff --git a/util/db_update.php b/util/db_update.php index 775a6585a..ceef061c1 100644 --- a/util/db_update.php +++ b/util/db_update.php @@ -1,24 +1,14 @@