Class file relocations

Issue #3878
This commit is contained in:
Adam Magness 2017-11-07 22:57:46 -05:00
parent 6189f6c8e7
commit 4ca68c7af0
151 changed files with 987 additions and 8742 deletions

View file

@ -5,6 +5,7 @@ define('UPDATE_VERSION' , 1235);
use Friendica\Core\Config;
use Friendica\Core\PConfig;
use Friendica\Core\Worker;
use Friendica\Database\DBM;
/**
*
@ -89,7 +90,7 @@ function update_1006() {
// create 's' keys for everybody that does not have one
$r = q("SELECT * FROM `user` WHERE `spubkey` = '' ");
if (dbm::is_result($r)) {
if (DBM::is_result($r)) {
foreach ($r as $rr) {
$sres=openssl_pkey_new(array('encrypt_key' => false ));
$sprvkey = '';
@ -126,7 +127,7 @@ function update_1010() {
function update_1011() {
q("ALTER TABLE `contact` ADD `nick` CHAR( 255 ) NOT NULL AFTER `name` ");
$r = q("SELECT * FROM `contact` WHERE 1");
if (dbm::is_result($r)) {
if (DBM::is_result($r)) {
foreach ($r as $rr) {
q("UPDATE `contact` SET `nick` = '%s' WHERE `id` = %d",
dbesc(basename($rr['url'])),
@ -149,7 +150,7 @@ function update_1014() {
require_once('include/Photo.php');
q("ALTER TABLE `contact` ADD `micro` TEXT NOT NULL AFTER `thumb` ");
$r = q("SELECT * FROM `photo` WHERE `scale` = 4");
if (dbm::is_result($r)) {
if (DBM::is_result($r)) {
foreach ($r as $rr) {
$ph = new Photo($rr['data']);
if ($ph->is_valid()) {
@ -159,7 +160,7 @@ function update_1014() {
}
}
$r = q("SELECT * FROM `contact` WHERE 1");
if (dbm::is_result($r)) {
if (DBM::is_result($r)) {
foreach ($r as $rr) {
if(stristr($rr['thumb'],'avatar'))
q("UPDATE `contact` SET `micro` = '%s' WHERE `id` = %d",
@ -312,7 +313,7 @@ function update_1030() {
function update_1031() {
// Repair any bad links that slipped into the item table
$r = q("SELECT `id`, `object` FROM `item` WHERE `object` != '' ");
if (dbm::is_result($r)) {
if (DBM::is_result($r)) {
foreach ($r as $rr) {
if (strstr($rr['object'],'type="http')) {
q("UPDATE `item` SET `object` = '%s' WHERE `id` = %d",
@ -361,7 +362,7 @@ function update_1035() {
function update_1036() {
$r = dbq("SELECT * FROM `contact` WHERE `network` = 'dfrn' AND `photo` LIKE '%include/photo%' ");
if (dbm::is_result($r)) {
if (DBM::is_result($r)) {
foreach ($r as $rr) {
q("UPDATE `contact` SET `photo` = '%s', `thumb` = '%s', `micro` = '%s' WHERE `id` = %d",
dbesc(str_replace('include/photo','photo',$rr['photo'])),
@ -599,7 +600,7 @@ function update_1073() {
function update_1074() {
q("ALTER TABLE `user` ADD `hidewall` TINYINT( 1) NOT NULL DEFAULT '0' AFTER `blockwall` ");
$r = q("SELECT `uid` FROM `profile` WHERE `is-default` = 1 AND `hidewall` = 1");
if (dbm::is_result($r)) {
if (DBM::is_result($r)) {
foreach($r as $rr)
q("UPDATE `user` SET `hidewall` = 1 WHERE `uid` = %d",
intval($rr['uid'])
@ -611,7 +612,7 @@ function update_1074() {
function update_1075() {
q("ALTER TABLE `user` ADD `guid` CHAR( 16 ) NOT NULL AFTER `uid` ");
$r = q("SELECT `uid` FROM `user` WHERE 1");
if (dbm::is_result($r)) {
if (DBM::is_result($r)) {
foreach ($r as $rr) {
$found = true;
do {
@ -690,10 +691,10 @@ function update_1082() {
ADD INDEX ( `guid` ) ");
// make certain the following code is only executed once
$r = q("select `id` from `photo` where `guid` != '' limit 1");
if (dbm::is_result($r))
if (DBM::is_result($r))
return;
$r = q("SELECT distinct(`resource-id`) FROM `photo` WHERE 1 group by `id`");
if (dbm::is_result($r)) {
if (DBM::is_result($r)) {
foreach ($r as $rr) {
$guid = get_guid();
q("update `photo` set `guid` = '%s' where `resource-id` = '%s'",
@ -736,7 +737,7 @@ function update_1087() {
q("ALTER TABLE `item` ADD `commented` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' AFTER `edited` ");
$r = q("SELECT `id` FROM `item` WHERE `parent` = `id` ");
if (dbm::is_result($r)) {
if (DBM::is_result($r)) {
foreach ($r as $rr) {
$x = q("SELECT max(`created`) AS `cdate` FROM `item` WHERE `parent` = %d LIMIT 1",
intval($rr['id'])
@ -859,7 +860,7 @@ function update_1100() {
require_once('include/text.php');
$r = q("select id, url from contact where url != '' and nurl = '' ");
if (dbm::is_result($r)) {
if (DBM::is_result($r)) {
foreach ($r as $rr) {
q("update contact set nurl = '%s' where id = %d",
dbesc(normalise_link($rr['url'])),
@ -1035,7 +1036,7 @@ function update_1120() {
// might be missing on new installs. We'll check.
$r = q("describe item");
if (dbm::is_result($r)) {
if (DBM::is_result($r)) {
foreach($r as $rr)
if($rr['Field'] == 'spam')
return;
@ -1173,7 +1174,7 @@ function update_1136() {
// order in reverse so that we save the newest entry
$r = q("select * from config where 1 order by id desc");
if (dbm::is_result($r)) {
if (DBM::is_result($r)) {
foreach ($r as $rr) {
$found = false;
foreach($arr as $x) {
@ -1192,7 +1193,7 @@ function update_1136() {
$arr = array();
$r = q("select * from pconfig where 1 order by id desc");
if (dbm::is_result($r)) {
if (DBM::is_result($r)) {
foreach ($r as $rr) {
$found = false;
foreach($arr as $x) {
@ -1697,7 +1698,7 @@ function update_1190() {
);
// convert old forumlist addon entries in new config entries
if (dbm::is_result($r)) {
if (DBM::is_result($r)) {
foreach ($r as $rr) {
$uid = $rr['uid'];
$family = $rr['cat'];