]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Updating all Memcached_DataObject extended classes to Managed_DataObject
authorMikael Nordfeldth <mmn@hethane.se>
Sun, 18 Aug 2013 10:10:44 +0000 (12:10 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Sun, 18 Aug 2013 10:32:32 +0000 (12:32 +0200)
In some brief tests, this causes no problems.

In this state however, you would need to modify DB_DataObject to have a static declaration of staticget (and probably pkeyGet). The next commit will change the staticGet overload to a unique function name (like getKV for getKeyValue), which means we can properly call the function by PHP Strict Standards.

41 files changed:
classes/Old_school_prefs.php
classes/Status_network.php
classes/Unavailable_status_network.php
plugins/AnonymousFave/Fave_tally.php
plugins/Blacklist/Homepage_blacklist.php
plugins/Blacklist/Nickname_blacklist.php
plugins/Bookmark/Bookmark.php
plugins/EmailSummary/Email_summary_status.php
plugins/FacebookBridge/classes/Notice_to_item.php
plugins/FollowEveryone/User_followeveryone_prefs.php
plugins/GNUsocialPhotos/classes/gnusocialphoto.php
plugins/GNUsocialPhotos/classes/gnusocialphotoalbum.php
plugins/GNUsocialProfileExtensions/classes/GNUsocialProfileExtensionField.php
plugins/GNUsocialProfileExtensions/classes/GNUsocialProfileExtensionResponse.php
plugins/GNUsocialProfileExtensions/classes/ProfileExtensionField.php
plugins/GroupPrivateMessage/Group_message.php
plugins/GroupPrivateMessage/Group_message_profile.php
plugins/GroupPrivateMessage/Group_privacy_settings.php
plugins/Irc/Irc_waiting_message.php
plugins/Msn/msn_waiting_message.php
plugins/NoticeTitle/Notice_title.php
plugins/OStatus/classes/FeedSub.php
plugins/OStatus/classes/HubSub.php
plugins/OStatus/classes/Magicsig.php
plugins/OStatus/classes/Ostatus_source.php
plugins/OpenID/User_openid.php
plugins/OpenID/User_openid_trustroot.php
plugins/RegisterThrottle/Registration_ip.php
plugins/Sample/User_greeting_count.php
plugins/Sitemap/Sitemap_notice_count.php
plugins/Sitemap/Sitemap_user_count.php
plugins/SubMirror/classes/SubMirror.php
plugins/TwitterBridge/Notice_to_status.php
plugins/TwitterBridge/Twitter_synch_status.php
plugins/UserFlag/User_flag_profile.php
plugins/YammerImport/classes/Yammer_common.php
plugins/YammerImport/classes/Yammer_group.php
plugins/YammerImport/classes/Yammer_notice.php
plugins/YammerImport/classes/Yammer_notice_stub.php
plugins/YammerImport/classes/Yammer_state.php
plugins/YammerImport/classes/Yammer_user.php

index 29e13ddc74e041a0288577af8149a29dfb3dd4e0..505399c03587fdacf31644b570e385644599b654 100644 (file)
@@ -81,8 +81,4 @@ class Old_school_prefs extends Managed_DataObject
             ),
         );
     }
-
-    function staticGet($k,$v=NULL) {
-        return Memcached_DataObject::staticGet('Old_school_prefs',$k,$v);
-    }
 }
index b7a7e1c0a7de0ae09a7a8cabaede07c0041fff2f..5a683c04d215007ed1384ef997bc34a84cd5d5c7 100644 (file)
@@ -42,7 +42,7 @@ class Status_network extends Safe_DataObject
     public $modified;                        // timestamp()   not_null default_CURRENT_TIMESTAMP
 
     /* Static get */
