Commit Graph

45 Commits

Author SHA1 Message Date
Mikael Nordfeldth
861e838add pkeyGet is now static and more similar to getKV
Memcached_DataObject now defines
   * pkeyGetClass to avoid collision with Managed_DataObject pkeyGet
   * getClassKV to avoid collision with Managed_DataObject getKV
2013-08-18 15:42:51 +02:00
Mikael Nordfeldth
2a4dc77a63 The overloaded DB_DataObject function staticGet is now called getKV
I used this hacky sed-command (run it from your GNU Social root, or change the first grep's path to where it actually lies) to do a rough fix on all ::staticGet calls and rename them to ::getKV

   sed -i -s -e '/DataObject::staticGet/I!s/::staticGet/::getKV/Ig' $(grep -R ::staticGet `pwd`/* | grep -v -e '^extlib' | grep -v DataObject:: |grep -v "function staticGet"|cut -d: -f1 |sort |uniq)

If you're applying this, remember to change the Managed_DataObject and Memcached_DataObject function definitions of staticGet to getKV!

This might of course take some getting used to, or modification fo StatusNet plugins, but the result is that all the static calls (to staticGet) are now properly made without breaking PHP Strict Standards. Standards are there to be followed (and they caused some very bad confusion when used with get_called_class)

Reasonably any plugin or code that tests for the definition of 'GNUSOCIAL' or similar will take this change into consideration.
2013-08-18 13:13:56 +02:00
Mikael Nordfeldth
1a9a8ea730 staticGet for sub-Managed_DataObject classes now calls parent
The parent class for our database objects, Managed_DataObject, has a
dynamically assigned class in staticGet which objects get put into,
leaving us with less code to do the same thing.

We will probably have to move away from the DB_DataObject 'staticGet'
call as it is nowadays deprecated.
2013-08-12 19:46:44 +02:00
Evan Prodromou
ea8151688e Throw an exception converting fave to activity for non-existent notice or profile 2013-05-24 09:27:21 -04:00
Evan Prodromou
22fead1b46 Squashed commit of the following:
commit fb1dfa9e98ded23fb5bdebae6465424a8cb8acd6
Author: Evan Prodromou <evan@status.net>
Date:   Thu Oct 20 10:40:07 2011 -0400

    Use popular notice stream for favorited page

commit e1d409ff738e39061ad35589d546ce9bed456975
Author: Evan Prodromou <evan@status.net>
Date:   Thu Oct 20 10:32:23 2011 -0400

    Use a caching stream for popular notice section

    Instead of a big cached query, we now use a caching notice stream for
    the popular notice section. It uses a single-table query at the
    bottom, then scopes the notices and filters for silenced users. This
    should be much nicer to our database servers.

    Also clears the popular cache when someone favors or disfavors
    something. A nice optimization would be to save the last weights and
    re-calculate them at invalidation time, adding the new notice (or not)
    depending on its own score. That will have to wait for another day,
    though.

commit e9b7ab4c26c95e755adaff53c3957dcfca31c16b
Author: Evan Prodromou <evan@status.net>
Date:   Thu Oct 20 10:31:14 2011 -0400

    Let CachingNoticeStream users skip the ';last' optimization
2011-10-20 10:40:39 -04:00
Evan Prodromou
01c2c31c1e Merge branch '1.0.x' into activity
Conflicts:
	db/core.php
2011-08-22 18:13:02 -04:00
Evan Prodromou
9ca3c3d1c3 move core schema to class files 2011-08-22 17:52:02 -04:00
Evan Prodromou
34d0e1088d add URI members to social activity classes 2011-08-22 16:36:23 -04:00
Evan Prodromou
ed31052d26 Store pkeys in cache for listGet()
I was storing the full objects in the cache for the listGet()
function. I've changed it to store only pkeys, and use pivotGet() to
get all the corresponding values.

This also required changing pivotGet() so it can get objects with
multi-column pkeys, which complicated the whole thing quite a bit. But
it seems to work OK.
2011-08-08 10:22:20 -04:00
Evan Prodromou
ba6235a446 Get faves in Notice and pre-fill 2011-08-03 00:04:18 -04:00
Evan Prodromou
44bcc942b8 Break up stream code to use separate notice stream classes
Rearchitect (again!) notice stream code to delegate different functionality up and down the stack.

Now, different classes implement NoticeStream.
2011-03-24 18:04:19 -04:00
Evan Prodromou
2b901894c2 Some fixes to make the notice stream class work 2011-03-23 11:59:01 -04:00
Evan Prodromou
0b35ce7c37 New NoticeStream class to reify streams of notices
We've been muddling through with 6- or 8-argument functions for managing streams. I'd
like to start thinking of streams as their own thing, and give them some more value.

So, the new NoticeStream class takes over the Notice::stream() function and Notice::getStreamByIds().

There's probably some fine-tuning to do on the object interface.
2011-03-23 11:29:55 -04:00
Brion Vibber
90a7631592 Caching for conversation root lookup, some logic fixes in threaded view 2011-03-17 17:36:53 -07:00
Brion Vibber
0c2c73659c Use cached sources for favorites & repeats info on threaded notice lists 2011-03-17 17:06:04 -07:00
Brion Vibber
33daace6cb add fixme for since_id/max_id on fave streaming (?) 2010-12-17 14:32:06 -08:00
Evan Prodromou
7c37aa802b a stream function for Fave class 2010-12-12 12:22:04 -05:00
Evan Prodromou
37c447be46 Show a single favorite for AtomPub 2010-12-10 18:50:50 -05:00
Brion Vibber
d6b3d7fb1a Fix unescaped dollar signs in double-quoted strings due to localization updates (%1$s etc) 2010-10-04 14:24:04 -07:00
Siebrand Mazeland
b03ece26eb * i18n/L10n and translator documentation updates.
* whitespace and indentation updates
2010-09-28 23:21:09 +02:00
Evan Prodromou
4338bc1ee7 bug in time and object handling in Fave::asActivity 2010-09-13 16:22:27 -04:00
Evan Prodromou
d9b959fc64 move code for making activities from OStatus plugin to Subscription and Fave classes 2010-09-13 11:44:20 -04:00
Zach Copley
b50f300566 Implement since_id and max_id param handling for /api/favorites 2010-05-05 14:46:36 -07:00
Brion Vibber
44caa3a93f Consistently send Profiles into Fave::addNew() 2010-03-23 11:08:30 -07:00
Brion Vibber
6b134ae4c7 Dropped deprecated timestamp-based 'since' parameter for all API methods. When it sneaks in it can cause some very slow queries due to mismatches with the indexing.
Twitter removed 'since' support some time ago, and we've already removed it from the public timeline, so it shouldn't be missed.
2010-03-02 11:54:02 -08:00
Evan Prodromou
36d21fa716 Add events for favor and disfavor
Added events to core code for when someone favors or disfavors a
notice.
2010-02-20 12:03:32 -05:00
Brion Vibber
4e2acd153b ...and drop the unnecessary &reference from child class pkeyGet() overrides. 2010-01-06 14:28:40 -08:00
Evan Prodromou
749d9bfbbf Merge branch 'master' into 0.8.x
Conflicts:
	scripts/twitterstatusfetcher.php
2009-07-23 14:45:21 -07:00
Evan Prodromou
5f7fb99447 change NOTICE_GATEWAY to Notice::GATEWAY so autoloading works 2009-07-23 14:22:22 -07:00
Brenda Wallace
63ea2b7c45 changed to SQL standard of LIMIT 20 OFFSET 1 etc. 2009-07-15 20:05:57 +12:00
Evan Prodromou
ac361791c4 fix caching of faves by own, other 2009-07-05 11:32:57 -04:00
Zach Copley
31325f0995 Stop Twitter gateway notices from leaking via user faves pages 2009-06-23 13:51:23 -07:00
Zach Copley
425f9d703c Ticket #1567 - Change max_id to return notices <= ID instead of < ID 2009-05-29 16:54:24 -07:00
Zach Copley
eb76a3bbb3 Ticket #1567 - API: Change before_id parameter to max_id 2009-05-29 16:32:55 -07:00
Evan Prodromou
5314d9b2cf make faves work with ids 2009-05-01 12:01:28 -07:00
Evan Prodromou
04ef1ba8ee change function headers to K&R style
Another huge change, for PEAR code standards compliance. Function
headers have to be in K&R style (opening brace on its own line),
instead of having the opening brace on the same line as the function
and parameters. So, a little perl magic found all the function
definitions and move the opening brace to the next line (properly
indented... usually).

darcs-hash:20081223193323-84dde-a28e36ecc66672c783c2842d12fc11043c13ab28.gz
2008-12-23 14:33:23 -05:00
Evan Prodromou
eb2f9c98ac replace NULL with null
Another global search-and-replace update. Here, I've replaced the PHP
keyword 'NULL' with its lowercase version. This is another PEAR code
standards change.

darcs-hash:20081223192129-84dde-4a0182e0ec16a01ad88745ad3e08f7cb501aee0b.gz
2008-12-23 14:21:29 -05:00
Evan Prodromou
edbc0c665c replace all tabs with four spaces
The PEAR coding standards decree: no tabs, but indent by four spaces.
I've done a global search-and-replace on all tabs, replacing them by
four spaces. This is a huge change, but it will go a long way to
getting us towards phpcs-compliance. And that means better code
readability, and that means more participation.

darcs-hash:20081223191907-84dde-21e8efe210e6d5d54e935a22d0cee5c7bbfc007d.gz
2008-12-23 14:19:07 -05:00
Evan Prodromou
fd0652994c incorrect function call in Fave
darcs-hash:20081002162604-5ed1f-45e9f43e3dbe778462377ebe22f994bdafb4bcdd.gz
2008-10-02 12:26:04 -04:00
Evan Prodromou
37735a35c0 try to use caching functions where possible in User
darcs-hash:20081002162513-5ed1f-fff718be660fa4a8abf58df402a3db30d72d11db.gz
2008-10-02 12:25:13 -04:00
Evan Prodromou
8da61dc1d3 path correct in require_once for memcached
darcs-hash:20080926161824-5ed1f-b4fb53e5ca65bb099aabbba6ea60a13496f669a2.gz
2008-09-26 12:18:24 -04:00
Evan Prodromou
f6615f70e5 prepend Memcached_DataObject require with INSTALLDIR
darcs-hash:20080926161540-5ed1f-2e9dc6f2297c612208214a6d52f36ce0dd7aa4de.gz
2008-09-26 12:15:40 -04:00
Evan Prodromou
e2e6bbb298 caching layer for DB/DataObject
I added a new class, Memcached_DataObject, that will (optionally)
fetch data out of a memcached server if it's available. This only
works on 'staticGet'.

Methods that write to the database (insert, update, delete) will clear
and set the cache correctly, too.

darcs-hash:20080926160941-5ed1f-922de078b4c1941853ad014edf9a17fae486f8cf.gz
2008-09-26 12:09:41 -04:00
Evan Prodromou
a8a3667774 initial non-Ajax version of favorites
darcs-hash:20080908181624-84dde-8200e1d91eb5f560ef0f296c9e1c56f93ef1b0c5.gz
2008-09-08 14:16:24 -04:00
Evan Prodromou
47d15bc662 first step towards adding favorites to the system
darcs-hash:20080813142637-84dde-9530d153eceb6bbedbb692755aa5c96d65d8e071.gz
2008-08-13 10:26:37 -04:00