This function is obsolete; remove to avoid any confusion.

        Patch by kareila. 

diffs (302 lines):

diff -r ae4f9eb44abd -r 030b8c0fe9a2 cgi-bin/LJ/Entry.pm
--- a/cgi-bin/LJ/Entry.pm       Tue Jun 15 14:21:09 2010 +0800
+++ b/cgi-bin/LJ/Entry.pm       Tue Jun 15 14:35:43 2010 +0800
@@ -1092,9 +1092,7 @@ use LJ::EmbedModule;
 # des-idsbyc: A hashref where the key is the clusterid, and the data
 #             is an arrayref of [ ownerid, itemid ] array references.
 # </LJFUNC>
-sub get_logtext2multi
-{
-    &nodb;
+sub get_logtext2multi {
     return _get_posts_raw_wrapper(shift, "text");
 }
 
@@ -1895,9 +1893,7 @@ sub load_log_props2
 # des-:
 # returns:
 # </LJFUNC>
-sub load_log_props2multi
-{
-    &nodb;
+sub load_log_props2multi {
     my ($ids, $props) = @_;
     _get_posts_raw_wrapper($ids, "prop", $props);
 }
@@ -2185,9 +2181,7 @@ sub item_link
 # returns:
 # </LJFUNC>
 
-sub expand_embedded
-{
-    &nodb;
+sub expand_embedded {
     my ($u, $ditemid, $remote, $eventref, %opts) = @_;
     LJ::Poll->expand_entry($eventref) unless $opts{preview};
     LJ::EmbedModule->expand_entry($u, $eventref, %opts);
diff -r ae4f9eb44abd -r 030b8c0fe9a2 cgi-bin/LJ/Lang.pm
--- a/cgi-bin/LJ/Lang.pm        Tue Jun 15 14:21:09 2010 +0800
+++ b/cgi-bin/LJ/Lang.pm        Tue Jun 15 14:35:43 2010 +0800
@@ -309,9 +309,7 @@ sub get_chgtime_unix
     return $chgtime ? LJ::mysqldate_to_time($chgtime) : 0;
 }
 
-sub get_itemid
-{
-    &LJ::nodb;
+sub get_itemid {
     my ($dmid, $itcode, $opts) = @_;
     load_lang_struct() unless $LS_CACHED;
 
@@ -367,9 +365,7 @@ sub web_set_text {
     return ($save_success, $resp);
 }
 
-sub set_text
-{
-    &LJ::nodb;
+sub set_text {
     my ($dmid, $lncode, $itcode, $text, $opts) = @_;
     load_lang_struct() unless $LS_CACHED;
 
diff -r ae4f9eb44abd -r 030b8c0fe9a2 cgi-bin/LJ/User.pm
--- a/cgi-bin/LJ/User.pm        Tue Jun 15 14:21:09 2010 +0800
+++ b/cgi-bin/LJ/User.pm        Tue Jun 15 14:35:43 2010 +0800
@@ -6004,7 +6004,6 @@ use Carp;
 # des-opts: hashref containing keys 'user', 'name', 'password', 'email', 
'caps', 'journaltype'.
 # </LJFUNC>
 sub create_account {
-    &nodb;
     my $opts = shift;
     my $u = LJ::User->create(%$opts)
         or return 0;
@@ -6093,9 +6092,7 @@ sub canonical_username
 # des-user: Username whose userid to look up.
 # returns: Userid, or 0 if invalid user.
 # </LJFUNC>
-sub get_userid
-{
-    &nodb;
+sub get_userid {
     my $user = LJ::canonical_username( $_[0] );
 
     if ($LJ::CACHE_USERID{$user}) { return $LJ::CACHE_USERID{$user}; }
@@ -6135,9 +6132,7 @@ sub get_userid
 # des-user: Username whose userid to look up.
 # returns: Userid, or 0 if invalid user.
 # </LJFUNC>
-sub get_username
-{
-    &nodb;
+sub get_username {
     my $userid = $_[0] + 0;
 
     # Checked the cache first.
@@ -6191,9 +6186,7 @@ sub isu {
 #            query a dbh.
 # returns: Hashref, with keys being columns of [dbtable[user]] table.
 # </LJFUNC>
-sub load_user
-{
-    &nodb;
+sub load_user {
     my ($user, $force) = @_;
 
     $user = LJ::canonical_username($user);
@@ -6314,9 +6307,7 @@ sub load_user_or_identity {
 #            query a dbh
 # returns: Hashref with keys being columns of [dbtable[user]] table.
 # </LJFUNC>
-sub load_userid
-{
-    &nodb;
+sub load_userid {
     my ($userid, $force) = @_;
     return undef unless $userid;
 
@@ -6389,9 +6380,7 @@ sub load_userids
 # des-memcache_only: Flag to only retrieve data from memcache.
 # returns: Nothing.
 # </LJFUNC>
-sub load_userids_multiple
-{
-    &nodb;
+sub load_userids_multiple {
     # the $have parameter is deprecated, as is $memcache_only, but it's still 
preserved for now.
     # actually this whole API is crap.  use LJ::load_userids() instead.
     my ($map, undef, $memcache_only) = @_;
@@ -7418,9 +7407,7 @@ sub modify_caps {
 #            empty string, then property is deleted.
 # des-memonly: if true, only writes to memcache, and not to database.
 # </LJFUNC>
-sub set_userprop
-{
-    &nodb;
+sub set_userprop {
     my ($u, $propname, $value, $memonly) = @_;
     $u = ref $u ? $u : LJ::load_userid($u);
     my $userid = $u->userid + 0;
@@ -8384,9 +8371,7 @@ sub journal_base
 # des-:
 # returns:
 # </LJFUNC>
-sub make_journal
-{
-    &nodb;
+sub make_journal {
     my ($user, $view, $remote, $opts) = @_;
 
     my $r = DW::Request->get;
diff -r ae4f9eb44abd -r 030b8c0fe9a2 cgi-bin/ljdb.pl
--- a/cgi-bin/ljdb.pl   Tue Jun 15 14:21:09 2010 +0800
+++ b/cgi-bin/ljdb.pl   Tue Jun 15 14:35:43 2010 +0800
@@ -484,13 +484,6 @@ sub use_diff_db {
     $LJ::DBIRole->use_diff_db(@_);
 }
 
-# to be called as &nodb; (so this function sees caller's @_)
-sub nodb {
-    shift @_ if
-        ref $_[0] eq "LJ::DBSet" || ref $_[0] eq "DBI::db" ||
-        ref $_[0] eq "Apache::DBI::db";
-}
-
 sub dbtime_callback {
     my ($dsn, $dbtime, $time) = @_;
     my $diff = abs($dbtime - $time);
diff -r ae4f9eb44abd -r 030b8c0fe9a2 cgi-bin/ljlib.pl
--- a/cgi-bin/ljlib.pl  Tue Jun 15 14:21:09 2010 +0800
+++ b/cgi-bin/ljlib.pl  Tue Jun 15 14:35:43 2010 +0800
@@ -511,9 +511,7 @@ sub get_times_multi {
 #          a 15 character string of random characters from
 #          [func[LJ::make_auth_code]].
 # </LJFUNC>
-sub register_authaction
-{
-    &nodb;
+sub register_authaction {
     my $dbh = LJ::get_db_writer();
 
     my $userid = shift;  $userid += 0;
@@ -555,9 +553,7 @@ sub get_authaction {
 # des-shtype: The status history type code.
 # des-notes: Optional notes associated with this action.
 # </LJFUNC>
-sub statushistory_add
-{
-    &nodb;
+sub statushistory_add {
     my $dbh = LJ::get_db_writer();
 
     my $userid = shift;
@@ -636,10 +632,7 @@ sub get_authas_user {
 # des-aaid: Integer; the authaction ID.
 # des-auth: String; the auth string. (random chars the client already got)
 # </LJFUNC>
-sub is_valid_authaction
-{
-    &nodb;
-
+sub is_valid_authaction {
     # we use the master db to avoid races where authactions could be
     # used multiple times
     my $dbh = LJ::get_db_writer();
@@ -778,9 +771,7 @@ sub get_prop
 #                and their associated values being hashrefs to where you
 #                want that data to be populated.
 # </LJFUNC>
-sub load_codes
-{
-    &nodb;
+sub load_codes {
     my $req = shift;
 
     my $dbr = LJ::get_db_reader()
@@ -820,10 +811,7 @@ sub load_codes
 # args: dbarg?, zip
 # des-zip: zip code
 # </LJFUNC>
-sub load_state_city_for_zip
-{
-    &nodb;
-
+sub load_state_city_for_zip {
     my $zip = shift;
     my ($zipcity, $zipstate);
 
@@ -1840,9 +1828,7 @@ sub color_todb
 #           required args for different commands.
 # returns: new serial number on success; 0 on fail.
 # </LJFUNC>
-sub procnotify_add
-{
-    &nodb;
+sub procnotify_add {
     my ($cmd, $argref) = @_;
     my $dbh = LJ::get_db_writer();
     return 0 unless $dbh;
diff -r ae4f9eb44abd -r 030b8c0fe9a2 cgi-bin/ljrelation.pl
--- a/cgi-bin/ljrelation.pl     Tue Jun 15 14:21:09 2010 +0800
+++ b/cgi-bin/ljrelation.pl     Tue Jun 15 14:35:43 2010 +0800
@@ -22,10 +22,7 @@ use strict;
 # des-user: User hashref or userid.
 # des-journal: Journal hashref or userid.
 # </LJFUNC>
-sub is_banned
-{
-    &nodb;
-
+sub is_banned {
     # get user and journal ids
     my $uid = LJ::want_userid(shift);
     my $jid = LJ::want_userid(shift);
@@ -330,9 +327,7 @@ sub check_rel
 # des-type: type of the relationship
 # returns: 1 if set succeeded, otherwise undef
 # </LJFUNC>
-sub set_rel
-{
-    &nodb;
+sub set_rel {
     my ($userid, $targetid, $type) = @_;
     return undef unless $type and $userid and $targetid;
 
@@ -535,9 +530,7 @@ sub _mod_rel_multi
 # des-type: type of the relationship
 # returns: 1 if clear succeeded, otherwise undef
 # </LJFUNC>
-sub clear_rel
-{
-    &nodb;
+sub clear_rel {
     my ($userid, $targetid, $type) = @_;
     return undef if $userid eq '*' and $targetid eq '*';
 
diff -r ae4f9eb44abd -r 030b8c0fe9a2 cgi-bin/ljtextutil.pl
--- a/cgi-bin/ljtextutil.pl     Tue Jun 15 14:21:09 2010 +0800
+++ b/cgi-bin/ljtextutil.pl     Tue Jun 15 14:35:43 2010 +0800
@@ -366,9 +366,7 @@ sub text_in
 #            text needs to be translated).
 # returns: converted text or undef on error
 # </LJFUNC>
-sub text_convert
-{
-    &nodb;
+sub text_convert {
     my ($text, $u, $error) = @_;
 
     # maybe it's pure ASCII?
diff -r ae4f9eb44abd -r 030b8c0fe9a2 cgi-bin/ljuserpics.pl
--- a/cgi-bin/ljuserpics.pl     Tue Jun 15 14:21:09 2010 +0800
+++ b/cgi-bin/ljuserpics.pl     Tue Jun 15 14:35:43 2010 +0800
@@ -23,9 +23,7 @@ use Carp qw/ croak /;
 # des-idlist: [$u, $picid] or [[$u, $picid], [$u, $picid], +] objects
 #             also supports deprecated old method, of an array ref of picids.
 # </LJFUNC>
-sub load_userpics
-{
-    &nodb;
+sub load_userpics {
     my ($upics, $idlist) = @_;
 
     return undef unless ref $idlist eq 'ARRAY' && $idlist->[0];
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog

Reply via email to