-    function staticGet($k,$v=NULL) {
+    static function staticGet($k,$v=NULL) {
         $i = DB_DataObject::staticGet('Status_network',$k,$v);
 
         // Don't use local process cache; if we're fetching multiple
index 7eefac2c1f583676d64065c1f52177adcfee9768..d1160815c72670858b3e5a83cfd9b119c926ac87 100644 (file)
@@ -50,20 +50,6 @@ class Unavailable_status_network extends Managed_DataObject
     public $nickname;              // varchar(64) UUID
     public $created;               // datetime
 
-    /**
-     * Get an instance by key
-     *
-     * @param string $k Key to use to lookup (usually 'id' for this class)
-     * @param mixed  $v Value to lookup
-     *
-     * @return Happening object found, or null for no hits
-     *
-     */
-    function staticGet($k, $v=null)
-    {
-        return Memcached_DataObject::staticGet('Unavailable_status_network', $k, $v);
-    }
-
     /**
      * The One True Thingy that must be defined and declared.
      */
index 7a44c2350ded41b77920e92962a12e5d79f05f9b..7a610fb5f5b3c47084844267cfe9791f301fba27 100644 (file)
@@ -44,7 +44,7 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
  * @license  http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
  * @link     http://status.net/
  */
-class Fave_tally extends Memcached_DataObject
+class Fave_tally extends Managed_DataObject
 {
     ###START_AUTOCODE
     /* the code below is auto generated do not remove the above tag */
@@ -54,9 +54,6 @@ class Fave_tally extends Memcached_DataObject
     public $count;                           // int(4)  not_null
     public $modified;                        // datetime   not_null default_0000-00-00%2000%3A00%3A00
 
-    /* Static get */
-    function staticGet($k, $v = NULL) { return Memcached_DataObject::staticGet('Fave_tally', $k, $v); }
-
     /* the code above is auto generated do not remove the tag below */
     ###END_AUTOCODE
 
index 2820294fa26f108a4d3610896fa0db78fdab4d24..99a6786de42ebd84789ee0bfcb9812e02afe50be 100644 (file)
@@ -44,28 +44,12 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
  *
  * @see      DB_DataObject
  */
-class Homepage_blacklist extends Memcached_DataObject
+class Homepage_blacklist extends Managed_DataObject
 {
     public $__table = 'homepage_blacklist'; // table name
     public $pattern;                        // string pattern
     public $created;                        // datetime
 
-    /**
-     * Get an instance by key
-     *
-     * This is a utility method to get a single instance with a given key value.
-     *
-     * @param string $k Key to use to lookup (usually 'user_id' for this class)
-     * @param mixed  $v Value to lookup
-     *
-     * @return Homepage_blacklist object found, or null for no hits
-     *
-     */
-    function staticGet($k, $v=null)
-    {
-        return Memcached_DataObject::staticGet('Homepage_blacklist', $k, $v);
-    }
-
     /**
      * return table definition for DB_DataObject
      *
index d5d46a9490e9f58d1b62d1f4a189eea039c589d3..bc466f879d87116f138309cfe5c5ff66b6922878 100644 (file)
@@ -44,28 +44,12 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
  *
  * @see      DB_DataObject
  */
-class Nickname_blacklist extends Memcached_DataObject
+class Nickname_blacklist extends Managed_DataObject
 {
     public $__table = 'nickname_blacklist'; // table name
     public $pattern;                        // string pattern
     public $created;                        // datetime
 
-    /**
-     * Get an instance by key
-     *
-     * This is a utility method to get a single instance with a given key value.
-     *
-     * @param string $k Key to use to lookup
-     * @param mixed  $v Value to lookup
-     *
-     * @return Nickname_blacklist object found, or null for no hits
-     *
-     */
-    function staticGet($k, $v=null)
-    {
-        return Memcached_DataObject::staticGet('Nickname_blacklist', $k, $v);
-    }
-
     /**
      * return table definition for DB_DataObject
      *
index 7e831a3524f4690a40349ef14163ca04a193f1f3..f9bc71447eee79df3cc7c1539be7eed6b189c55d 100644 (file)
@@ -42,7 +42,7 @@ if (!defined('STATUSNET')) {
  *
  * @see      DB_DataObject
  */
-class Bookmark extends Memcached_DataObject
+class Bookmark extends Managed_DataObject
 {
     public $__table = 'bookmark'; // table name
     public $id;          // char(36) primary_key not_null
@@ -53,22 +53,6 @@ class Bookmark extends Memcached_DataObject
     public $uri;         // varchar(255)
     public $created;     // datetime
 
-    /**
-     * Get an instance by key
-     *
-     * This is a utility method to get a single instance with a given key value.
-     *
-     * @param string $k Key to use to lookup (usually 'user_id' for this class)
-     * @param mixed  $v Value to lookup
-     *
-     * @return User_greeting_count object found, or null for no hits
-     *
-     */
-    function staticGet($k, $v=null)
-    {
-        return Memcached_DataObject::staticGet('Bookmark', $k, $v);
-    }
-
     /**
      * Get an instance by compound key
      *
index 0c9e880f18de498a4fb68569b099a9133d658e97..97acd6ca66a082a753e9f370070054947e9da7a0 100644 (file)
@@ -46,7 +46,7 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
  *
  * @see      DB_DataObject
  */
-class Email_summary_status extends Memcached_DataObject
+class Email_summary_status extends Managed_DataObject
 {
     public $__table = 'email_summary_status'; // table name
     public $user_id;                         // int(4)  primary_key not_null
@@ -55,20 +55,6 @@ class Email_summary_status extends Memcached_DataObject
     public $created;                         // datetime not_null
     public $modified;                        // datetime not_null
 
-    /**
-     * Get an instance by key
-     *
-     * @param string $k Key to use to lookup (usually 'user_id' for this class)
-     * @param mixed  $v Value to lookup
-     *
-     * @return Email_summary_status object found, or null for no hits
-     *
-     */
-    function staticGet($k, $v=null)
-    {
-        return Memcached_DataObject::staticGet('email_summary_status', $k, $v);
-    }
-
     /**
      * return table definition for DB_DataObject
      *
index d37c95ffc1e5858cb7cd22099604ece3990b6272..fe0a90c84835a9f8cd129fcbb7485923ba823b90 100644 (file)
@@ -48,29 +48,13 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
  *
  * @see      DB_DataObject
  */
-class Notice_to_item extends Memcached_DataObject
+class Notice_to_item extends Managed_DataObject
 {
     public $__table = 'notice_to_item'; // table name
     public $notice_id;                  // int(4)  primary_key not_null
     public $item_id;                    // varchar(255) not null
     public $created;                    // datetime
 
-    /**
-     * Get an instance by key
-     *
-     * This is a utility method to get a single instance with a given key value.
-     *
-     * @param string $k Key to use to lookup
-     * @param mixed  $v Value to lookup
-     *
-     * @return Notice_to_item object found, or null for no hits
-     *
-     */
-    function staticGet($k, $v=null)
-    {
-        return Memcached_DataObject::staticGet('Notice_to_item', $k, $v);
-    }
-
     /**
      * return table definition for DB_DataObject
      *
index 7690fd220aa080853e2e3a83c6e0b000b859fbba..e347d492d10eca3b9d775c15739f25b19e5ec40d 100644 (file)
@@ -52,27 +52,12 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
  *
  * @see      DB_DataObject
  */
-class User_followeveryone_prefs extends Memcached_DataObject
+class User_followeveryone_prefs extends Managed_DataObject
 {
     public $__table = 'user_followeveryone_prefs'; // table name
     public $user_id;                               // int(4)  primary_key not_null
     public $followeveryone;                        // tinyint(1)
 
-    /**
-     * Get an instance by key
-     *
-     * This is a utility method to get a single instance with a given key value.
-     *
-     * @param string $k Key to use to lookup (usually 'user_id' for this class)
-     * @param mixed  $v Value to lookup
-     *
-     * @return User_followeveryone_prefs object found, or null for no hits
-     */
-    function staticGet($k, $v=null)
-    {
-        return Memcached_DataObject::staticGet('User_followeveryone_prefs', $k, $v);
-    }
-
     /**
      * return table definition for DB_DataObject
      *
index a122d44ecbf68e77a56f9a653c4b4d56dff74c89..3898d42994d299cc868827c28eb711341f374f80 100644 (file)
@@ -32,7 +32,7 @@ if (!defined('STATUSNET')) {
 
 require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
 
-class GNUsocialPhoto extends Memcached_DataObject
+class GNUsocialPhoto extends Managed_DataObject
 {
     public $__table = 'GNUsocialPhoto';
     public $id;         // int(11)
@@ -42,17 +42,6 @@ class GNUsocialPhoto extends Memcached_DataObject
     public $thumb_uri;  // varchar(512)
        public $title;      // varchar(512)
        public $photo_description; // text
-    
-
-    /**
-     *
-     * k key
-     * v value
-     */
-    function staticGet($k,$v=NULL)
-    {
-        return Memcached_DataObject::staticGet('GNUsocialPhoto',$k,$v);
-    }
 
 /*    function delete()
     {
index 848f92dffabdaed1488a71f2d23314b15cf65437..14e673beb71b7033bc744a8e361dc79b3085cc56 100644 (file)
@@ -33,7 +33,7 @@ if (!defined('STATUSNET')) {
 
 require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
 
-class GNUsocialPhotoAlbum extends Memcached_DataObject
+class GNUsocialPhotoAlbum extends Managed_DataObject
 {
     public $__table = 'GNUsocialPhotoAlbum';
     public $album_id;          // int(11) -- Unique identifier for the album
@@ -41,13 +41,6 @@ class GNUsocialPhotoAlbum extends Memcached_DataObject
     public $album_name;        // varchar(256) -- Title for this album
     public $album_description; // text -- A description of the album
     
-
-    function staticGet($k,$v=NULL)
-    {
-        return Memcached_DataObject::staticGet('GNUsocialPhotoAlbum',$k,$v);
-    }
-
-
     /* TODO: Primary key on both album_id, profile_id / foriegn key on profile_id */
     function table()
     {
index 6877eab1bb1ce4ef5579f7c11169f98bdabf8dca..f8568c26e4e927f91d75e7fa76d6c0c3ccd98993 100644 (file)
@@ -32,7 +32,7 @@ if (!defined('STATUSNET')) {
 
 require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
 
-class GNUsocialProfileExtensionField extends Memcached_DataObject
+class GNUsocialProfileExtensionField extends Managed_DataObject
 {
     public $__table = 'GNUsocialProfileExtensionField';
     public $id;          // int(11)
@@ -41,17 +41,6 @@ class GNUsocialProfileExtensionField extends Memcached_DataObject
     public $description; // text
     public $type;        // varchar(256)
 
-    /**
-     *
-     * k key
-     * v value
-     */
-    function staticGet($k,$v=NULL)
-    {
-        return Memcached_DataObject::staticGet('GNUsocialProfileExtensionField',$k,$v);
-    }
-
-
     function table()
     {
         return array('id' => DB_DATAOBJECT_INT + DB_DATAOBJECT_NOTNULL,
index fbf5af0dbb6ef2e53e71919f0295abab1d165327..de87447e81d9cfad9b57b4142f8853a8fbd8af4d 100644 (file)
@@ -32,7 +32,7 @@ if (!defined('STATUSNET')) {
 
 require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
 
-class GNUsocialProfileExtensionResponse extends Memcached_DataObject
+class GNUsocialProfileExtensionResponse extends Managed_DataObject
 {
     public $__table = 'GNUsocialProfileExtensionResponse';
     public $id;           // int(11)
@@ -40,17 +40,6 @@ class GNUsocialProfileExtensionResponse extends Memcached_DataObject
     public $profile_id;   // int(11)
     public $value;     // text
 
-    /**
-     *
-     * k key
-     * v value
-     */
-    function staticGet($k,$v=NULL)
-    {
-        return Memcached_DataObject::staticGet('GNUsocialProfileExtensionResponse',$k,$v);
-    }
-
-
     function table()
     {
         return array('id' => DB_DATAOBJECT_INT + DB_DATAOBJECT_NOTNULL,
index 142b70230b010a93536640df519e93d9584e8f44..d8159764570f5f7d00acef9c9d79871e828cb91d 100644 (file)
@@ -32,7 +32,7 @@ if (!defined('STATUSNET')) {
 
 require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
 
-class GNUsocialPhoto extends Memcached_DataObject
+class GNUsocialPhoto extends Managed_DataObject
 {
     public $__table = 'GNUsocialPhoto';
     public $id;         // int(11)
@@ -42,17 +42,6 @@ class GNUsocialPhoto extends Memcached_DataObject
     public $thumb_uri;  // varchar(512)
        public $title;      // varchar(512)
        public $photo_description; // text
-    
-
-    /**
-     *
-     * k key
-     * v value
-     */
-    function staticGet($k,$v=NULL)
-    {
-        return Memcached_DataObject::staticGet('GNUsocialPhoto',$k,$v);
-    }
 
 /*    function delete()
     {
index 53fe0fe90f211751ebb520abedcbff3a1b1b25ff..a74f7cd60abfe69e0086a86ecb086c9abfabb9f7 100644 (file)
@@ -44,7 +44,7 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
  *
  * @see      DB_DataObject
  */
-class Group_message extends Memcached_DataObject
+class Group_message extends Managed_DataObject
 {
     public $__table = 'group_message'; // table name
     public $id;                        // char(36)  primary_key not_null
@@ -56,21 +56,6 @@ class Group_message extends Memcached_DataObject
     public $url;
     public $created;
 
-    /**
-     * Get an instance by key
-     *
-     * This is a utility method to get a single instance with a given key value.
-     *
-     * @param string $k Key to use to lookup (usually 'user_id' for this class)
-     * @param mixed  $v Value to lookup
-     *
-     * @return Group_message object found, or null for no hits
-     */
-    function staticGet($k, $v=null)
-    {
-        return Memcached_DataObject::staticGet('Group_message', $k, $v);
-    }
-
     /**
      * return table definition for DB_DataObject
      *
index 69cc3e40d4c3e4f477e46875d3bd7d2fedf5a564..b059222dcccfc80af5e1f6b920c79d5d9650da9e 100644 (file)
@@ -44,28 +44,13 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
  *
  * @see      DB_DataObject
  */
-class Group_message_profile extends Memcached_DataObject
+class Group_message_profile extends Managed_DataObject
 {
     public $__table = 'group_message_profile'; // table name
     public $to_profile;                        // int
     public $group_message_id;                  // char(36)  primary_key not_null
     public $created;
 
-    /**
-     * Get an instance by key
-     *
-     * This is a utility method to get a single instance with a given key value.
-     *
-     * @param string $k Key to use to lookup (usually 'user_id' for this class)
-     * @param mixed  $v Value to lookup
-     *
-     * @return Group_message object found, or null for no hits
-     */
-    function staticGet($k, $v=null)
-    {
-        return Memcached_DataObject::staticGet('Group_message_profile', $k, $v);
-    }
-
     /**
      * return table definition for DB_DataObject
      *
index 9a8e5c045a7eb60d24716be15a44f795f70105b4..a325dd95f140f336b8d75da3fe6589644d7ee689 100644 (file)
@@ -44,7 +44,7 @@ if (!defined('STATUSNET')) {
  *
  * @see      DB_DataObject
  */
-class Group_privacy_settings extends Memcached_DataObject
+class Group_privacy_settings extends Managed_DataObject
 {
     public $__table = 'group_privacy_settings';
     /** ID of the group. */
@@ -70,21 +70,6 @@ class Group_privacy_settings extends Memcached_DataObject
     const MEMBER   = 2;
     const ADMIN    = 4;
 
-    /**
-     * Get an instance by key
-     *
-     * This is a utility method to get a single instance with a given key value.
-     *
-     * @param string $k Key to use to lookup (usually 'user_id' for this class)
-     * @param mixed  $v Value to lookup
-     *
-     * @return User_greeting_count object found, or null for no hits
-     */
-    function staticGet($k, $v=null)
-    {
-        return Memcached_DataObject::staticGet('Group_privacy_settings', $k, $v);
-    }
-
     /**
      * return table definition for DB_DataObject
      *
index 659a27ffa945b2843dd8dce2294b9fcd8cc1c72f..ba8d6bd03dcc6ef2754a5dbedd435636bcf57df1 100644 (file)
@@ -5,7 +5,7 @@
 \r
 require_once INSTALLDIR.'/classes/Memcached_DataObject.php';\r
 \r
-class Irc_waiting_message extends Memcached_DataObject {\r
+class Irc_waiting_message extends Managed_DataObject {\r
 \r
     public $__table = 'irc_waiting_message'; // table name\r
     public $id;                              // int primary_key not_null auto_increment\r
@@ -15,11 +15,6 @@ class Irc_waiting_message extends Memcached_DataObject {
     public $created;                         // datetime() not_null\r
     public $claimed;                         // datetime()\r
 \r
-    /* Static get */\r
-    public function staticGet($k, $v = null) {\r
-        return Memcached_DataObject::staticGet('Irc_waiting_message', $k, $v);\r
-    }\r
-\r
     /**\r
     * return table definition for DB_DataObject\r
     *\r
index 707cd04389a6dc9d527fa40ffe798cb0a791d073..03c03f856ea6e057bca187a6115bff165b092c11 100644 (file)
@@ -4,7 +4,7 @@
  */\r
 require_once INSTALLDIR.'/classes/Memcached_DataObject.php';\r
 \r
-class Msn_waiting_message extends Memcached_DataObject {\r
+class Msn_waiting_message extends Managed_DataObject {\r
 \r
     public $__table = 'msn_waiting_message'; // table name\r
     public $id;                              // int primary_key not_null auto_increment\r
@@ -13,11 +13,6 @@ class Msn_waiting_message extends Memcached_DataObject {
     public $created;                         // datetime() not_null\r
     public $claimed;                         // datetime()\r
 \r
-    /* Static get */\r
-    public function staticGet($k, $v = null) {\r
-        return Memcached_DataObject::staticGet('Msn_waiting_message', $k, $v);\r
-    }\r
-\r
     /**\r
     * return table definition for DB_DataObject\r
     *\r
index 4030b5c965579578e783461f694d8a0eba70ee29..17dc8bdd1e2e1b70a15886144bbbc30fbbb06bc1 100644 (file)
@@ -44,7 +44,7 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
  *
  * @see      DB_DataObject
  */
-class Notice_title extends Memcached_DataObject
+class Notice_title extends Managed_DataObject
 {
     const MAXCHARS = 255;
 
@@ -52,22 +52,6 @@ class Notice_title extends Memcached_DataObject
     public $notice_id;                         // int(4)  primary_key not_null
     public $title;                             // varchar(255)
 
-    /**
-     * Get an instance by key
-     *
-     * This is a utility method to get a single instance with a given key value.
-     *
-     * @param string $k Key to use to lookup (usually 'user_id' for this class)
-     * @param mixed  $v Value to lookup
-     *
-     * @return Notice_title object found, or null for no hits
-     *
-     */
-    function staticGet($k, $v=null)
-    {
-        return Memcached_DataObject::staticGet('Notice_title', $k, $v);
-    }
-
     /**
      * return table definition for DB_DataObject
      *
index 7da8dcd7ee6b11bdbd04090ffcf2685f88517df4..d7eabf33eefd440de0aec54891a58e578cc7762f 100644 (file)
@@ -59,7 +59,7 @@ class FeedDBException extends FeedSubException
  * Higher-level behavior building OStatus stuff on top is handled
  * under Ostatus_profile.
  */
-class FeedSub extends Memcached_DataObject
+class FeedSub extends Managed_DataObject
 {
     public $__table = 'feedsub';
 
@@ -78,11 +78,6 @@ class FeedSub extends Memcached_DataObject
     public $created;
     public $modified;
 
-    public /*static*/ function staticGet($k, $v=null)
-    {
-        return parent::staticGet(__CLASS__, $k, $v);
-    }
-
     /**
      * return table definition for DB_DataObject
      *
index e7ac23af5821ee5dfdfa4e480d0ddc1c4b301b94..66e7d30e967fa543ad22613d98b5151ac9857d85 100644 (file)
@@ -26,7 +26,7 @@ if (!defined('STATUSNET')) {
  * @package Hub
  * @author Brion Vibber <brion@status.net>
  */
-class HubSub extends Memcached_DataObject
+class HubSub extends Managed_DataObject
 {
     public $__table = 'hubsub';
 
@@ -40,11 +40,6 @@ class HubSub extends Memcached_DataObject
     public $created;
     public $modified;
 
-    public /*static*/ function staticGet($topic, $callback)
-    {
-        return parent::staticGet(__CLASS__, 'hashkey', self::hashkey($topic, $callback));
-    }
-
     protected static function hashkey($topic, $callback)
     {
         return sha1($topic . '|' . $callback);
index 31d061e6a0148ab90522db25ce3c5f7857440e73..01c4689676ec903dc901a81e0a7c079a17cc1bec 100644 (file)
@@ -33,7 +33,7 @@ if (!defined('STATUSNET')) {
 
 require_once 'Crypt/RSA.php';
 
-class Magicsig extends Memcached_DataObject
+class Magicsig extends Managed_DataObject
 {
     const PUBLICKEYREL = 'magic-public-key';
 
@@ -81,32 +81,6 @@ class Magicsig extends Memcached_DataObject
         $this->alg = $alg;
     }
 
-    /**
-     * Fetch a Magicsig object from the cache or database on a field match.
-     *
-     * @param string $k
-     * @param mixed $v
-     * @return Magicsig
-     */
-    public /*static*/ function staticGet($k, $v=null)
-    {
-        $obj =  parent::staticGet(__CLASS__, $k, $v);
-        if (!empty($obj)) {
-            $obj = Magicsig::fromString($obj->keypair);
-
-            // Double check keys: Crypt_RSA did not
-            // consistently generate good keypairs.
-            // We've also moved to 1024 bit keys.
-            if (strlen($obj->publicKey->modulus->toBits()) != 1024) {
-                $obj->delete();
-                return false;
-            }
-        }
-
-        return $obj;
-    }
-
-
     function table()
     {
         return array(
index 0fd74e48ba6aa44042f27dbf8efa052cdbf48e73..8eefb33fa6826cc6e145a25e0d180b0dafede6a2 100644 (file)
@@ -25,7 +25,7 @@ if (!defined('STATUSNET')) {
  * @package OStatusPlugin
  * @maintainer Brion Vibber <brion@status.net>
  */
-class Ostatus_source extends Memcached_DataObject
+class Ostatus_source extends Managed_DataObject
 {
     public $__table = 'ostatus_source';
 
@@ -33,11 +33,6 @@ class Ostatus_source extends Memcached_DataObject
     public $profile_uri; // uri of the ostatus_profile this came through -- may be a group feed
     public $method; // push or salmon
 
-    public /*static*/ function staticGet($k, $v=null)
-    {
-        return parent::staticGet(__CLASS__, $k, $v);
-    }
-
     /**
      * return table definition for DB_DataObject
      *
index 03a0b0ccd993b8a676201d12a8a074a5716f7563..a8ed576114164406d776c7dd43757a986e902368 100644 (file)
@@ -7,7 +7,7 @@ if (!defined('STATUSNET')) {
     exit(1);
 }
 
-class User_openid extends Memcached_DataObject
+class User_openid extends Managed_DataObject
 {
     ###START_AUTOCODE
     /* the code below is auto generated do not remove the above tag */
@@ -19,10 +19,6 @@ class User_openid extends Memcached_DataObject
     public $created;                         // datetime()   not_null
     public $modified;                        // timestamp()   not_null default_CURRENT_TIMESTAMP
 
-    /* Static get */
-    function staticGet($k,$v=null)
-    { return Memcached_DataObject::staticGet('User_openid',$k,$v); }
-
     /* the code above is auto generated do not remove the tag below */
     ###END_AUTOCODE
 
index eb82115e9518ba05cd58a38bf7e0dde5ca9e0961..7bfd4d90fda5e1bd8969eb79affbdeb6daef10ee 100644 (file)
@@ -7,7 +7,7 @@ if (!defined('STATUSNET')) {
     exit(1);
 }
 
-class User_openid_trustroot extends Memcached_DataObject
+class User_openid_trustroot extends Managed_DataObject
 {
     ###START_AUTOCODE
     /* the code below is auto generated do not remove the above tag */
@@ -18,10 +18,6 @@ class User_openid_trustroot extends Memcached_DataObject
     public $created;                         // datetime()   not_null
     public $modified;                        // timestamp()   not_null default_CURRENT_TIMESTAMP
 
-    /* Static get */
-    function staticGet($k,$v=null)
-    { return Memcached_DataObject::staticGet('User_openid_trustroot',$k,$v); }
-
     /* the code above is auto generated do not remove the tag below */
     ###END_AUTOCODE
 
index f9fc4918d53b8be387e6499ca7ec630d9debbf76..02b137f987baa1211d485acee12658c96070dc7f 100644 (file)
@@ -42,27 +42,13 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
  * @license  http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
  * @link     http://status.net/
  */
-class Registration_ip extends Memcached_DataObject
+class Registration_ip extends Managed_DataObject
 {
     public $__table = 'registration_ip';     // table name
     public $user_id;                         // int(4)  primary_key not_null
     public $ipaddress;                       // varchar(15)
     public $created;                         // timestamp
 
-    /**
-     * Get an instance by key
-     *
-     * @param string $k Key to use to lookup (usually 'user_id' for this class)
-     * @param mixed  $v Value to lookup
-     *
-     * @return User_greeting_count object found, or null for no hits
-     *
-     */
-    function staticGet($k, $v=null)
-    {
-        return Memcached_DataObject::staticGet('Registration_ip', $k, $v);
-    }
-
     /**
      * return table definition for DB_DataObject
      *
index 8128343d817f338660cf12dd27af019bc10ff91f..6c7bcf4911d31f56e6050b151c2457990adc30e0 100644 (file)
@@ -52,27 +52,12 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
  *
  * @see      DB_DataObject
  */
-class User_greeting_count extends Memcached_DataObject
+class User_greeting_count extends Managed_DataObject
 {
     public $__table = 'user_greeting_count'; // table name
     public $user_id;                         // int(4)  primary_key not_null
     public $greeting_count;                  // int(4)
 
-    /**
-     * Get an instance by key
-     *
-     * This is a utility method to get a single instance with a given key value.
-     *
-     * @param string $k Key to use to lookup (usually 'user_id' for this class)
-     * @param mixed  $v Value to lookup
-     *
-     * @return User_greeting_count object found, or null for no hits
-     */
-    function staticGet($k, $v=null)
-    {
-        return Memcached_DataObject::staticGet('User_greeting_count', $k, $v);
-    }
-
     /**
      * return table definition for DB_DataObject
      *
index 2238ff5218e692efad6e48e6c0f6e2436170f5fd..cb42edcbf6ecc62c1efd64371c4715a1445aeb30 100644 (file)
@@ -51,7 +51,7 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
  *
  * @see      DB_DataObject
  */
-class Sitemap_notice_count extends Memcached_DataObject
+class Sitemap_notice_count extends Managed_DataObject
 {
     public $__table = 'sitemap_notice_count'; // table name
 
@@ -60,22 +60,6 @@ class Sitemap_notice_count extends Memcached_DataObject
     public $created;
     public $modified;
 
-    /**
-     * Get an instance by key
-     *
-     * This is a utility method to get a single instance with a given key value.
-     *
-     * @param string $k Key to use to lookup (usually 'notice_id' for this class)
-     * @param mixed  $v Value to lookup
-     *
-     * @return Sitemap_notice_count object found, or null for no hits
-     *
-     */
-    function staticGet($k, $v=null)
-    {
-        return Memcached_DataObject::staticGet('Sitemap_notice_count', $k, $v);
-    }
-
     /**
      * return table definition for DB_DataObject
      *
index 0b45021bf53694c8fd206cc8836b1ba6dda5185d..3377879f9479d6a01df8a7ad51a943817acafdc2 100644 (file)
@@ -47,7 +47,7 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
  *
  * @see      DB_DataObject
  */
-class Sitemap_user_count extends Memcached_DataObject
+class Sitemap_user_count extends Managed_DataObject
 {
     public $__table = 'sitemap_user_count'; // table name
 
@@ -56,22 +56,6 @@ class Sitemap_user_count extends Memcached_DataObject
     public $created;
     public $modified;
 
-    /**
-     * Get an instance by key
-     *
-     * This is a utility method to get a single instance with a given key value.
-     *
-     * @param string $k Key to use to lookup (usually 'user_id' for this class)
-     * @param mixed  $v Value to lookup
-     *
-     * @return Sitemap_user_count object found, or null for no hits
-     *
-     */
-    function staticGet($k, $v=null)
-    {
-        return Memcached_DataObject::staticGet('Sitemap_user_count', $k, $v);
-    }
-
     /**
      * return table definition for DB_DataObject
      *
index b36677e58a03df8835078b54628d45775b36573a..f7c8c567c2c139c4c475312bc3d4de14ff0448ff 100644 (file)
@@ -22,7 +22,7 @@
  * @maintainer Brion Vibber <brion@status.net>
  */
 
-class SubMirror extends Memcached_DataObject
+class SubMirror extends Managed_DataObject
 {
     public $__table = 'submirror';
 
@@ -34,11 +34,6 @@ class SubMirror extends Memcached_DataObject
     public $created;
     public $modified;
 
-    public /*static*/ function staticGet($k, $v=null)
-    {
-        return parent::staticGet(__CLASS__, $k, $v);
-    }
-
     /**
      * return table definition for DB_DataObject
      *
index 313adaeafc0eb229a41c14cc2ade134645fc71e0..f2756060e94e2c4ec33556e829fe5e38d850db9b 100644 (file)
@@ -53,29 +53,13 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
  * @see      DB_DataObject
  */
 
-class Notice_to_status extends Memcached_DataObject
+class Notice_to_status extends Managed_DataObject
 {
     public $__table = 'notice_to_status'; // table name
     public $notice_id;                    // int(4)  primary_key not_null
     public $status_id;                    // int(4)
     public $created;                      // datetime
 
-    /**
-     * Get an instance by key
-     *
-     * This is a utility method to get a single instance with a given key value.
-     *
-     * @param string $k Key to use to lookup
-     * @param mixed  $v Value to lookup
-     *
-     * @return Notice_to_status object found, or null for no hits
-     *
-     */
-    function staticGet($k, $v=null)
-    {
-        return Memcached_DataObject::staticGet('Notice_to_status', $k, $v);
-    }
-
     /**
      * return table definition for DB_DataObject
      *
index 9c61e7e7e0fd0f82052ddcc28ee0e5ed483a393c..c9a0268575bb241d4e6cb1f875a566f1ff3c3ae5 100644 (file)
@@ -48,7 +48,7 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
  *
  * @see      DB_DataObject
  */
-class Twitter_synch_status extends Memcached_DataObject
+class Twitter_synch_status extends Managed_DataObject
 {
     public $__table = 'twitter_synch_status'; // table name
     public $foreign_id;                         // int(4)  primary_key not_null
@@ -65,7 +65,7 @@ class Twitter_synch_status extends Memcached_DataObject
      *
      * @return Twitter_synch_status object found, or null for no hits
      */
-    function staticGet($k, $v=null)
+    static function staticGet($k, $v=null)
     {
         throw new Exception("Use pkeyGet() for this class.");
     }
index cdc67cf8e74770a5a7dd54ce6da4788b99486593..02b7a7849f01e6727c9cbfceeb67506a31727dea 100644 (file)
@@ -44,7 +44,7 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
  * @license  http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
  * @link     http://status.net/
  */
-class User_flag_profile extends Memcached_DataObject
+class User_flag_profile extends Managed_DataObject
 {
     ###START_AUTOCODE
     /* the code below is auto generated do not remove the above tag */
@@ -55,9 +55,6 @@ class User_flag_profile extends Memcached_DataObject
     public $created;                         // datetime   not_null default_0000-00-00%2000%3A00%3A00
     public $cleared;                         // datetime   not_null default_0000-00-00%2000%3A00%3A00
 
-    /* Static get */
-    function staticGet($k,$v=NULL) { return Memcached_DataObject::staticGet('User_flag_profile',$k,$v); }
-
     /* the code above is auto generated do not remove the tag below */
     ###END_AUTOCODE
 
index e262623263cc0b7892d504f4bc8df0a740eebd65..e794191d1b2e7bcece95e2f038eec94c7943726b 100644 (file)
@@ -35,12 +35,12 @@ if (!defined('STATUSNET')) {
  * Common base class for the Yammer import mappings for users, groups, and notices.
  *
  * Child classes must override these static methods, since we need to run
- * on PHP 5.2.x which has no late static binding:
+ * on PHP 5.2.x which has no late static binding: (not really anymore)
  * - staticGet (as our other classes)
  * - schemaDef (call self::doSchemaDef)
  * - record (call self::doRecord)
  */
-class Yammer_common extends Memcached_DataObject
+class Yammer_common extends Managed_DataObject
 {
     public $__table = 'yammer_XXXX'; // table name
     public $__field = 'XXXX_id';     // field name to save into
@@ -133,13 +133,13 @@ class Yammer_common extends Memcached_DataObject
      */
     protected static function doRecord($class, $field, $orig_id, $local_id)
     {
-        $map = parent::staticGet($class, 'id', $orig_id);
+        $map = Memcached_DataObject::staticGet($class, 'id', $orig_id);
 
         if (!empty($map)) {
             return $map;
         }
 
-        $map = parent::staticGet($class, $field, $local_id);
+        $map = Memcached_DataObject::staticGet($class, $field, $local_id);
 
         if (!empty($map)) {
             return $map;
index a52b5119d4b3ba86c8feb225a0a3606b79d955b7..ac4dc79e911fa3adcccda31118fbecf6684292fa 100644 (file)
@@ -37,22 +37,6 @@ class Yammer_group extends Yammer_common
     public $__field = 'group_id';     // field to map to
     public $group_id;                 // int
 
-    /**
-     * Get an instance by key
-     *
-     * This is a utility method to get a single instance with a given key value.
-     *
-     * @param string $k Key to use to lookup
-     * @param mixed  $v Value to lookup
-     *
-     * @return Yammer_group object found, or null for no hits
-     *
-     */
-    function staticGet($k, $v=null)
-    {
-        return Memcached_DataObject::staticGet('Yammer_group', $k, $v);
-    }
-
     /**
      * Return schema definition to set this table up in onCheckSchema
      */
index 118266aed0e29c6b79224b1e061e1f5b45392f00..d903b127b596f8d6f047577c5c6d033892b40a99 100644 (file)
@@ -37,22 +37,6 @@ class Yammer_notice extends Yammer_common
     public $__field = 'notice_id';     // field to map to
     public $notice_id;                 // int
 
-    /**
-     * Get an instance by key
-     *
-     * This is a utility method to get a single instance with a given key value.
-     *
-     * @param string $k Key to use to lookup
-     * @param mixed  $v Value to lookup
-     *
-     * @return Yammer_notice object found, or null for no hits
-     *
-     */
-    function staticGet($k, $v=null)
-    {
-        return Memcached_DataObject::staticGet('Yammer_notice', $k, $v);
-    }
-
     /**
      * Return schema definition to set this table up in onCheckSchema
      */
index 6dd78206d2b6350fa2f1088ef950e32683fd1830..e38d3164e3f6357dcec2af4379955cdb022d18cf 100644 (file)
@@ -40,28 +40,13 @@ if (!defined('STATUSNET')) {
  * down in reverse chronological order, then go back over them from oldest to
  * newest and actually save them into our notice table.
  */
-class Yammer_notice_stub extends Memcached_DataObject
+class Yammer_notice_stub extends Managed_DataObject
 {
     public $__table = 'yammer_notice_stub'; // table name
     public $id;                             // int  primary_key not_null
     public $json_data;                      // text
     public $created;                        // datetime
 
-    /**
-     * Get an instance by key
-     *
-     * This is a utility method to get a single instance with a given key value.
-     *
-     * @param string $k Key to use to lookup
-     * @param mixed  $v Value to lookup
-     *
-     * @return Yammer_notice_stub object found, or null for no hits
-     */
-    function staticGet($k, $v=null)
-    {
-        return Memcached_DataObject::staticGet('Yammer_notice_stub', $k, $v);
-    }
-
     /**
      * Return schema definition to set this table up in onCheckSchema
      */
index 548fbbf0241f732c304b5b5acde4f27628f99316..b0f0dfabf3fdbf06dd8ec012887f21d577beab5a 100644 (file)
@@ -31,7 +31,7 @@ if (!defined('STATUSNET')) {
     exit(1);
 }
 
-class Yammer_state extends Memcached_DataObject
+class Yammer_state extends Managed_DataObject
 {
     public $__table = 'yammer_state'; // table name
     public $id;                       // int  primary_key not_null
@@ -46,21 +46,6 @@ class Yammer_state extends Memcached_DataObject
     public $created;                  // datetime
     public $modified;                 // datetime
 
-    /**
-     * Get an instance by key
-     *
-     * This is a utility method to get a single instance with a given key value.
-     *
-     * @param string $k Key to use to lookup
-     * @param mixed  $v Value to lookup
-     *
-     * @return Yammer_state object found, or null for no hits
-     */
-    function staticGet($k, $v=null)
-    {
-        return Memcached_DataObject::staticGet('Yammer_state', $k, $v);
-    }
-
     /**
      * Return schema definition to set this table up in onCheckSchema
      */
index 813961334773219a08688019deeb80f11a3b150d..71a025d84c18304f260812d5ab8b5efea28adabe 100644 (file)
@@ -37,22 +37,6 @@ class Yammer_user extends Yammer_common
     public $__field = 'user_id';     // field to map to
     public $user_id;                 // int
 
-    /**
-     * Get an instance by key
-     *
-     * This is a utility method to get a single instance with a given key value.
-     *
-     * @param string $k Key to use to lookup
-     * @param mixed  $v Value to lookup
-     *
-     * @return Yammer_user object found, or null for no hits
-     *
-     */
-    function staticGet($k, $v=null)
-    {
-        return Memcached_DataObject::staticGet('Yammer_user', $k, $v);
-    }
-
     /**
      * Return schema definition to set this table up in onCheckSchema
      */