diff --git a/include/api.php b/include/api.php
index e0dc413c2..9f1ad44e5 100644
--- a/include/api.php
+++ b/include/api.php
@@ -23,6 +23,7 @@ use Friendica\Network\HTTPException\NotImplementedException;
use Friendica\Network\HTTPException\UnauthorizedException;
use Friendica\Network\HTTPException\TooManyRequestsException;
use Friendica\Object\Contact;
+use Friendica\Object\Photo;
use Friendica\Protocol\Diaspora;
use Friendica\Util\XML;
@@ -32,7 +33,6 @@ require_once 'include/conversation.php';
require_once 'include/oauth.php';
require_once 'include/html2plain.php';
require_once 'mod/share.php';
-require_once 'include/Photo.php';
require_once 'mod/item.php';
require_once 'include/security.php';
require_once 'include/contact_selectors.php';
diff --git a/include/follow.php b/include/follow.php
index 7e8b25d79..54ea9981f 100644
--- a/include/follow.php
+++ b/include/follow.php
@@ -8,13 +8,13 @@ use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
use Friendica\Network\Probe;
+use Friendica\Object\Photo;
use Friendica\Protocol\Diaspora;
use Friendica\Protocol\OStatus;
use Friendica\Protocol\PortableContact;
require_once 'include/group.php';
require_once 'include/salmon.php';
-require_once 'include/Photo.php';
function update_contact($id) {
/*
diff --git a/include/items.php b/include/items.php
index cffa12728..938925cb9 100644
--- a/include/items.php
+++ b/include/items.php
@@ -1,9 +1,7 @@
+/**
+ * @file mod/proxy.php
+ * @brief Based upon "Privacy Image Cache" by Tobias Hößl
+ */
use Friendica\App;
use Friendica\Core\Config;
use Friendica\Core\System;
use Friendica\Database\DBM;
+use Friendica\Object\Photo;
define('PROXY_DEFAULT_TIME', 86400); // 1 Day
@@ -15,7 +19,6 @@ define('PROXY_SIZE_MEDIUM', 'medium');
define('PROXY_SIZE_LARGE', 'large');
require_once 'include/security.php';
-require_once 'include/Photo.php';
function proxy_init(App $a) {
// Pictures are stored in one of the following ways:
diff --git a/mod/wall_upload.php b/mod/wall_upload.php
index d6cb0c2e1..5b5598a46 100644
--- a/mod/wall_upload.php
+++ b/mod/wall_upload.php
@@ -13,8 +13,7 @@ use Friendica\App;
use Friendica\Core\System;
use Friendica\Core\Config;
use Friendica\Database\DBM;
-
-require_once 'include/Photo.php';
+use Friendica\Object\Photo;
function wall_upload_post(App $a, $desktopmode = true) {
diff --git a/src/Model/GlobalContact.php b/src/Model/GlobalContact.php
index be8b28260..f0ad8faa1 100644
--- a/src/Model/GlobalContact.php
+++ b/src/Model/GlobalContact.php
@@ -10,6 +10,7 @@ use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
use Friendica\Network\Probe;
+use Friendica\Object\Photo;
use Friendica\Object\Profile;
use Friendica\Protocol\PortableContact;
use dba;
@@ -18,7 +19,6 @@ use Exception;
require_once 'include/datetime.php';
require_once 'include/network.php';
require_once 'include/html2bbcode.php';
-require_once 'include/Photo.php';
/**
* @brief This class handles GlobalContact related functions
diff --git a/src/Object/Contact.php b/src/Object/Contact.php
index d7e785362..9f81b98c4 100644
--- a/src/Object/Contact.php
+++ b/src/Object/Contact.php
@@ -13,6 +13,7 @@ use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
use Friendica\Network\Probe;
+use Friendica\Object\Photo;
use Friendica\Protocol\Diaspora;
use Friendica\Protocol\DFRN;
use Friendica\Protocol\OStatus;
@@ -643,8 +644,6 @@ class Contact extends BaseObject
}
}
- require_once 'include/Photo.php';
-
update_contact_avatar($data["photo"], $uid, $contact_id);
$contact = dba::select('contact', array('url', 'nurl', 'addr', 'alias', 'name', 'nick', 'keywords', 'location', 'about', 'avatar-date'), array('id' => $contact_id), array('limit' => 1));
diff --git a/include/Photo.php b/src/Object/Photo.php
similarity index 99%
rename from include/Photo.php
rename to src/Object/Photo.php
index 761abc770..b87a4b6e7 100644
--- a/include/Photo.php
+++ b/src/Object/Photo.php
@@ -1,8 +1,9 @@
imagick = class_exists('Imagick');
$this->types = static::supportedTypes();
if (!array_key_exists($type, $this->types)){
@@ -80,7 +82,8 @@ class Photo {
}
}
- public function is_imagick() {
+ public function is_imagick()
+ {
return $this->imagick;
}
diff --git a/src/ParseUrl.php b/src/ParseUrl.php
index 0183fdb3f..c5c23d7d9 100644
--- a/src/ParseUrl.php
+++ b/src/ParseUrl.php
@@ -6,6 +6,7 @@
namespace Friendica;
use Friendica\Core\Config;
+use Friendica\Object\Photo;
use Friendica\Util\XML;
use dba;
@@ -13,7 +14,6 @@ use DomXPath;
use DOMDocument;
require_once "include/network.php";
-require_once "include/Photo.php";
require_once "include/oembed.php";
/**
diff --git a/src/Protocol/Diaspora.php b/src/Protocol/Diaspora.php
index 4d91f8b1c..2ffaac642 100644
--- a/src/Protocol/Diaspora.php
+++ b/src/Protocol/Diaspora.php
@@ -19,6 +19,7 @@ use Friendica\Database\DBM;
use Friendica\Model\GlobalContact;
use Friendica\Network\Probe;
use Friendica\Object\Contact;
+use Friendica\Object\Photo;
use Friendica\Object\Profile;
use Friendica\Util\XML;
@@ -27,7 +28,6 @@ use SimpleXMLElement;
require_once 'include/items.php';
require_once 'include/bb2diaspora.php';
-require_once 'include/Photo.php';
require_once 'include/group.php';
require_once 'include/datetime.php';
require_once 'include/queue_fn.php';
diff --git a/src/Protocol/OStatus.php b/src/Protocol/OStatus.php
index ed762084c..206d188f5 100644
--- a/src/Protocol/OStatus.php
+++ b/src/Protocol/OStatus.php
@@ -12,6 +12,7 @@ use Friendica\Database\DBM;
use Friendica\Model\GlobalContact;
use Friendica\Network\Probe;
use Friendica\Object\Contact;
+use Friendica\Object\Photo;
use Friendica\Util\Lock;
use Friendica\Util\XML;
use dba;
@@ -24,7 +25,6 @@ require_once 'include/bbcode.php';
require_once 'include/items.php';
require_once 'mod/share.php';
require_once 'include/enotify.php';
-require_once 'include/Photo.php';
require_once 'include/follow.php';
require_once 'include/api.php';
require_once 'mod/proxy.php';
diff --git a/src/Protocol/PortableContact.php b/src/Protocol/PortableContact.php
index 59b3ad432..feb4dfdc8 100644
--- a/src/Protocol/PortableContact.php
+++ b/src/Protocol/PortableContact.php
@@ -14,6 +14,7 @@ use Friendica\Core\Worker;
use Friendica\Database\DBM;
use Friendica\Model\GlobalContact;
use Friendica\Network\Probe;
+use Friendica\Object\Photo;
use Friendica\Object\Profile;
use dba;
use DOMDocument;
@@ -23,7 +24,6 @@ use Exception;
require_once 'include/datetime.php';
require_once 'include/network.php';
require_once 'include/html2bbcode.php';
-require_once 'include/Photo.php';
class PortableContact
{
diff --git a/update.php b/update.php
index 21074c1d8..f228bf735 100644
--- a/update.php
+++ b/update.php
@@ -6,6 +6,7 @@ use Friendica\Core\Config;
use Friendica\Core\PConfig;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
+use Friendica\Object\Photo;
/**
*
@@ -146,8 +147,8 @@ function update_1013() {
AFTER `object` , ADD `target` TEXT NOT NULL AFTER `target-type`");
}
-function update_1014() {
- require_once('include/Photo.php');
+function update_1014()
+{
q("ALTER TABLE `contact` ADD `micro` TEXT NOT NULL AFTER `thumb` ");
$r = q("SELECT * FROM `photo` WHERE `scale` = 4");
if (DBM::is_result($r)) {
diff --git a/view/theme/frio/theme.php b/view/theme/frio/theme.php
index 35e40aa96..0a6b48e4e 100644
--- a/view/theme/frio/theme.php
+++ b/view/theme/frio/theme.php
@@ -12,6 +12,7 @@ use Friendica\Core\Config;
use Friendica\Core\PConfig;
use Friendica\Core\System;
use Friendica\Database\DBM;
+use Friendica\Object\Photo;
$frio = "view/theme/frio";
@@ -79,9 +80,8 @@ function frio_uninstall() {
* @param App $a Unused but required by hook definition
* @param array $body_info The item and its html output
*/
-function frio_item_photo_links(App $a, &$body_info) {
- require_once('include/Photo.php');
-
+function frio_item_photo_links(App $a, &$body_info)
+{
$phototypes = Photo::supportedTypes();
$occurence = 1;
$p = bb_find_open_close($body_info['html'], "");
diff --git a/view/theme/frost/theme.php b/view/theme/frost/theme.php
index 5023aeb9b..5d5162cd3 100644
--- a/view/theme/frost/theme.php
+++ b/view/theme/frost/theme.php
@@ -11,6 +11,7 @@
use Friendica\App;
use Friendica\Core\System;
+use Friendica\Object\Photo;
function frost_init(App $a) {
$a->videowidth = 400;
@@ -45,8 +46,8 @@ function frost_uninstall() {
logger("uninstalled theme frost");
}
-function frost_item_photo_links(App $a, &$body_info) {
- require_once('include/Photo.php');
+function frost_item_photo_links(App $a, &$body_info)
+{
$phototypes = Photo::supportedTypes();
$occurence = 1;