forked from GNUsocial/gnu-social
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.
This commit is contained in:
@@ -134,7 +134,7 @@ class ModPlusPlugin extends Plugin
|
||||
*/
|
||||
protected function showProfileOptions(HTMLOutputter $out, $profile)
|
||||
{
|
||||
$isRemote = !(User::staticGet('id', $profile->id));
|
||||
$isRemote = !(User::getKV('id', $profile->id));
|
||||
if ($isRemote) {
|
||||
$target = common_local_url('remoteprofile', array('id' => $profile->id));
|
||||
// TRANS: Label for access to remote profile options.
|
||||
|
||||
@@ -12,7 +12,7 @@ class RemoteProfileAction extends ShowstreamAction
|
||||
|
||||
$id = $this->arg('id');
|
||||
$this->user = false;
|
||||
$this->profile = Profile::staticGet('id', $id);
|
||||
$this->profile = Profile::getKV('id', $id);
|
||||
|
||||
if (!$this->profile) {
|
||||
// TRANS: Error message displayed when referring to a user without a profile.
|
||||
@@ -20,7 +20,7 @@ class RemoteProfileAction extends ShowstreamAction
|
||||
return false;
|
||||
}
|
||||
|
||||
$user = User::staticGet('id', $this->profile->id);
|
||||
$user = User::getKV('id', $this->profile->id);
|
||||
if ($user) {
|
||||
// This is a local user -- send to their regular profile.
|
||||
$url = common_local_url('showstream', array('nickname' => $user->nickname));
|
||||
|
||||
Reference in New Issue
Block a user