From: Mikael Nordfeldth Date: Sun, 20 Apr 2014 14:06:41 +0000 (+0200) Subject: File_oembed::saveNew are File::saveNew are static X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=43a3f5ea90cbaad8faa171fe1ac951759a092746;p=quix0rs-gnu-social.git File_oembed::saveNew are File::saveNew are static Also did some non-backwards-compatible (to StatusNet) code cleanup. --- diff --git a/classes/File.php b/classes/File.php index 022c6877ca..f58a75d9d3 100644 --- a/classes/File.php +++ b/classes/File.php @@ -74,7 +74,7 @@ class File extends Managed_DataObject * @param string $given_url * @return File */ - function saveNew(array $redir_data, $given_url) { + public static function saveNew(array $redir_data, $given_url) { // I don't know why we have to keep doing this but I'm adding this last check to avoid // uniqueness bugs. diff --git a/classes/File_oembed.php b/classes/File_oembed.php index e12a18a2e0..11d054aa4d 100644 --- a/classes/File_oembed.php +++ b/classes/File_oembed.php @@ -17,10 +17,7 @@ * along with this program. If not, see . */ -if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } - -require_once INSTALLDIR.'/classes/Memcached_DataObject.php'; -require_once INSTALLDIR.'/classes/File_redirection.php'; +if (!defined('GNUSOCIAL')) { exit(1); } /** * Table Definition for file_oembed @@ -28,9 +25,6 @@ require_once INSTALLDIR.'/classes/File_redirection.php'; class File_oembed extends Managed_DataObject { - ###START_AUTOCODE - /* the code below is auto generated do not remove the above tag */ - public $__table = 'file_oembed'; // table name public $file_id; // int(4) primary_key not_null public $version; // varchar(20) @@ -47,9 +41,6 @@ class File_oembed extends Managed_DataObject public $url; // varchar(255) public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP - /* the code above is auto generated do not remove the tag below */ - ###END_AUTOCODE - public static function schemaDef() { return array( @@ -100,7 +91,7 @@ class File_oembed extends Managed_DataObject * @param object $data Services_oEmbed_Object_* * @param int $file_id */ - function saveNew($data, $file_id) { + public static function saveNew($data, $file_id) { $file_oembed = new File_oembed; $file_oembed->file_id = $file_id; if (!isset($data->version)) {