Code standards
This commit is contained in:
parent
d6242aacf6
commit
d658c81107
1 changed files with 6 additions and 5 deletions
|
@ -84,9 +84,10 @@ HELP;
|
||||||
{
|
{
|
||||||
$condition = ["`avatar` != ? AND `photo` LIKE ? AND `uid` = ? AND `uri-id` != ? AND NOT `uri-id` IS NULL",
|
$condition = ["`avatar` != ? AND `photo` LIKE ? AND `uid` = ? AND `uri-id` != ? AND NOT `uri-id` IS NULL",
|
||||||
'', $this->baseurl->get() . '/photo/%', 0, 0];
|
'', $this->baseurl->get() . '/photo/%', 0, 0];
|
||||||
$total = $this->dba->count('contact', $condition);
|
|
||||||
|
$count = 0;
|
||||||
|
$total = $this->dba->count('contact', $condition);
|
||||||
$contacts = $this->dba->select('contact', ['id', 'avatar', 'photo', 'uri-id', 'url', 'avatar'], $condition, ['order' => ['id' => true]]);
|
$contacts = $this->dba->select('contact', ['id', 'avatar', 'photo', 'uri-id', 'url', 'avatar'], $condition, ['order' => ['id' => true]]);
|
||||||
$count = 0;
|
|
||||||
while ($contact = $this->dba->fetch($contacts)) {
|
while ($contact = $this->dba->fetch($contacts)) {
|
||||||
echo ++$count . '/' . $total . "\t" . $contact['id'] . "\t" . $contact['url'] . "\t";
|
echo ++$count . '/' . $total . "\t" . $contact['id'] . "\t" . $contact['url'] . "\t";
|
||||||
$resourceid = Photo::ridFromURI($contact['photo']);
|
$resourceid = Photo::ridFromURI($contact['photo']);
|
||||||
|
@ -100,7 +101,7 @@ HELP;
|
||||||
echo $this->l10n->t('no photo') . "\n";
|
echo $this->l10n->t('no photo') . "\n";
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '2';
|
echo '2';
|
||||||
$imgdata = Photo::getImageDataForPhoto($photo);
|
$imgdata = Photo::getImageDataForPhoto($photo);
|
||||||
if (empty($imgdata)) {
|
if (empty($imgdata)) {
|
||||||
|
@ -113,7 +114,7 @@ HELP;
|
||||||
echo $this->l10n->t('invalid image') . "\n";
|
echo $this->l10n->t('invalid image') . "\n";
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '4';
|
echo '4';
|
||||||
$fields = Avatar::storeAvatarByImage($contact, $image);
|
$fields = Avatar::storeAvatarByImage($contact, $image);
|
||||||
echo '5';
|
echo '5';
|
||||||
|
@ -122,7 +123,7 @@ HELP;
|
||||||
Photo::delete(['resource-id' => $resourceid]);
|
Photo::delete(['resource-id' => $resourceid]);
|
||||||
echo ' '.$fields['photo'] . "\n";
|
echo ' '.$fields['photo'] . "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue